diff --git a/lib/app/modules/global/binding.dart b/lib/app/modules/global/binding.dart index 66c771f..603d266 100644 --- a/lib/app/modules/global/binding.dart +++ b/lib/app/modules/global/binding.dart @@ -1,8 +1,4 @@ - - import 'package:get/get.dart'; -import 'package:speed_test_app/app/data/providers/speedtest/storage_provider.dart'; -import 'package:speed_test_app/app/data/services/storage/repository.dart'; import 'package:speed_test_app/app/modules/home/controller.dart'; import 'package:speed_test_app/app/modules/global/controller.dart'; import 'package:speed_test_app/app/modules/settings/controller.dart'; @@ -12,9 +8,7 @@ class GlobalBinding implements Bindings { @override void dependencies() { Get.lazyPut(() => GlobalController()); - Get.lazyPut(() => HomeController( - speedtestRepository: SpeedtestRepository( - speedtestStorageProvider: SpeedtestStorageProvider()))); + Get.lazyPut(() => HomeController()); Get.lazyPut(() => SettingsController()); } diff --git a/lib/app/modules/home/binding.dart b/lib/app/modules/home/binding.dart deleted file mode 100644 index b832aee..0000000 --- a/lib/app/modules/home/binding.dart +++ /dev/null @@ -1,19 +0,0 @@ - - -import 'package:get/get.dart'; -import 'package:speed_test_app/app/data/providers/speedtest/storage_provider.dart'; -import 'package:speed_test_app/app/data/services/storage/repository.dart'; -import 'package:speed_test_app/app/modules/home/controller.dart'; - -class HomeBinding implements Bindings { - - @override - void dependencies() { - Get.lazyPut(() => HomeController( - speedtestRepository: SpeedtestRepository( - speedtestStorageProvider: SpeedtestStorageProvider() - ) - )); - } - -} \ No newline at end of file diff --git a/lib/app/modules/settings/controller.dart b/lib/app/modules/settings/controller.dart index 44e94fd..59c030d 100644 --- a/lib/app/modules/settings/controller.dart +++ b/lib/app/modules/settings/controller.dart @@ -7,6 +7,7 @@ import 'package:get/get.dart'; class Location { late final latitude = 0.0.obs; late final longitude = 0.0.obs; + late final city = "".obs; } class SettingsController extends GetxController { @@ -27,6 +28,7 @@ class SettingsController extends GetxController { nameServer.value = value.as?.name ?? "undefined"; location.longitude.value = value.location?.lng ?? 0; location.latitude.value = value.location?.lat ?? 0; + location.city.value = value.location?.city ?? "Somewhere"; }); } @@ -38,12 +40,16 @@ class SettingsController extends GetxController { return nameServer.value; } - double? getLocationLatitude() { + double getLocationLatitude() { return location.latitude.value; } - double? getLocationLongitude() { + double getLocationLongitude() { return location.longitude.value; } + String getLocationCity() { + return location.city.value; + } + } \ No newline at end of file diff --git a/lib/app/widgets/button_builder.dart b/lib/app/widgets/button_builder.dart index 7f447b3..c26caaf 100644 --- a/lib/app/widgets/button_builder.dart +++ b/lib/app/widgets/button_builder.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class ButtonBuilder extends StatelessWidget { - final String text; + final String? text; final BorderRadiusGeometry? borderRadius; final BorderSide? border; final double? width; @@ -41,9 +41,9 @@ class ButtonBuilder extends StatelessWidget { crossAxisAlignment: WrapCrossAlignment.center, spacing: 15, children: [ - Text(text, + if(text != null) Text(text!, textAlign: TextAlign.center, - style: style ?? const TextStyle(fontSize: 18, fontWeight: FontWeight.w700) + style: style ?? const TextStyle(fontSize: 20, fontWeight: FontWeight.w300) ), if(icon != null) Icon(icon, size: 22), ], @@ -54,7 +54,7 @@ class ButtonBuilder extends StatelessWidget { primary: color ?? Colors.white, side: border, shape: RoundedRectangleBorder( - borderRadius: borderRadius ?? BorderRadius.circular(16), + borderRadius: borderRadius ?? BorderRadius.circular(50), ) ), );