This commit is contained in:
J. A. Messias 2025-01-29 15:38:33 -03:00
parent 1b06c57ef2
commit 84f04dc069
17 changed files with 1002 additions and 428 deletions

View File

@ -6,7 +6,8 @@ class AuthenticationTest {
'Sign-In with fuzzed emails', 'Sign-In with fuzzed emails',
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Authentication Test - Sign-In with fuzzed emails'); $.tester
.printToConsole('Authentication Test - Sign-In with fuzzed emails');
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget); final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
final Fuzzer fuzzer = Fuzzer( final Fuzzer fuzzer = Fuzzer(
@ -32,7 +33,8 @@ class AuthenticationTest {
], ],
iterations: 2, iterations: 2,
); );
Map<String, String> concat(String username, String domain, String password) { Map<String, String> concat(
String username, String domain, String password) {
return { return {
'emailTextFormField': '${username}@${domain}.test', 'emailTextFormField': '${username}@${domain}.test',
'passwordTextFormField': password, 'passwordTextFormField': password,
@ -61,7 +63,8 @@ class AuthenticationTest {
'Sign-In with email_app@exemplo.com', 'Sign-In with email_app@exemplo.com',
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Authentication Test - Sign-In with email_app@exemplo.com'); $.tester.printToConsole(
'Authentication Test - Sign-In with email_app@exemplo.com');
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget); final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
final Map<String, String> credentials = { final Map<String, String> credentials = {
@ -82,7 +85,8 @@ class AuthenticationTest {
'Sign Up - credenciais já registradas', 'Sign Up - credenciais já registradas',
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Authentication Test - Sign-Up: credenciais já registradas'); $.tester.printToConsole(
'Authentication Test - Sign-Up: credenciais já registradas');
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget); final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
final Map<String, String> credentials = { final Map<String, String> credentials = {
@ -102,7 +106,8 @@ class AuthenticationTest {
'Sign Up - credenciais novas', 'Sign Up - credenciais novas',
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Authentication Test - Sign-Up: credenciais novas'); $.tester
.printToConsole('Authentication Test - Sign-Up: credenciais novas');
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget); final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
@ -135,7 +140,8 @@ class AuthenticationTest {
], ],
iterations: 2, iterations: 2,
); );
Map<String, String> concat(String name, String username, String domain, String password) { Map<String, String> concat(
String name, String username, String domain, String password) {
return { return {
'nameTextFormField': name, 'nameTextFormField': name,
'emailTextFormField': '${username}@${domain}.test', 'emailTextFormField': '${username}@${domain}.test',
@ -168,7 +174,8 @@ class AuthenticationTest {
'Deslogar da Conta', 'Deslogar da Conta',
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Authentication Test - Sign-Out: Deslogar da Conta'); $.tester.printToConsole(
'Authentication Test - Sign-Out: Deslogar da Conta');
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount($);
await $.pumpWidget(const App()); await $.pumpWidget(const App());
@ -179,7 +186,9 @@ class AuthenticationTest {
await $.waitUntilVisible($(MenuListView)); await $.waitUntilVisible($(MenuListView));
await $(Icons.exit_to_app).waitUntilVisible().tap(settlePolicy: SettlePolicy.trySettle); await $(Icons.exit_to_app)
.waitUntilVisible()
.tap(settlePolicy: SettlePolicy.trySettle);
await Future.delayed(const Duration(milliseconds: 500)); await Future.delayed(const Duration(milliseconds: 500));
}, },
@ -230,7 +239,8 @@ Future<void> _enterCredentials(
} }
} }
Future<void> _submit(String key, PatrolTester $, PatrolFinder throwsException) async { Future<void> _submit(
String key, PatrolTester $, PatrolFinder throwsException) async {
await $(ValueKey(key)) // await $(ValueKey(key)) //
.waitUntilVisible() .waitUntilVisible()
.tap(); .tap();
@ -248,5 +258,6 @@ Future<void> _submit(String key, PatrolTester $, PatrolFinder throwsException) a
String _generateRandomString(int length) { String _generateRandomString(int length) {
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
final rand = Random(); final rand = Random();
return List.generate(length, (index) => chars[rand.nextInt(chars.length)]).join(); return List.generate(length, (index) => chars[rand.nextInt(chars.length)])
.join();
} }

View File

@ -16,7 +16,8 @@ void patrol(
bool? skip, bool? skip,
List<String> tags = const [], List<String> tags = const [],
NativeAutomatorConfig? nativeAutomatorConfig, NativeAutomatorConfig? nativeAutomatorConfig,
LiveTestWidgetsFlutterBindingFramePolicy framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fadePointers, LiveTestWidgetsFlutterBindingFramePolicy framePolicy =
LiveTestWidgetsFlutterBindingFramePolicy.fadePointers,
}) { }) {
patrolTest( patrolTest(
description, description,

View File

@ -0,0 +1 @@

View File

@ -57,7 +57,8 @@ class LocalsTest {
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
await $.waitUntilVisible($(LocalProfileComponentWidget)); await $.waitUntilVisible($(LocalProfileComponentWidget));
final PatrolFinder profileFinder = $(#AsyncLocalProfileComponentWidget_InkWell); final PatrolFinder profileFinder =
$(#AsyncLocalProfileComponentWidget_InkWell);
expect(profileFinder, findsOneWidget); expect(profileFinder, findsOneWidget);
await $(profileFinder) // await $(profileFinder) //
@ -183,10 +184,12 @@ class LocalsTest {
// // } // // }
// }, // },
// ); // );
patrolWidgetTest('Desvincular do local selecionado com somente um local disponivel', // patrolWidgetTest(
'Desvincular do local selecionado com somente um local disponivel', //
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Locals Test - Desvincular do local selecionado com multiplos locais disponiveis'); $.tester.printToConsole(
'Locals Test - Desvincular do local selecionado com multiplos locais disponiveis');
await _loggedWithSomeoneLocalAccount($); await _loggedWithSomeoneLocalAccount($);
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
@ -225,8 +228,9 @@ class LocalsTest {
await $.pump(const Duration(seconds: 1)); await $.pump(const Duration(seconds: 1));
await $.pump(); await $.pump();
final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // final PatrolFinder bottomSheetFinder =
.waitUntilVisible(); await $(BottomArrowLinkedLocalsComponentWidget) //
.waitUntilVisible();
expect(bottomSheetFinder, findsOneWidget); expect(bottomSheetFinder, findsOneWidget);
@ -236,7 +240,9 @@ class LocalsTest {
expect(listViewFinder, findsOneWidget); expect(listViewFinder, findsOneWidget);
final PatrolFinder entriesFinder = await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible(); final PatrolFinder entriesFinder = await $(listViewFinder)
.$(CardItemTemplateComponentWidget)
.waitUntilVisible();
expect(entriesFinder, findsWidgets); expect(entriesFinder, findsWidgets);
}); });
@ -250,8 +256,9 @@ class LocalsTest {
await _loggedWithSomeoneLocalAccount($, false); await _loggedWithSomeoneLocalAccount($, false);
await $.pumpWidget(const App()); await $.pumpWidget(const App());
final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // final PatrolFinder bottomSheetFinder =
.waitUntilVisible(); await $(BottomArrowLinkedLocalsComponentWidget) //
.waitUntilVisible();
expect(bottomSheetFinder, findsOneWidget); expect(bottomSheetFinder, findsOneWidget);
await $.pump(const Duration(milliseconds: 500)); await $.pump(const Duration(milliseconds: 500));
@ -307,12 +314,19 @@ class LocalsTest {
var name = ff.randomString(7, 7, true, true, true); var name = ff.randomString(7, 7, true, true, true);
var email = '$name@example.com'; var email = '$name@example.com';
var password = '12345678'; var password = '12345678';
credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password}; credentials = {
'nameTextFormField': name,
'emailTextFormField': email,
'passwordTextFormField': password
};
await $.pumpWidget(const App()); await $.pumpWidget(const App());
await _navigateToSignUp($); await _navigateToSignUp($);
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
credentials = {'emailTextFormField': email, 'passwordTextFormField': password}; credentials = {
'emailTextFormField': email,
'passwordTextFormField': password
};
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
await $.pumpAndSettle(); await $.pumpAndSettle();
@ -335,12 +349,19 @@ class LocalsTest {
var name = ff.randomString(7, 7, true, true, true); var name = ff.randomString(7, 7, true, true, true);
var email = '$name@example.com'; var email = '$name@example.com';
var password = '12345678'; var password = '12345678';
credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password}; credentials = {
'nameTextFormField': name,
'emailTextFormField': email,
'passwordTextFormField': password
};
await $.pumpWidget(const App()); await $.pumpWidget(const App());
await _navigateToSignUp($); await _navigateToSignUp($);
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
credentials = {'emailTextFormField': email, 'passwordTextFormField': password}; credentials = {
'emailTextFormField': email,
'passwordTextFormField': password
};
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
await $.pumpAndSettle(); await $.pumpAndSettle();

View File

@ -7,7 +7,8 @@ class MenuTest {
// //
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Menu Test - As labels dos menuItems correspondem aos títulos das AppBars?'); $.tester.printToConsole(
'Menu Test - As labels dos menuItems correspondem aos títulos das AppBars?');
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount($);
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
@ -15,15 +16,18 @@ class MenuTest {
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
await $.waitUntilVisible($(LocalProfileComponentWidget)); await $.waitUntilVisible($(LocalProfileComponentWidget));
final PatrolFinder profileFinder = await $(#AsyncLocalProfileComponentWidget_InkWell).waitUntilVisible(); final PatrolFinder profileFinder =
await $(#AsyncLocalProfileComponentWidget_InkWell)
.waitUntilVisible();
expect(profileFinder, findsOneWidget); expect(profileFinder, findsOneWidget);
await $(profileFinder) // await $(profileFinder) //
.waitUntilVisible() .waitUntilVisible()
.tap(); .tap();
final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // final PatrolFinder bottomSheetFinder =
.waitUntilVisible(); await $(BottomArrowLinkedLocalsComponentWidget) //
.waitUntilVisible();
expect(bottomSheetFinder, findsOneWidget); expect(bottomSheetFinder, findsOneWidget);
final PatrolFinder listViewFinder = await $(bottomSheetFinder) // final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
@ -45,10 +49,14 @@ class MenuTest {
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
await $.waitUntilVisible($(LocalProfileComponentWidget)); await $.waitUntilVisible($(LocalProfileComponentWidget));
final List<String> routes = final List<String> routes = MenuEntry.entries
MenuEntry.entries.where((entry) => entry.key != 'FRE-HUB-LOGOUT').map((entry) => entry.route).toList(); .where((entry) => entry.key != 'FRE-HUB-LOGOUT')
final List<String> titles = .map((entry) => entry.route)
MenuEntry.entries.where((entry) => entry.key != 'FRE-HUB-LOGOUT').map((entry) => entry.name).toList(); .toList();
final List<String> titles = MenuEntry.entries
.where((entry) => entry.key != 'FRE-HUB-LOGOUT')
.map((entry) => entry.name)
.toList();
final LinkedHashMap<String, String> routesTitles = LinkedHashMap // final LinkedHashMap<String, String> routesTitles = LinkedHashMap //
.fromIterables(routes, titles); .fromIterables(routes, titles);
@ -119,8 +127,10 @@ class MenuTest {
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<MenuEntry> entries = MenuEntry.entries; final List<MenuEntry> entries = MenuEntry.entries;
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<String> entriesKey = final List<String> entriesKey = entries
entries.where((entry) => entry.types.contains(MenuEntryType.Home)).map((entry) => entry.key).toList(); .where((entry) => entry.types.contains(MenuEntryType.Home))
.map((entry) => entry.key)
.toList();
await $.pumpAndSettle(); await $.pumpAndSettle();
expect(entriesKey, containsAll(menuKeys)); expect(entriesKey, containsAll(menuKeys));
}, },
@ -156,8 +166,10 @@ class MenuTest {
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<MenuEntry> entries = MenuEntry.entries; final List<MenuEntry> entries = MenuEntry.entries;
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<String> entriesKey = final List<String> entriesKey = entries
entries.where((entry) => entry.types.contains(MenuEntryType.Home)).map((entry) => entry.key).toList(); .where((entry) => entry.types.contains(MenuEntryType.Home))
.map((entry) => entry.key)
.toList();
await $.pumpAndSettle(); await $.pumpAndSettle();
expect(entriesKey, containsAll(menuKeys)); expect(entriesKey, containsAll(menuKeys));
}, },
@ -201,8 +213,10 @@ class MenuTest {
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<MenuEntry> entries = MenuEntry.entries; final List<MenuEntry> entries = MenuEntry.entries;
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<String> entriesKey = final List<String> entriesKey = entries
entries.where((entry) => entry.types.contains(MenuEntryType.Drawer)).map((entry) => entry.key).toList(); .where((entry) => entry.types.contains(MenuEntryType.Drawer))
.map((entry) => entry.key)
.toList();
await $.pumpAndSettle(); await $.pumpAndSettle();
expect(entriesKey, containsAll(menuKeys)); expect(entriesKey, containsAll(menuKeys));
await Future.delayed(const Duration(milliseconds: 500)); await Future.delayed(const Duration(milliseconds: 500));
@ -246,8 +260,10 @@ class MenuTest {
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<MenuEntry> entries = MenuEntry.entries; final List<MenuEntry> entries = MenuEntry.entries;
await $.pumpAndSettle(); await $.pumpAndSettle();
final List<String> entriesKey = final List<String> entriesKey = entries
entries.where((entry) => entry.types.contains(MenuEntryType.Drawer)).map((entry) => entry.key).toList(); .where((entry) => entry.types.contains(MenuEntryType.Drawer))
.map((entry) => entry.key)
.toList();
await $.pumpAndSettle(); await $.pumpAndSettle();
expect(entriesKey, containsAll(menuKeys)); expect(entriesKey, containsAll(menuKeys));
await Future.delayed(const Duration(milliseconds: 500)); await Future.delayed(const Duration(milliseconds: 500));
@ -266,12 +282,17 @@ class MenuTest {
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
final PatrolFinder profile = $(const Key('AsyncLocalProfileComponentWidget_InkWell')); final PatrolFinder profile =
await $(profile).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); $(const Key('AsyncLocalProfileComponentWidget_InkWell'));
await $(profile)
.waitUntilVisible()
.tap(settlePolicy: SettlePolicy.noSettle);
await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget)); await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget));
final PatrolFinder local = $('FRE ACCESS DEMO'); final PatrolFinder local = $('FRE ACCESS DEMO');
await $(local).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); await $(local)
.waitUntilVisible()
.tap(settlePolicy: SettlePolicy.noSettle);
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
@ -300,7 +321,8 @@ class MenuTest {
timeout: Duration(seconds: 1), timeout: Duration(seconds: 1),
); );
final ButtonMenuItem entry = $.tester.widget<ButtonMenuItem>(gridEntries.at(i)); final ButtonMenuItem entry =
$.tester.widget<ButtonMenuItem>(gridEntries.at(i));
final Key? widgetKey = entry.key; final Key? widgetKey = entry.key;
expect(widgetKey, isNotNull); expect(widgetKey, isNotNull);
@ -310,14 +332,18 @@ class MenuTest {
if (widgetKey == ValueKey<String>('FRE-HUB-RESERVATIONS')) continue; if (widgetKey == ValueKey<String>('FRE-HUB-RESERVATIONS')) continue;
if (widgetKey == ValueKey<String>('FRE-HUB-SETTINGS')) continue; if (widgetKey == ValueKey<String>('FRE-HUB-SETTINGS')) continue;
await $(gridEntries.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( await $(gridEntries.at(i))
.waitUntilVisible(timeout: const Duration(seconds: 1))
.tap(
settleTimeout: const Duration(seconds: 1), settleTimeout: const Duration(seconds: 1),
settlePolicy: SettlePolicy.noSettle, settlePolicy: SettlePolicy.noSettle,
); );
await $.pumpAndSettle(duration: Duration(milliseconds: 500)); await $.pumpAndSettle(duration: Duration(milliseconds: 500));
await $(Icons.keyboard_arrow_left).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( await $(Icons.keyboard_arrow_left)
.waitUntilVisible(timeout: const Duration(seconds: 1))
.tap(
settleTimeout: const Duration(seconds: 1), settleTimeout: const Duration(seconds: 1),
settlePolicy: SettlePolicy.noSettle, settlePolicy: SettlePolicy.noSettle,
); );

View File

@ -2,9 +2,12 @@ part of 'app_test.dart';
class ModularizationTest { class ModularizationTest {
static Future containLicense() async { static Future containLicense() async {
patrolWidgetTest('Os modulos de licença está sendo processados? (MultiLocais)', (PatrolTester tester) async { patrolWidgetTest(
'Os modulos de licença está sendo processados? (MultiLocais)',
(PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Modularization Test - Os modulos de licença está sendo processados?'); $.tester.printToConsole(
'Modularization Test - Os modulos de licença está sendo processados?');
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount($);
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
@ -25,9 +28,12 @@ class ModularizationTest {
return; return;
}); });
patrolWidgetTest('Os modulos de licença está sendo processados? (MonoLocal)', (PatrolTester tester) async { patrolWidgetTest(
'Os modulos de licença está sendo processados? (MonoLocal)',
(PatrolTester tester) async {
$ = tester; $ = tester;
$.tester.printToConsole('Modularization Test - Os modulos de licença está sendo processados?'); $.tester.printToConsole(
'Modularization Test - Os modulos de licença está sendo processados?');
await _loggedWithSomeoneLocalAccount($); await _loggedWithSomeoneLocalAccount($);
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
@ -62,12 +68,17 @@ class ModularizationTest {
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
final PatrolFinder profile = $(const Key('AsyncLocalProfileComponentWidget_InkWell')); final PatrolFinder profile =
await $(profile).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); $(const Key('AsyncLocalProfileComponentWidget_InkWell'));
await $(profile)
.waitUntilVisible()
.tap(settlePolicy: SettlePolicy.noSettle);
await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget)); await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget));
final PatrolFinder local = $('FRE ACCESS DEMO'); final PatrolFinder local = $('FRE ACCESS DEMO');
await $(local).waitUntilVisible().tap(settlePolicy: SettlePolicy.trySettle); await $(local)
.waitUntilVisible()
.tap(settlePolicy: SettlePolicy.trySettle);
}, },
); );
} }

View File

@ -59,7 +59,8 @@ Future<void> main() async {
// Maybe somewhat counterintuitively, this callback runs *after* the calls // Maybe somewhat counterintuitively, this callback runs *after* the calls
// to group() below. // to group() below.
final topLevelGroup = Invoker.current!.liveTest.groups.first; final topLevelGroup = Invoker.current!.liveTest.groups.first;
final dartTestGroup = createDartTestGroup(topLevelGroup, final dartTestGroup = createDartTestGroup(
topLevelGroup,
tags: null, tags: null,
excludeTags: null, excludeTags: null,
); );

View File

@ -1,6 +1,7 @@
part of 'app_test.dart'; part of 'app_test.dart';
Future<void> _loggedWithMultiLocalsAccount(PatrolTester $, [bool forceLinkedLocal = true]) async { Future<void> _loggedWithMultiLocalsAccount(PatrolTester $,
[bool forceLinkedLocal = true]) async {
await _init($); await _init($);
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
@ -28,7 +29,8 @@ Future<void> _loggedWithMultiLocalsAccount(PatrolTester $, [bool forceLinkedLoca
} }
} }
Future<void> _loggedWithSomeoneLocalAccount(PatrolTester $, [bool forceLinkedLocal = true]) async { Future<void> _loggedWithSomeoneLocalAccount(PatrolTester $,
[bool forceLinkedLocal = true]) async {
await _init($); await _init($);
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
@ -99,7 +101,8 @@ Future<void> _navigateToSignUp(PatrolTester $) async {
} }
Future<void> _navigateBackUsingSystemGesture() async => Future<void> _navigateBackUsingSystemGesture() async =>
IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape); IntegrationTestWidgetsFlutterBinding.instance.keyboard
.isLogicalKeyPressed(LogicalKeyboardKey.escape);
Future<void> _initializeTracking() async { Future<void> _initializeTracking() async {
print('Requesting tracking authorization...'); print('Requesting tracking authorization...');

View File

@ -19,10 +19,12 @@ class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
const ForgotPasswordTemplateComponentWidget({super.key}); const ForgotPasswordTemplateComponentWidget({super.key});
@override @override
State<ForgotPasswordTemplateComponentWidget> createState() => _ForgotPasswordTemplateComponentWidgetState(); State<ForgotPasswordTemplateComponentWidget> createState() =>
_ForgotPasswordTemplateComponentWidgetState();
} }
class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTemplateComponentWidget> { class _ForgotPasswordTemplateComponentWidgetState
extends State<ForgotPasswordTemplateComponentWidget> {
late ForgotPasswordTemplateComponentModel _model; late ForgotPasswordTemplateComponentModel _model;
@override @override
@ -49,9 +51,11 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); double limitedSubHeaderFontSize =
LimitedFontSizeUtil.getSubHeaderFontSize(context);
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); double limitedHeaderFontSize =
LimitedFontSizeUtil.getHeaderFontSize(context);
return Align( return Align(
key: ValueKey('ForgotPasswordTemplateComponentWidget'), key: ValueKey('ForgotPasswordTemplateComponentWidget'),
@ -84,7 +88,8 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
tablet: false, tablet: false,
)) ))
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), padding: const EdgeInsetsDirectional.fromSTEB(
16.0, 0.0, 16.0, 8.0),
child: InkWell( child: InkWell(
key: const ValueKey<String>('BackButton'), key: const ValueKey<String>('BackButton'),
splashColor: Colors.transparent, splashColor: Colors.transparent,
@ -98,7 +103,8 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
const Padding( const Padding(
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0), padding: EdgeInsetsDirectional.fromSTEB(
0.0, 12.0, 0.0, 12.0),
child: Icon( child: Icon(
Icons.arrow_back_rounded, Icons.arrow_back_rounded,
color: Color(0xFF15161E), color: Color(0xFF15161E),
@ -106,16 +112,20 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
12.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
'', '',
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: const Color(0xFF15161E), color: const Color(0xFF15161E),
fontSize: limitedHeaderFontSize, fontSize: limitedHeaderFontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
), ),
), ),
), ),
@ -124,30 +134,36 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
FFLocalizations.of(context).getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */), FFLocalizations.of(context)
.getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */),
style: FlutterFlowTheme.of(context).headlineMedium.override( style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit', fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedHeaderFontSize, fontSize: limitedHeaderFontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), useGoogleFonts:
GoogleFonts.asMap().containsKey('Outfit'),
), ),
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), padding: const EdgeInsetsDirectional.fromSTEB(
16.0, 4.0, 16.0, 4.0),
child: Text( child: Text(
FFLocalizations.of(context).getText('wu2f7yzo' /* Não se preucupe nós vamos te a... */), FFLocalizations.of(context).getText(
'wu2f7yzo' /* Não se preucupe nós vamos te a... */),
style: FlutterFlowTheme.of(context).labelMedium.override( style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedSubHeaderFontSize, fontSize: limitedSubHeaderFontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
), ),
), ),
), ),
@ -155,7 +171,8 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
key: _model.formKey, key: _model.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
16.0, 12.0, 16.0, 0.0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: TextFormField( child: TextFormField(
@ -172,15 +189,18 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
obscureText: false, obscureText: false,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getText('mtz8l7ft' /* E-mail */), labelText: FFLocalizations.of(context)
labelStyle: FlutterFlowTheme.of(context).labelMedium.override( .getText('mtz8l7ft' /* E-mail */),
fontFamily: 'Plus Jakarta Sans', labelStyle:
color: FlutterFlowTheme.of(context).primary, FlutterFlowTheme.of(context).labelMedium.override(
fontSize: limitedInputFontSize, fontFamily: 'Plus Jakarta Sans',
letterSpacing: 0.0, color: FlutterFlowTheme.of(context).primary,
fontWeight: FontWeight.w500, fontSize: limitedInputFontSize,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), letterSpacing: 0.0,
), fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: const BorderSide( borderSide: const BorderSide(
color: Colors.black, color: Colors.black,
@ -209,7 +229,8 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), contentPadding: const EdgeInsetsDirectional.fromSTEB(
24.0, 24.0, 20.0, 24.0),
suffixIcon: Icon( suffixIcon: Icon(
Icons.email, Icons.email,
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
@ -222,12 +243,14 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
fontSize: limitedInputFontSize, fontSize: limitedInputFontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
), ),
maxLines: null, maxLines: null,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
cursorColor: FlutterFlowTheme.of(context).primary, cursorColor: FlutterFlowTheme.of(context).primary,
validator: _model.emailAddressTextControllerValidator.asValidator(context), validator: _model.emailAddressTextControllerValidator
.asValidator(context),
), ),
), ),
), ),
@ -235,13 +258,17 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
Align( Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
key: const ValueKey<String>('SendButtonWidget'), key: const ValueKey<String>('SendButtonWidget'),
onPressed: (_model.emailAddressTextController.text == '' || onPressed: (_model.emailAddressTextController.text ==
!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) '' ||
!ValidatorUtil.isValidEmail(
_model.emailAddressTextController.text))
? null ? null
: () async => await AuthenticationService.forgotPassword( : () async =>
await AuthenticationService.forgotPassword(
context, context,
_model.emailAddressTextController.text, _model.emailAddressTextController.text,
).then((v) => v == true ? context.pop() : null), ).then((v) => v == true ? context.pop() : null),
@ -251,23 +278,28 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
options: FFButtonOptions( options: FFButtonOptions(
width: 270.0, width: 270.0,
height: 50.0, height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), 0.0, 0.0, 0.0, 0.0),
iconPadding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
textStyle: FlutterFlowTheme.of(context).titleSmall.override( textStyle:
fontFamily: 'Plus Jakarta Sans', FlutterFlowTheme.of(context).titleSmall.override(
color: Colors.white, fontFamily: 'Plus Jakarta Sans',
fontSize: limitedInputFontSize, color: Colors.white,
letterSpacing: 0.0, fontSize: limitedInputFontSize,
fontWeight: FontWeight.w500, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), fontWeight: FontWeight.w500,
), useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide( borderSide: const BorderSide(
color: Colors.transparent, color: Colors.transparent,
width: 1.0, width: 1.0,
), ),
disabledColor: FlutterFlowTheme.of(context).customColor5, disabledColor:
FlutterFlowTheme.of(context).customColor5,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
), ),
showLoadingIndicator: true, showLoadingIndicator: true,

