-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
small cleaning of the project structure
+ ipify api + dotenv package + setting page
- Loading branch information
Showing
14 changed files
with
502 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IPIFY_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.env.development | ||
.env.production | ||
|
||
# Miscellaneous | ||
*.class | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
|
||
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/home/global/controller.dart'; | ||
import 'package:speed_test_app/app/modules/settings/controller.dart'; | ||
|
||
class GlobalBinding implements Bindings { | ||
|
||
@override | ||
void dependencies() { | ||
Get.lazyPut<GlobalController>(() => GlobalController()); | ||
Get.lazyPut<HomeController>(() => HomeController( | ||
speedtestRepository: SpeedtestRepository( | ||
speedtestStorageProvider: SpeedtestStorageProvider()))); | ||
Get.lazyPut<SettingsController>(() => SettingsController()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:get/get.dart'; | ||
|
||
class GlobalController extends GetxController { | ||
|
||
final pageIndex = 0.obs; | ||
|
||
GlobalController(); | ||
|
||
void changePageIndex(int index) { | ||
pageIndex.value = index != 2 ? index : 0; | ||
} | ||
|
||
int getPageIndex() { | ||
return pageIndex.value; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:speed_test_app/app/core/values/colors.dart'; | ||
import 'package:speed_test_app/app/modules/home/global/controller.dart'; | ||
import 'package:speed_test_app/app/modules/home/global/widgets/bottom_nav_bar.dart'; | ||
import 'package:speed_test_app/app/modules/home/view.dart'; | ||
import 'package:speed_test_app/app/modules/settings/view.dart'; | ||
|
||
class GlobalPage extends GetView<GlobalController> { | ||
|
||
const GlobalPage({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Obx(() => IndexedStack( | ||
index: controller.getPageIndex(), | ||
children: [ | ||
const HomePage(), | ||
const SizedBox(), | ||
const SizedBox(), | ||
const SizedBox(), | ||
SettingsPage() | ||
], | ||
)), | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: () {}, | ||
backgroundColor: primary, | ||
elevation: 0, | ||
enableFeedback: true, | ||
child: Container( | ||
decoration: BoxDecoration( | ||
border: Border.all(color: Colors.white, width: 2), | ||
borderRadius: BorderRadius.circular(50) | ||
), | ||
child: const Icon(Icons.arrow_upward_rounded) | ||
), | ||
), | ||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | ||
bottomNavigationBar: BottomNavBar() | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:speed_test_app/app/core/values/colors.dart'; | ||
import 'package:speed_test_app/app/modules/home/global/controller.dart'; | ||
|
||
class BottomNavBar extends StatelessWidget { | ||
|
||
final controller = Get.find<GlobalController>(); | ||
|
||
BottomNavBar({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
border: Border(top: BorderSide(color: Colors.grey[200]!)) | ||
), | ||
child: Obx(() => BottomNavigationBar( | ||
onTap: (int index) => controller.changePageIndex(index), | ||
elevation: 0, | ||
currentIndex: controller.pageIndex.value, | ||
showSelectedLabels: false, | ||
showUnselectedLabels: false, | ||
enableFeedback: true, | ||
unselectedItemColor: primary, | ||
selectedItemColor: accent, | ||
type: BottomNavigationBarType.fixed, | ||
items: const [ | ||
BottomNavigationBarItem( | ||
label: 'home', | ||
tooltip: "", | ||
icon: Icon(Icons.cottage_outlined) | ||
), | ||
BottomNavigationBarItem( | ||
label: 'statistics', | ||
tooltip: "", | ||
icon: Icon(Icons.bar_chart) | ||
), | ||
BottomNavigationBarItem( | ||
label: '', | ||
tooltip: "", | ||
icon: Icon(Icons.arrow_upward_outlined, color: Colors.transparent) | ||
), | ||
BottomNavigationBarItem( | ||
label: 'history', | ||
tooltip: "", | ||
icon: Icon(Icons.check_circle_outlined) | ||
), | ||
BottomNavigationBarItem( | ||
label: 'settings', | ||
tooltip: "", | ||
icon: Icon(Icons.settings_outlined) | ||
) | ||
], | ||
)) | ||
); | ||
} | ||
} |
Oops, something went wrong.