Skip to content

Commit

Permalink
fix(#59): correção de cores e caminhos
Browse files Browse the repository at this point in the history
Co-authored-by: zDrNz <[email protected]>
  • Loading branch information
GabrielCostaDeOliveira and zDrNz committed Dec 18, 2024
1 parent 291d1a7 commit 7fd2366
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
17 changes: 5 additions & 12 deletions lib/ui/login/view/LoginView.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/ui/home/view/HomeView.dart';
import 'package:aranduapp/ui/navbar/view/navBarView.dart';
import 'package:aranduapp/ui/shared/TextAndLink.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -93,12 +93,7 @@ class _LoginState extends State<_Login> {
child: ElevatedButton(
onPressed: () async {
viewModel.loginWithDeviceAuth().then((ok) {
if (ok)
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const HomeView(),
),
);
viewModel.goNextPage();
});
},
child: const Text('Usar senha do celular'),
Expand Down Expand Up @@ -190,11 +185,9 @@ class _LoginState extends State<_Login> {
child: ElevatedButton(
onPressed: () {
viewModel.loginWithEmailAndPassword().then((_) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const HomeView(),
),
);

viewModel.goNextPage();

}).catchError((e) => showDialog<Object>(
context: context,
builder: (BuildContext context) =>
Expand Down
13 changes: 12 additions & 1 deletion lib/ui/login/viewModel/LoginViewModel.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/ui/navbar/view/navBarView.dart';
import 'package:flutter/material.dart';
import 'package:local_auth/local_auth.dart';
import 'package:aranduapp/ui/login/service/LoginService.dart';
Expand Down Expand Up @@ -46,12 +47,22 @@ class LoginViewModel extends ChangeNotifier {
}

Future<void> getRefreshTokenFuture() async {
await LoginService.refreshToken();
await Future.delayed(const Duration(seconds: 2));

//await LoginService.refreshToken();
}

Future<bool> loginWithDeviceAuth() async {
Log.d('init loginWithDeviceAuth');
return await LocalAuthentication()
.authenticate(localizedReason: 'Toque com o dedo no sensor para logar');
}

void goNextPage() {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const NavbarView(),
),
);
}
}
5 changes: 2 additions & 3 deletions lib/ui/navbar/view/navBarView.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:aranduapp/ui/home/view/HomeView.dart';
//import 'package:aranduapp/ui/profile/view/profileView.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:aranduapp/ui/navbar/model/navBarViewModel.dart';
Expand Down Expand Up @@ -34,8 +33,8 @@ Widget page(BuildContext context) {
bottomNavigationBar: BottomNavigationBar(
currentIndex: viewModel.selectedIndex,
onTap: viewModel.changeTab,
selectedItemColor: Colors.cyan[400],
unselectedItemColor: Colors.grey,
selectedItemColor: Theme.of(context).colorScheme.primary,
unselectedItemColor:Theme.of(context).colorScheme.onSurface,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home_outlined),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/welcome/view/WelcomeView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WelcomeView extends StatelessWidget {
onTap: () => {


Navigator.of(context).push(
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const OnboardingView(),
),
Expand Down

0 comments on commit 7fd2366

Please sign in to comment.