View File

@ -58,7 +58,8 @@ class _AboutSystemPageState extends State<AboutSystemPage> {
); );
} }
PreferredSizeWidget _buildAppBar(BuildContext context, FlutterFlowTheme theme) { PreferredSizeWidget _buildAppBar(
BuildContext context, FlutterFlowTheme theme) {
return AppBar( return AppBar(
backgroundColor: theme.primaryBackground, backgroundColor: theme.primaryBackground,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
@ -96,7 +97,8 @@ class _AboutSystemPageState extends State<AboutSystemPage> {
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
), ),
); );
} }
@ -167,7 +169,8 @@ class _AboutSystemPageState extends State<AboutSystemPage> {
color: theme.primaryText, color: theme.primaryText,
fontSize: 16.0, fontSize: 16.0,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), useGoogleFonts:
GoogleFonts.asMap().containsKey(theme.headlineMediumFamily),
), ),
); );
} }

View File

@ -66,7 +66,8 @@ class DeepLinkService {
), ),
), ),
isScrollControlled: true, isScrollControlled: true,
backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!).primaryBackground, backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!)
.primaryBackground,
showDragHandle: true, showDragHandle: true,
useSafeArea: true, useSafeArea: true,
enableDrag: true, enableDrag: true,

View File

@ -73,9 +73,10 @@ class DefaultFirebaseOptions {
projectId: 'accessmoblie-da839', projectId: 'accessmoblie-da839',
databaseURL: 'https://accessmoblie-da839.firebaseio.com', databaseURL: 'https://accessmoblie-da839.firebaseio.com',
storageBucket: 'accessmoblie-da839.firebasestorage.app', storageBucket: 'accessmoblie-da839.firebasestorage.app',
androidClientId: '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com', androidClientId:
iosClientId: '187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com', '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com',
iosClientId:
'187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com',
iosBundleId: 'br.com.freaccess.hub', iosBundleId: 'br.com.freaccess.hub',
); );
}
}

View File

@ -86,11 +86,20 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
builder: (context, _) { builder: (context, _) {
return FutureBuilder<Widget>( return FutureBuilder<Widget>(
future: () async { future: () async {
final bool isLogged = await StorageHelper().get(SecureStorageKey.isLogged.value) == 'true'; final bool isLogged =
final bool haveLocal = await StorageHelper().get(SecureStorageKey.haveLocal.value) == 'true'; await StorageHelper().get(SecureStorageKey.isLogged.value) ==
'true';
final bool haveLocal =
await StorageHelper().get(SecureStorageKey.haveLocal.value) ==
'true';
final bool haveUserUUID = final bool haveUserUUID =
(await StorageHelper().get(ProfileStorageKey.userUUID.key))?.isNotEmpty ?? false; (await StorageHelper().get(ProfileStorageKey.userUUID.key))
final bool haveDevUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key))?.isNotEmpty ?? false; ?.isNotEmpty ??
false;
final bool haveDevUUID =
(await StorageHelper().get(ProfileStorageKey.devUUID.key))
?.isNotEmpty ??
false;
if (isLogged && haveDevUUID && haveUserUUID) { if (isLogged && haveDevUUID && haveUserUUID) {
return haveLocal return haveLocal
@ -100,17 +109,20 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
create: (context) => MenuBloc( create: (context) => MenuBloc(
style: MenuView.list_grid, style: MenuView.list_grid,
item: EnumMenuItem.button, item: EnumMenuItem.button,
entries: MenuEntry.getEntriesByType(MenuEntryType.Home), entries: MenuEntry.getEntriesByType(
MenuEntryType.Home),
)..add(MenuEvent()), )..add(MenuEvent()),
), ),
BlocProvider<HomeBloc>( BlocProvider<HomeBloc>(
create: (context) => HomeBloc()..add(HomeEvent()), create: (context) => HomeBloc()..add(HomeEvent()),
), ),
BlocProvider( BlocProvider(
create: (context) => LocalProfileBloc()..add(LocalProfileEvent()), create: (context) =>
LocalProfileBloc()..add(LocalProfileEvent()),
), ),
], ],
child: HomePageWidget(key: UniqueKey(), LocalsRepositoryImpl().update), child: HomePageWidget(
key: UniqueKey(), LocalsRepositoryImpl().update),
) )
: const ReceptionPageWidget(); : const ReceptionPageWidget();
} else { } else {
@ -134,8 +146,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
name: 'forgotPassword', name: 'forgotPassword',
path: '/forgotPassword', path: '/forgotPassword',
builder: (context, params) { builder: (context, params) {
late final String email = params.getParam('email', ParamType.String); late final String email =
late final String token = params.getParam('token', ParamType.String); params.getParam('email', ParamType.String);
late final String token =
params.getParam('token', ParamType.String);
return ForgotPasswordScreen( return ForgotPasswordScreen(
key: ValueKey('ForgotPasswordScreen'), key: ValueKey('ForgotPasswordScreen'),
@ -152,7 +166,8 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
name: 'homePage', name: 'homePage',
path: '/homePage', path: '/homePage',
builder: (context, params) { builder: (context, params) {
final Future<bool> Function(BuildContext context)? update = params.getParam('update', ParamType.Function); final Future<bool> Function(BuildContext context)? update =
params.getParam('update', ParamType.Function);
return MultiBlocProvider( return MultiBlocProvider(
providers: [ providers: [
BlocProvider( BlocProvider(
@ -166,7 +181,8 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
create: (context) => HomeBloc()..add(HomeEvent()), create: (context) => HomeBloc()..add(HomeEvent()),
), ),
BlocProvider( BlocProvider(
create: (context) => LocalProfileBloc()..add(LocalProfileEvent()), create: (context) =>
LocalProfileBloc()..add(LocalProfileEvent()),
), ),
], ],
child: HomePageWidget(key: UniqueKey(), update), child: HomePageWidget(key: UniqueKey(), update),
@ -175,12 +191,16 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
FFRoute( FFRoute(
name: 'petsOnThePropertyPage', name: 'petsOnThePropertyPage',
path: '/petsOnThePropertyPage', path: '/petsOnThePropertyPage',
builder: (context, params) => Scaffold(body: const PetsHistoryScreen(isApp: true))), builder: (context, params) =>
Scaffold(body: const PetsHistoryScreen(isApp: true))),
FFRoute( FFRoute(
name: 'vehiclesOnThePropertyPage', name: 'vehiclesOnThePropertyPage',
path: '/vehiclesOnThePropertyPage', path: '/vehiclesOnThePropertyPage',
builder: (context, params) => const VehicleOnTheProperty()), builder: (context, params) => const VehicleOnTheProperty()),
FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()), FFRoute(
name: 'receptionPage',
path: '/receptionPage',
builder: (context, params) => const ReceptionPageWidget()),
FFRoute( FFRoute(
name: 'messageHistoryPage', name: 'messageHistoryPage',
path: '/messageHistoryPage', path: '/messageHistoryPage',
@ -192,19 +212,28 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
FFRoute( FFRoute(
name: 'scheduleCompleteVisitPage', name: 'scheduleCompleteVisitPage',
path: '/scheduleCompleteVisitPage', path: '/scheduleCompleteVisitPage',
builder: (context, params) => const ScheduleCompleteVisitPageWidget()), builder: (context, params) =>
const ScheduleCompleteVisitPageWidget()),
FFRoute( FFRoute(
name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()), name: 'deliverySchedule',
path: '/deliverySchedule',
builder: (context, params) => const DeliverySchedule()),
FFRoute( FFRoute(
name: 'provisionalSchedule', name: 'provisionalSchedule',
path: '/provisionalSchedule', path: '/provisionalSchedule',
builder: (context, params) => const ProvisionalSchedule()), builder: (context, params) => const ProvisionalSchedule()),
FFRoute(name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => FastPassPageWidget()), FFRoute(
name: 'fastPassPage',
path: '/fastPassPage',
builder: (context, params) => FastPassPageWidget()),
FFRoute( FFRoute(
name: 'preferencesSettings', name: 'preferencesSettings',
path: '/preferencesSettings', path: '/preferencesSettings',
builder: (context, params) => PreferencesPageWidget()), builder: (context, params) => PreferencesPageWidget()),
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()), FFRoute(
name: 'aboutProperty',
path: '/aboutProperty',
builder: (context, params) => AboutPropertyPage()),
FFRoute( FFRoute(
name: 'residentsOnThePropertyPage', name: 'residentsOnThePropertyPage',
path: '/residentsOnThePropertyPage', path: '/residentsOnThePropertyPage',
@ -220,8 +249,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
FFRoute( FFRoute(
name: 'acessHistoryPage', name: 'acessHistoryPage',
path: '/acessHistoryPage', path: '/acessHistoryPage',
builder: (context, params) => builder: (context, params) => AccessHistoryScreen(opt: const {
AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})), 'personType': '.*',
'accessType': '.*',
'search': '.*'
})),
FFRoute( FFRoute(
name: 'provisionalHistoryPage', name: 'provisionalHistoryPage',
path: '/provisionalHistoryPage', path: '/provisionalHistoryPage',
@ -230,13 +262,34 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
name: 'liberationHistory', name: 'liberationHistory',
path: '/liberationHistory', path: '/liberationHistory',
builder: (context, params) => const LiberationHistoryWidget()), builder: (context, params) => const LiberationHistoryWidget()),
FFRoute(name: 'signInPage', path: '/signInPage', builder: (context, params) => const SignInPageWidget()), FFRoute(
FFRoute(name: 'signUpPage', path: '/signUpPage', builder: (context, params) => const SignUpPageWidget()), name: 'signInPage',
FFRoute(name: 'welcomePage', path: '/welcomePage', builder: (context, params) => const WelcomePage()), path: '/signInPage',
FFRoute(name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget()), builder: (context, params) => const SignInPageWidget()),
FFRoute(name: 'preferencesPage', path: '/preferencesPage', builder: (context, params) => PreferencesPageWidget()), FFRoute(
FFRoute(name: 'packageOrder', path: '/packageOrder', builder: (context, params) => const PackageOrderPage()), name: 'signUpPage',
FFRoute(name: 'reservation', path: '/reservation', builder: (context, params) => ReservationPageWidget()), path: '/signUpPage',
builder: (context, params) => const SignUpPageWidget()),
FFRoute(
name: 'welcomePage',
path: '/welcomePage',
builder: (context, params) => const WelcomePage()),
FFRoute(
name: 'qrCodePage',
path: '/qrCodePage',
builder: (context, params) => const QrCodePageWidget()),
FFRoute(
name: 'preferencesPage',
path: '/preferencesPage',
builder: (context, params) => PreferencesPageWidget()),
FFRoute(
name: 'packageOrder',
path: '/packageOrder',
builder: (context, params) => const PackageOrderPage()),
FFRoute(
name: 'reservation',
path: '/reservation',
builder: (context, params) => ReservationPageWidget()),
FFRoute( FFRoute(
name: 'petsPage', name: 'petsPage',
path: '/petsPage', path: '/petsPage',
@ -252,7 +305,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
extension NavParamExtensions on Map<String, String?> { extension NavParamExtensions on Map<String, String?> {
Map<String, String> get withoutNulls => Map.fromEntries( Map<String, String> get withoutNulls => Map.fromEntries(
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value!)), entries
.where((e) => e.value != null)
.map((e) => MapEntry(e.key, e.value!)),
); );
} }
@ -266,7 +321,8 @@ extension NavigationExtensions on BuildContext {
} }
extension _GoRouterStateExtensions on GoRouterState { extension _GoRouterStateExtensions on GoRouterState {
Map<String, dynamic> get extraMap => extra != null ? extra as Map<String, dynamic> : {}; Map<String, dynamic> get extraMap =>
extra != null ? extra as Map<String, dynamic> : {};
Map<String, dynamic> get allParams => <String, dynamic>{} Map<String, dynamic> get allParams => <String, dynamic>{}
..addAll(pathParameters) ..addAll(pathParameters)
..addAll(uri.queryParameters) ..addAll(uri.queryParameters)
@ -279,8 +335,9 @@ extension _GoRouterStateExtensions on GoRouterState {
extension GoRouterLocationExtension on GoRouter { extension GoRouterLocationExtension on GoRouter {
String getCurrentLocation() { String getCurrentLocation() {
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last; final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
final RouteMatchList matchList = final RouteMatchList matchList = lastMatch is ImperativeRouteMatch
lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration; ? lastMatch.matches
: routerDelegate.currentConfiguration;
return matchList.uri.toString(); return matchList.uri.toString();
} }
} }
@ -293,13 +350,17 @@ class FFParameters {
Map<String, dynamic> futureParamValues = {}; Map<String, dynamic> futureParamValues = {};
bool get isEmpty => bool get isEmpty =>
state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey)); state.allParams.isEmpty ||
bool isAsyncParam(MapEntry<String, dynamic> param) => asyncParams.containsKey(param.key) && param.value is String; (state.allParams.length == 1 &&
state.extraMap.containsKey(kTransitionInfoKey));
bool isAsyncParam(MapEntry<String, dynamic> param) =>
asyncParams.containsKey(param.key) && param.value is String;
bool get hasFutures => state.allParams.entries.any(isAsyncParam); bool get hasFutures => state.allParams.entries.any(isAsyncParam);
Future<bool> completeFutures() => Future.wait( Future<bool> completeFutures() => Future.wait(
state.allParams.entries.where(isAsyncParam).map( state.allParams.entries.where(isAsyncParam).map(
(param) async { (param) async {
final doc = await asyncParams[param.key]!(param.value).onError((_, __) => null); final doc = await asyncParams[param.key]!(param.value)
.onError((_, __) => null);
if (doc != null) { if (doc != null) {
futureParamValues[param.key] = doc; futureParamValues[param.key] = doc;
return true; return true;
@ -309,12 +370,15 @@ class FFParameters {
), ),
).onError((_, __) => [false]).then((v) => v.every((e) => e)); ).onError((_, __) => [false]).then((v) => v.every((e) => e));
dynamic getParam<T>(String paramName, ParamType type, {bool isList = false, StructBuilder<T>? structBuilder}) { dynamic getParam<T>(String paramName, ParamType type,
if (futureParamValues.containsKey(paramName)) return futureParamValues[paramName]; {bool isList = false, StructBuilder<T>? structBuilder}) {
if (futureParamValues.containsKey(paramName))
return futureParamValues[paramName];
if (!state.allParams.containsKey(paramName)) return null; if (!state.allParams.containsKey(paramName)) return null;
final param = state.allParams[paramName]; final param = state.allParams[paramName];
if (param is! String) return param; if (param is! String) return param;
return deserializeParam<T>(param, type, isList, structBuilder: structBuilder); return deserializeParam<T>(param, type, isList,
structBuilder: structBuilder);
} }
} }
@ -354,13 +418,16 @@ class FFRoute {
key: state.pageKey, key: state.pageKey,
child: child, child: child,
transitionDuration: transitionInfo.duration, transitionDuration: transitionInfo.duration,
transitionsBuilder: (context, animation, secondaryAnimation, child) => PageTransition( transitionsBuilder:
(context, animation, secondaryAnimation, child) =>
PageTransition(
type: transitionInfo.transitionType, type: transitionInfo.transitionType,
duration: transitionInfo.duration, duration: transitionInfo.duration,
reverseDuration: transitionInfo.duration, reverseDuration: transitionInfo.duration,
alignment: transitionInfo.alignment, alignment: transitionInfo.alignment,
child: child, child: child,
).buildTransitions(context, animation, secondaryAnimation, child), ).buildTransitions(
context, animation, secondaryAnimation, child),
) )
: MaterialPage(key: state.pageKey, child: child); : MaterialPage(key: state.pageKey, child: child);
}, },
@ -381,7 +448,8 @@ class TransitionInfo {
final Duration duration; final Duration duration;
final Alignment? alignment; final Alignment? alignment;
static TransitionInfo appDefault() => const TransitionInfo(hasTransition: false); static TransitionInfo appDefault() =>
const TransitionInfo(hasTransition: false);
} }
class RootPageContext { class RootPageContext {
@ -393,7 +461,9 @@ class RootPageContext {
final rootPageContext = context.read<RootPageContext?>(); final rootPageContext = context.read<RootPageContext?>();
final isRootPage = rootPageContext?.isRootPage ?? false; final isRootPage = rootPageContext?.isRootPage ?? false;
final location = GoRouterState.of(context).uri.toString(); final location = GoRouterState.of(context).uri.toString();
return isRootPage && location != '/' && location != rootPageContext?.errorRoute; return isRootPage &&
location != '/' &&
location != rootPageContext?.errorRoute;
} }
static Widget wrap(Widget child, {String? errorRoute}) => static Widget wrap(Widget child, {String? errorRoute}) =>

View File

@ -58,7 +58,8 @@ Future<void> _initializeSystemSettings() async {
if (kDebugMode) { if (kDebugMode) {
//kDebugMode //kDebugMode
print('Debug mode'); print('Debug mode');
bool unsentReports = await FirebaseCrashlytics.instance.checkForUnsentReports(); bool unsentReports =
await FirebaseCrashlytics.instance.checkForUnsentReports();
if (unsentReports) { if (unsentReports) {
// Existem relatórios não enviados // Existem relatórios não enviados
await crashlyticsInstance.sendUnsentReports(); await crashlyticsInstance.sendUnsentReports();

View File

@ -15,7 +15,8 @@ import '../../flutter_flow/internationalization.dart';
import 'forgot_password_model.dart'; import 'forgot_password_model.dart';
class ForgotPasswordScreen extends StatefulWidget { class ForgotPasswordScreen extends StatefulWidget {
const ForgotPasswordScreen({super.key, required this.email, required this.token}); const ForgotPasswordScreen(
{super.key, required this.email, required this.token});
final String email; final String email;
final String token; final String token;
@ -23,7 +24,8 @@ class ForgotPasswordScreen extends StatefulWidget {
State<ForgotPasswordScreen> createState() => _ForgotPasswordScreenState(); State<ForgotPasswordScreen> createState() => _ForgotPasswordScreenState();
} }
class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with TickerProviderStateMixin { class _ForgotPasswordScreenState extends State<ForgotPasswordScreen>
with TickerProviderStateMixin {
late ForgotPasswordScreenModel _model; late ForgotPasswordScreenModel _model;
final animationsMap = <String, AnimationInfo>{}; final animationsMap = <String, AnimationInfo>{};
@ -148,7 +150,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0, bottom: 0.0), padding: const EdgeInsets.only(
left: 15.0, right: 15.0, top: 10.0, bottom: 0.0),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
constraints: const BoxConstraints(maxWidth: 570.0), constraints: const BoxConstraints(maxWidth: 570.0),
@ -157,7 +160,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0, bottom: 0.0), padding: const EdgeInsets.only(
left: 20.0, right: 20.0, top: 10.0, bottom: 0.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -171,21 +175,25 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
fontSize: 24.0, fontSize: 24.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), useGoogleFonts:
GoogleFonts.asMap().containsKey('Nunito'),
), ),
)), )),
Align( Align(
alignment: const AlignmentDirectional(-1.0, 0.0), alignment: const AlignmentDirectional(-1.0, 0.0),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 24.0, 0.0, 30.0), padding: const EdgeInsetsDirectional.fromSTEB(
20.0, 24.0, 0.0, 30.0),
child: Text( child: Text(
message, message,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
useGoogleFonts: useGoogleFonts: GoogleFonts.asMap().containsKey(
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context)
.bodyMediumFamily),
), ),
), ),
), ),
@ -201,32 +209,42 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
controller: _model.passwordRegisterFormTextController, controller: _model.passwordRegisterFormTextController,
focusNode: _model.passwordRegisterFormFocusNode, focusNode: _model.passwordRegisterFormFocusNode,
visibility: _model.passwordRegisterFormVisibility, visibility: _model.passwordRegisterFormVisibility,
onVisibilityToggle: () => setState( onVisibilityToggle: () => setState(() =>
() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility), _model.passwordRegisterFormVisibility =
label: !_model.passwordRegisterFormVisibility),
FFLocalizations.of(context).getVariableText(ptText: 'Nova Senha', enText: 'New Password'), label: FFLocalizations.of(context).getVariableText(
hint: FFLocalizations.of(context) ptText: 'Nova Senha', enText: 'New Password'),
.getVariableText(ptText: 'Insira sua senha', enText: 'Enter your password'), hint: FFLocalizations.of(context).getVariableText(
asValidator: _model.passwordRegisterFormTextControllerValidator.asValidator(context), ptText: 'Insira sua senha',
enText: 'Enter your password'),
asValidator: _model
.passwordRegisterFormTextControllerValidator
.asValidator(context),
), ),
_buildPasswordField( _buildPasswordField(
context, context,
controller: _model.passwordConfirmFormTextController, controller: _model.passwordConfirmFormTextController,
focusNode: _model.passwordConfirmFormFocusNode, focusNode: _model.passwordConfirmFormFocusNode,
visibility: _model.passwordConfirmFormVisibility, visibility: _model.passwordConfirmFormVisibility,
onVisibilityToggle: () => setState( onVisibilityToggle: () => setState(() =>
() => _model.passwordConfirmFormVisibility = !_model.passwordConfirmFormVisibility), _model.passwordConfirmFormVisibility =
label: FFLocalizations.of(context) !_model.passwordConfirmFormVisibility),
.getVariableText(ptText: 'Confirme a Senha', enText: 'Confirm Password'), label: FFLocalizations.of(context).getVariableText(
hint: FFLocalizations.of(context) ptText: 'Confirme a Senha',
.getVariableText(ptText: 'Confirme sua senha', enText: 'Confirm your password'), enText: 'Confirm Password'),
asValidator: _model.passwordConfirmFormTextControllerValidator.asValidator(context), hint: FFLocalizations.of(context).getVariableText(
ptText: 'Confirme sua senha',
enText: 'Confirm your password'),
asValidator: _model
.passwordConfirmFormTextControllerValidator
.asValidator(context),
), ),
], ],
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget( child: FFButtonWidget(
key: const ValueKey<String>('SubmitButtonWidget'), key: const ValueKey<String>('SubmitButtonWidget'),
onPressed: _model.isFormInvalid() onPressed: _model.isFormInvalid()
@ -248,16 +266,22 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
width: double.infinity, width: double.infinity,
height: 44.0, height: 44.0,
color: FlutterFlowTheme.of(context).accent1, color: FlutterFlowTheme.of(context).accent1,
textStyle: FlutterFlowTheme.of(context).titleSmall.override( textStyle: FlutterFlowTheme.of(context)
fontFamily: 'Plus Jakarta Sans', .titleSmall
color: FlutterFlowTheme.of(context).secondaryText, .override(
fontSize: 16.0, fontFamily: 'Plus Jakarta Sans',
fontWeight: FontWeight.w500, color:
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')), FlutterFlowTheme.of(context).secondaryText,
fontSize: 16.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans')),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide(color: Colors.transparent, width: 1.0), borderSide: const BorderSide(
color: Colors.transparent, width: 1.0),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
disabledColor: FlutterFlowTheme.of(context).customColor5, disabledColor:
FlutterFlowTheme.of(context).customColor5,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
), ),
showLoadingIndicator: true, showLoadingIndicator: true,
@ -305,22 +329,28 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: FlutterFlowTheme.of(context).customColor1, width: 0.25), borderSide: BorderSide(
color: FlutterFlowTheme.of(context).customColor1,
width: 0.25),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), borderSide:
const BorderSide(color: Color(0xFF1AAB5F), width: 0.25),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), borderSide:
const BorderSide(color: Color(0xFFFF5963), width: 0.25),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), borderSide:
const BorderSide(color: Color(0xFFFF5963), width: 0.25),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
filled: true, filled: true,
@ -330,7 +360,9 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
onTap: onVisibilityToggle, onTap: onVisibilityToggle,
focusNode: FocusNode(skipTraversal: true), focusNode: FocusNode(skipTraversal: true),
child: Icon( child: Icon(
visibility ? Icons.visibility_outlined : Icons.visibility_off_outlined, visibility
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
color: FlutterFlowTheme.of(context).accent1, color: FlutterFlowTheme.of(context).accent1,
size: 24.0, size: 24.0,
), ),
@ -341,7 +373,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
), ),
validator: asValidator, validator: asValidator,
), ),

View File

@ -0,0 +1 @@