-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating adding Navigation (2.0), updating the flow between modules-s…
…ervices-repositories and fixing assets
- Loading branch information
1 parent
f742220
commit 07dbfa2
Showing
12 changed files
with
117 additions
and
28 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
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,15 @@ | ||
import 'package:get/get.dart'; | ||
|
||
import 'home_controller.dart'; | ||
|
||
class HomeBindings implements Bindings { | ||
@override | ||
void dependencies() { | ||
Get.lazyPut( | ||
() => HomeController( | ||
loginService: Get.find(), | ||
), | ||
fenix: true, | ||
); | ||
} | ||
} |
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,36 @@ | ||
import 'package:get/get.dart'; | ||
|
||
import 'package:app_filmes/services/login/login_service.dart'; | ||
|
||
class HomeController extends GetxController { | ||
// ignore: constant_identifier_names | ||
static const NAVIGATOR_KEY = 1; | ||
// ignore: constant_identifier_names | ||
static const INDEX_PAGE_EXIT = 2; | ||
|
||
final LoginService _loginService; | ||
HomeController({ | ||
required LoginService loginService, | ||
}) : _loginService = loginService; | ||
|
||
final _pages = [ | ||
'/movies', | ||
'/favorites', | ||
]; | ||
|
||
final _pageIndex = 0.obs; | ||
|
||
int get pageIndex => _pageIndex.value; | ||
|
||
void goToPage(int page) { | ||
_pageIndex(page); | ||
if (page == INDEX_PAGE_EXIT) { | ||
_loginService.logout(); | ||
} else { | ||
Get.offNamed( | ||
_pages[page], | ||
id: NAVIGATOR_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
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
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
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,9 +1,5 @@ | ||
import 'package:get/get.dart'; | ||
|
||
class SplashController extends GetxController { | ||
@override | ||
void onReady() { | ||
super.onReady(); | ||
Get.offAllNamed('/login'); | ||
} | ||
|
||
} |
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
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
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
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
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