wt1.1c auth->cache, control page, animation base exercise percent
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:aitrainer_app/model/auth.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/customer.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
@@ -14,8 +14,8 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
|
||||
final CustomerRepository customerRepository;
|
||||
bool loggedIn = false;
|
||||
AccountBloc({this.customerRepository}) : super(AccountInitial()) {
|
||||
if ( Auth().userLoggedIn != null ) {
|
||||
customerRepository.customer = Auth().userLoggedIn;
|
||||
if ( Cache().userLoggedIn != null ) {
|
||||
customerRepository.customer = Cache().userLoggedIn;
|
||||
loggedIn = true;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
|
||||
customerRepository.customer = event.customer;
|
||||
yield AccountLoggedIn();
|
||||
} else if (event is AccountLogout) {
|
||||
await Auth().logout();
|
||||
await Cache().logout();
|
||||
customerRepository.customer = null;
|
||||
loggedIn = false;
|
||||
yield AccountLoggedOut();
|
||||
|
||||
Reference in New Issue
Block a user