mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-29 04:30:02 +00:00
connection
This commit is contained in:
parent
1f03ca6b42
commit
d2e47e63a4
8 changed files with 30 additions and 20 deletions
|
@ -40,7 +40,7 @@ class LocationController extends GetxController {
|
|||
|
||||
final hourOfDay = 0.obs;
|
||||
final dayOfNow = 0.obs;
|
||||
final ItemScrollController itemScrollController = ItemScrollController();
|
||||
final itemScrollController = ItemScrollController();
|
||||
final cacheExpiry = DateTime.now().subtract(const Duration(hours: 6));
|
||||
|
||||
@override
|
||||
|
|
|
@ -19,11 +19,11 @@ class HomePage extends StatefulWidget {
|
|||
|
||||
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
int tabIndex = 0;
|
||||
bool visible = false;
|
||||
final locationController = Get.put(LocationController());
|
||||
final TextEditingController _controller = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
late TabController tabController;
|
||||
final locationController = Get.put(LocationController());
|
||||
bool visible = false;
|
||||
final _controller = TextEditingController();
|
||||
final _focusNode = FocusNode();
|
||||
|
||||
final pages = [
|
||||
const WeatherPage(),
|
||||
|
|
|
@ -26,7 +26,7 @@ class _InfoWeatherCardState extends State<InfoWeatherCard> {
|
|||
int timeNow = 0;
|
||||
int dayNow = 0;
|
||||
final locationController = Get.put(LocationController());
|
||||
final ItemScrollController itemScrollController = ItemScrollController();
|
||||
final itemScrollController = ItemScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
|
@ -25,7 +25,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||
String? appVersion;
|
||||
|
||||
Future<void> infoVersion() async {
|
||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
setState(() {
|
||||
appVersion = packageInfo.version;
|
||||
});
|
||||
|
@ -423,7 +423,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||
'metric'.tr,
|
||||
'imperial'.tr
|
||||
],
|
||||
dropdownCange: (String? newValue) async{
|
||||
dropdownCange: (String? newValue) async {
|
||||
isar.writeTxn(() async {
|
||||
settings.measurements =
|
||||
newValue == 'metric'.tr
|
||||
|
|
|
@ -49,6 +49,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
|
|||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Flexible(
|
||||
child: Image.asset(
|
||||
'assets/images/sunrise.png',
|
||||
|
@ -80,6 +81,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
|
|||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Flexible(
|
||||
child: Image.asset(
|
||||
'assets/images/sunset.png',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:connecteo/connecteo.dart';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -8,7 +9,6 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_timezone/flutter_timezone.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:rain/app/modules/home.dart';
|
||||
|
@ -24,7 +24,7 @@ import 'package:timezone/timezone.dart' as tz;
|
|||
late Isar isar;
|
||||
late Settings settings;
|
||||
final ValueNotifier<Future<bool>> isDeviceConnectedNotifier =
|
||||
ValueNotifier(InternetConnection().hasInternetAccess);
|
||||
ValueNotifier(ConnectionChecker().isConnected);
|
||||
|
||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
|
@ -75,7 +75,7 @@ void main() async {
|
|||
.onConnectivityChanged
|
||||
.listen((ConnectivityResult result) async {
|
||||
if (result != ConnectivityResult.none) {
|
||||
isDeviceConnectedNotifier.value = InternetConnection().hasInternetAccess;
|
||||
isDeviceConnectedNotifier.value = ConnectionChecker().isConnected;
|
||||
} else {
|
||||
isDeviceConnectedNotifier.value = Future(() => false);
|
||||
}
|
||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -161,6 +161,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.17.1"
|
||||
connecteo:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: connecteo
|
||||
sha256: c2b446741a8506281e2d5a387299a3a36c91e259d4dd454d744fed7958d350b0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
connectivity_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -541,14 +549,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.17"
|
||||
internet_connection_checker_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: internet_connection_checker_plus
|
||||
sha256: dd98ac57e2d1cf283f16a5759f6d98905499449cafb47375bbf7001352a7feec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -805,6 +805,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.3"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rxdart
|
||||
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.27.7"
|
||||
scrollable_positioned_list:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -20,6 +20,7 @@ dependencies:
|
|||
shimmer: ^3.0.0
|
||||
iconsax: ^0.0.8
|
||||
timezone: ^0.9.2
|
||||
connecteo: ^1.1.1
|
||||
geocoding: ^2.1.0
|
||||
geolocator: ^9.0.2
|
||||
workmanager: ^0.5.1
|
||||
|
@ -38,7 +39,6 @@ dependencies:
|
|||
lat_lng_to_timezone: ^0.2.0
|
||||
scrollable_positioned_list: ^0.3.8
|
||||
flutter_local_notifications: ^15.1.0+1
|
||||
internet_connection_checker_plus: ^2.0.0
|
||||
|
||||
# Uncomment this for publishing FLOSS variant
|
||||
# dependency_overrides:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue