Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## WEB Configuration of this project

Inside the web folder on the index.html and set your keys.
Like in this page [Firebase web installation](https://firebase.flutter.dev/docs/installation/web/)
20 changes: 13 additions & 7 deletions lib/app/app_controller.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions lib/app/app_module.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import 'package:login/app/app_controller.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:flutter/material.dart';
import 'package:login/app/app_widget.dart';
import 'package:login/app/modules/home/home_module.dart';
import 'package:login/app/shared/auth/auth_controller.dart';
import 'package:login/app/shared/auth/repositories/auth_repository.dart';
import 'package:login/app/shared/repositories/localstorage/local_storage_hive.dart';
import 'package:login/app/shared/repositories/localstorage/local_storage_interface.dart';
import 'package:login/app/shared/repositories/localstorage/local_storage_share.dart';

import 'modules/login/login_module.dart';
import 'shared/auth/repositories/auth_repository_interface.dart';
import 'splash/splash_page.dart';

class AppModule extends MainModule {
class AppModule extends Module {
@override
List<Bind> get binds => [
Bind((i) => AppController()),
Expand All @@ -24,15 +21,10 @@ class AppModule extends MainModule {
];

@override
List<Router> get routers => [
Router('/', child: (_, args) => SplashPage()),
Router('/login',
List<ModularRoute> get routers => [
ChildRoute('/', child: (_, args) => SplashPage()),
ModuleRoute('/login',
module: LoginModule(), transition: TransitionType.noTransition),
Router('/home', module: HomeModule()),
ModuleRoute('/home', module: HomeModule()),
];

@override
Widget get bootstrap => AppWidget();

static Inject get to => Inject.of();
}
4 changes: 1 addition & 3 deletions lib/app/app_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ class AppWidget extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
navigatorKey: Modular.navigatorKey,
title: 'Flutter Slidy',
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: '/',
onGenerateRoute: Modular.generateRoute,
);
).modular();
}
}
2 changes: 1 addition & 1 deletion lib/app/modules/home/components/item/item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ItemWidget extends StatelessWidget {

final HomeController controller = Modular.get();

ItemWidget({Key key, this.index}) : super(key: key);
ItemWidget({Key? key, required this.index}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down
5 changes: 2 additions & 3 deletions lib/app/modules/home/home_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ abstract class _HomeBase with Store {
_HomeBase() {
init();
textController.addListener(() {
disableAdd = textController.text == null ||
textController.text.isEmpty ||
textController.text.length < 3;
disableAdd =
textController.text.isEmpty || textController.text.length < 3;
});
}

Expand Down
34 changes: 20 additions & 14 deletions lib/app/modules/home/home_controller.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions lib/app/modules/home/home_module.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:login/app/modules/home/home_controller.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:login/app/modules/home/home_page.dart';
import 'package:login/app/shared/repositories/localstorage/local_storage_interface.dart';
import 'package:login/app/shared/repositories/localstorage/local_storage_share.dart';

class HomeModule extends ChildModule {
class HomeModule extends Module {
@override
List<Bind> get binds => [
Bind((i) {
Expand All @@ -13,9 +11,7 @@ class HomeModule extends ChildModule {
];

@override
List<Router> get routers => [
Router('/', child: (_, args) => HomePage()),
List<ModularRoute> get routers => [
ChildRoute('/', child: (_, args) => HomePage()),
];

static Inject get to => Inject.of();
}
2 changes: 1 addition & 1 deletion lib/app/modules/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'home_controller.dart';

class HomePage extends StatefulWidget {
final String title;
const HomePage({Key key, this.title = "Home"}) : super(key: key);
const HomePage({Key? key, this.title = "Home"}) : super(key: key);

@override
_HomePageState createState() => _HomePageState();
Expand Down
20 changes: 13 additions & 7 deletions lib/app/modules/login/login_controller.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions lib/app/modules/login/login_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import 'package:flutter_modular/flutter_modular.dart';

import 'login_controller.dart';

class LoginModule extends ChildModule {
class LoginModule extends Module {
@override
List<Bind> get binds => [
Bind((i) => LoginController()),
];

@override
List<Router> get routers => [
Router('/', child: (_, args) => LoginPage()),
List<ModularRoute> get routers => [
ChildRoute('/', child: (_, args) => LoginPage()),
];

static Inject get to => Inject<LoginModule>.of();
}
2 changes: 1 addition & 1 deletion lib/app/modules/login/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'login_controller.dart';

class LoginPage extends StatefulWidget {
final String title;
const LoginPage({Key key, this.title = "Login"}) : super(key: key);
const LoginPage({Key? key, this.title = "Login"}) : super(key: key);

@override
_LoginPageState createState() => _LoginPageState();
Expand Down
6 changes: 3 additions & 3 deletions lib/app/shared/auth/auth_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ abstract class _AuthControllerBase with Store {
AuthStatus status = AuthStatus.loading;

@observable
FirebaseUser user;
User? user;

@action
setUser(FirebaseUser value) {
setUser(User? value) {
user = value;
status = user == null ? AuthStatus.logoff : AuthStatus.login;
}

_AuthControllerBase() {
_authRepository.getUser().then(setUser).catchError((e) {
print('ERRORRRRRR');
print('ERROR: $e');
});
}

Expand Down
Loading