This commit is contained in:
jantunemesssias 2025-02-03 09:02:23 -03:00
parent a07edd0c21
commit 73ea7d5641
38 changed files with 1254 additions and 589 deletions

View File

@ -6,7 +6,8 @@ class AuthenticationTest {
'Sign-In with fuzzed emails', 'Sign-In with fuzzed emails',
(PatrolIntegrationTester tester) async { (PatrolIntegrationTester 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',
(PatrolIntegrationTester tester) async { (PatrolIntegrationTester 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',
(PatrolIntegrationTester tester) async { (PatrolIntegrationTester 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',
(PatrolIntegrationTester tester) async { (PatrolIntegrationTester 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',
(PatrolIntegrationTester tester) async { (PatrolIntegrationTester 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));
}, },
@ -203,7 +212,8 @@ class AuthenticationTest {
Future.delayed(Duration(seconds: 3)); Future.delayed(Duration(seconds: 3));
await $.pump(Duration(seconds: 3)); await $.pump(Duration(seconds: 3));
await $.pumpAndSettle(); await $.pumpAndSettle();
final PatrolFinder forgotPassword = await $(#ForgotPasswordScreen).waitUntilVisible(); final PatrolFinder forgotPassword =
await $(#ForgotPasswordScreen).waitUntilVisible();
expect(forgotPassword, findsOneWidget); expect(forgotPassword, findsOneWidget);
}); });
} }
@ -230,7 +240,8 @@ Future<void> _enterCredentials(
} }
} }
Future<void> _submit(String key, PatrolIntegrationTester $, PatrolFinder throwsException) async { Future<void> _submit(
String key, PatrolIntegrationTester $, PatrolFinder throwsException) async {
await $(ValueKey(key)) // await $(ValueKey(key)) //
.waitUntilVisible() .waitUntilVisible()
.tap(); .tap();
@ -248,5 +259,6 @@ Future<void> _submit(String key, PatrolIntegrationTester $, PatrolFinder throwsE
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

@ -0,0 +1 @@

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(PatrolIntegrationTester $, [bool forceLinkedLocal = true]) async { Future<void> _loggedWithMultiLocalsAccount(PatrolIntegrationTester $,
[bool forceLinkedLocal = true]) async {
await _init($); await _init($);
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
@ -20,13 +21,15 @@ Future<void> _loggedWithMultiLocalsAccount(PatrolIntegrationTester $, [bool forc
if (forceLinkedLocal == true) { if (forceLinkedLocal == true) {
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '7'); await StorageHelper().set(ProfileStorageKey.clientUUID.key, '7');
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '7'); await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '7');
await StorageHelper().set(ProfileStorageKey.clientName.key, 'FRE ACCESS DEMO'); await StorageHelper()
.set(ProfileStorageKey.clientName.key, 'FRE ACCESS DEMO');
await PhpGroup.resopndeVinculo.call(tarefa: 'A'); await PhpGroup.resopndeVinculo.call(tarefa: 'A');
await LicenseRepositoryImpl().resetLicense(); await LicenseRepositoryImpl().resetLicense();
} }
} }
Future<void> _loggedWithSomeoneLocalAccount(PatrolIntegrationTester $, [bool forceLinkedLocal = true]) async { Future<void> _loggedWithSomeoneLocalAccount(PatrolIntegrationTester $,
[bool forceLinkedLocal = true]) async {
await _init($); await _init($);
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
@ -46,7 +49,8 @@ Future<void> _loggedWithSomeoneLocalAccount(PatrolIntegrationTester $, [bool for
if (forceLinkedLocal == true) { if (forceLinkedLocal == true) {
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '7'); await StorageHelper().set(ProfileStorageKey.clientUUID.key, '7');
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '7'); await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '7');
await StorageHelper().set(ProfileStorageKey.clientName.key, 'FRE ACCESS DEMO'); await StorageHelper()
.set(ProfileStorageKey.clientName.key, 'FRE ACCESS DEMO');
await PhpGroup.resopndeVinculo.call(tarefa: 'A'); await PhpGroup.resopndeVinculo.call(tarefa: 'A');
await LicenseRepositoryImpl().resetLicense(); await LicenseRepositoryImpl().resetLicense();
} }
@ -95,7 +99,8 @@ Future<void> _navigateToSignUp(PatrolIntegrationTester $) 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

@ -41,8 +41,9 @@ class VehicleTest {
expect(listViewFinder, findsOneWidget); expect(listViewFinder, findsOneWidget);
final PatrolFinder entriesFinder = final PatrolFinder entriesFinder = await $(listViewFinder)
await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible(); .$(CardItemTemplateComponentWidget)
.waitUntilVisible();
expect(entriesFinder, findsWidgets); expect(entriesFinder, findsWidgets);
final int entriesCount = entriesFinder.evaluate().length; final int entriesCount = entriesFinder.evaluate().length;
@ -51,13 +52,16 @@ class VehicleTest {
for (int i = 0; i < entriesCount; i++) { for (int i = 0; i < entriesCount; i++) {
await $(entriesFinder.at(i)).scrollTo(); await $(entriesFinder.at(i)).scrollTo();
await $(entriesFinder.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( await $(entriesFinder.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));
final PatrolFinder detailsFinder = await $(DetailsComponentWidget).waitUntilVisible(); final PatrolFinder detailsFinder =
await $(DetailsComponentWidget).waitUntilVisible();
expect(detailsFinder, findsOneWidget); expect(detailsFinder, findsOneWidget);
await $.native.pressBack().then((_) => $.pumpAndSettle()); await $.native.pressBack().then((_) => $.pumpAndSettle());
@ -124,8 +128,9 @@ class VehicleTest {
expect(listViewFinder, findsOneWidget); expect(listViewFinder, findsOneWidget);
final PatrolFinder entriesFinder = final PatrolFinder entriesFinder = await $(listViewFinder)
await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible(); .$(CardItemTemplateComponentWidget)
.waitUntilVisible();
expect(entriesFinder, findsWidgets); expect(entriesFinder, findsWidgets);
await $.pumpAndSettle(); await $.pumpAndSettle();
@ -170,8 +175,9 @@ class VehicleTest {
expect(listViewFinder, findsOneWidget); expect(listViewFinder, findsOneWidget);
final PatrolFinder entriesFinder = final PatrolFinder entriesFinder = await $(listViewFinder)
await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible(); .$(CardItemTemplateComponentWidget)
.waitUntilVisible();
expect(entriesFinder, findsWidgets); expect(entriesFinder, findsWidgets);
final int entriesCount = entriesFinder.evaluate().length; final int entriesCount = entriesFinder.evaluate().length;
@ -180,13 +186,16 @@ class VehicleTest {
for (int i = 0; i < entriesCount; i++) { for (int i = 0; i < entriesCount; i++) {
await $(entriesFinder.at(i)).scrollTo(); await $(entriesFinder.at(i)).scrollTo();
await $(entriesFinder.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( await $(entriesFinder.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));
final PatrolFinder detailsFinder = await $(DetailsComponentWidget).waitUntilVisible(); final PatrolFinder detailsFinder =
await $(DetailsComponentWidget).waitUntilVisible();
expect(detailsFinder, findsOneWidget); expect(detailsFinder, findsOneWidget);
await $.native.pressBack().then((_) => $.pumpAndSettle()); await $.native.pressBack().then((_) => $.pumpAndSettle());

View File

@ -150,7 +150,6 @@ class _CustomInputUtilState extends State<CustomInputUtil> {
maxLines: null, maxLines: null,
maxLength: widget.haveMaxLength ? widget.maxLength : null, maxLength: widget.haveMaxLength ? widget.maxLength : null,
keyboardType: widget.keyboardType, keyboardType: widget.keyboardType,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(widget.maxLength), LengthLimitingTextInputFormatter(widget.maxLength),
], ],

View File

@ -41,7 +41,8 @@ class TabViewUtil extends StatelessWidget {
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
fontSize: LimitedFontSizeUtil.getBodyFontSize(context), fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily), useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).titleMediumFamily),
), ),
unselectedLabelStyle: const TextStyle(), unselectedLabelStyle: const TextStyle(),
indicatorColor: FlutterFlowTheme.of(context).primary, indicatorColor: FlutterFlowTheme.of(context).primary,

View File

@ -19,10 +19,12 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
ApiCallResponse? response; ApiCallResponse? response;
@override @override
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState(); State<BottomArrowLinkedLocalsComponentWidget> createState() =>
_BottomArrowLinkedLocalsComponentWidgetState();
} }
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> { class _BottomArrowLinkedLocalsComponentWidgetState
extends State<BottomArrowLinkedLocalsComponentWidget> {
late BottomArrowLinkedLocalsComponentModel _model; late BottomArrowLinkedLocalsComponentModel _model;
bool _loading = false; bool _loading = false;
@ -40,7 +42,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel()); _model =
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
_localsFuture = _fetchLocals(); _localsFuture = _fetchLocals();
} }
@ -106,10 +109,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
if (isEnabled) { if (isEnabled) {
final local = locals[0]; final local = locals[0];
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']); .set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']); .set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
await StorageHelper()
.set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
await StorageHelper()
.set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
context.pop(); context.pop();
return widget.response; return widget.response;
@ -133,7 +140,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
return null; return null;
} }
static Future<void> _handleError(BuildContext context, String errorMsg) async { static Future<void> _handleError(
BuildContext context, String errorMsg) async {
await DialogUtil.error(context, errorMsg); await DialogUtil.error(context, errorMsg);
} }
@ -145,8 +153,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
if (response.jsonBody['error'] == false) { if (response.jsonBody['error'] == false) {
return { return {
'error': false, 'error': false,
'error_msg': FFLocalizations.of(context) 'error_msg': FFLocalizations.of(context).getVariableText(
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully") ptText: "Vínculo Ativado com Sucesso",
enText: "Link Activated Successfully")
}; };
} else { } else {
await StorageHelper().set(ProfileStorageKey.clientUUID.key, ''); await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
@ -154,7 +163,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
} }
} catch (e, s) { } catch (e, s) {
await DialogUtil.errorDefault(context); await DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s); LogUtil.requestAPIFailed(
'responderVinculo.php', '', 'Responder Vínculo', e, s);
return { return {
'error': true, 'error': true,
'error_msg': FFLocalizations.of(context).getVariableText( 'error_msg': FFLocalizations.of(context).getVariableText(
@ -179,14 +189,17 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
Map<String, Color> _statusHashMap(dynamic local) { Map<String, Color> _statusHashMap(dynamic local) {
return Map<String, Color>.from({ return Map<String, Color>.from({
if (local['CLU_STATUS'] == 'A') if (local['CLU_STATUS'] == 'A')
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FFLocalizations.of(context).getVariableText(
FlutterFlowTheme.of(context).success ptText: 'Ativo',
enText: 'Active'): FlutterFlowTheme.of(context).success
else if (local['CLU_STATUS'] == 'B') else if (local['CLU_STATUS'] == 'B')
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FFLocalizations.of(context).getVariableText(
FlutterFlowTheme.of(context).error ptText: 'Bloqueado',
enText: 'Blocked'): FlutterFlowTheme.of(context).error
else else
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FFLocalizations.of(context).getVariableText(
FlutterFlowTheme.of(context).warning ptText: 'Pendente',
enText: 'Pending'): FlutterFlowTheme.of(context).warning
}); });
} }
@ -200,16 +213,21 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
statusHashMap: [_statusHashMap(local)], statusHashMap: [_statusHashMap(local)],
onTapCardItemAction: () async { onTapCardItemAction: () async {
if (local['CLU_STATUS'] == 'A') { if (local['CLU_STATUS'] == 'A') {
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']); .set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']); .set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
await StorageHelper()
.set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
await StorageHelper()
.set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
context.pop(true); context.pop(true);
return true; return true;
} else if (local['CLU_STATUS'] == 'B') { } else if (local['CLU_STATUS'] == 'B') {
String message = FFLocalizations.of(context).getVariableText( String message = FFLocalizations.of(context).getVariableText(
ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração', ptText:
'Local Bloqueado para Acesso, Entre em Contato com Administração',
enText: 'Location Blocked for Access, Contact Administration', enText: 'Location Blocked for Access, Contact Administration',
); );
@ -225,7 +243,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
String localName = local['CLI_NOME']; String localName = local['CLI_NOME'];
showAlertDialog( showAlertDialog(
context, context,
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'), FFLocalizations.of(context).getVariableText(
ptText: 'Ativar Vínculo', enText: 'Activate Link'),
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Deseja aceitar o vínculo a $localName?', ptText: 'Deseja aceitar o vínculo a $localName?',
enText: 'Do you wish to accept the link to $localName?'), enText: 'Do you wish to accept the link to $localName?'),
@ -282,7 +301,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
height: height - (height * 0.5), height: height - (height * 0.5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))), borderRadius: const BorderRadius.only(
topLeft: Radius.circular(25), topRight: Radius.circular(25))),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -294,13 +314,16 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Center( Center(
child: Text(FFLocalizations.of(context) child: Text(FFLocalizations.of(context).getVariableText(
.getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")), ptText: "Nenhum Local Encontrado.",
enText: "No local found")),
) )
], ],
), ),
) )
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty) else if (_hasData == true &&
_loading == false &&
_localsWrap.isNotEmpty)
Expanded(child: _listItems(context)), Expanded(child: _listItems(context)),
if (_loading == true) if (_loading == true)
Container( Container(
@ -317,7 +340,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
padding: const EdgeInsets.only(top: 10), padding: const EdgeInsets.only(top: 10),
child: Center( child: Center(
child: Text( child: Text(
FFLocalizations.of(context).getVariableText(ptText: 'Escolha um local', enText: 'Choose a location'), FFLocalizations.of(context).getVariableText(
ptText: 'Escolha um local', enText: 'Choose a location'),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
)))), )))),

View File

@ -63,7 +63,6 @@ class FreCardPin extends StatelessWidget {
} }
} }
class CardItemTemplateComponentWidget extends StatefulWidget { class CardItemTemplateComponentWidget extends StatefulWidget {
const CardItemTemplateComponentWidget({ const CardItemTemplateComponentWidget({
super.key, super.key,
@ -182,33 +181,28 @@ class _CardItemTemplateComponentWidgetState
); );
} }
Widget _generateIcon() { Widget _generateIcon() {
return Column( return Column(
children: [ children: [
widget.icon!, widget.icon!,
], ],
); );
}
} Widget _generatePin() {
Widget _generatePin() {
return widget.pin!; return widget.pin!;
}
}
List<Widget> _generateStatus() { List<Widget> _generateStatus() {
double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context);
return statusLinkedHashMap.expand((statusLinked) {
return statusLinkedHashMap.expand((statusLinked) {
log('statusHashMap: ${statusLinked.length}'); log('statusHashMap: ${statusLinked.length}');
return statusLinked.entries.map((entry) { return statusLinked.entries.map((entry) {
final text = entry.key; final text = entry.key;
final color = entry.value; final color = entry.value;
return Tooltip( return Tooltip(
message: text, message: text,
child: Container( child: Container(
@ -245,9 +239,9 @@ class _CardItemTemplateComponentWidgetState
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [if(widget.pin != null) _generatePin()]), children: [if (widget.pin != null) _generatePin()]),
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -258,7 +252,6 @@ class _CardItemTemplateComponentWidgetState
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
..._generateLabels(), ..._generateLabels(),
Wrap( Wrap(
spacing: 8, spacing: 8,
runSpacing: 4, runSpacing: 4,
@ -270,23 +263,20 @@ class _CardItemTemplateComponentWidgetState
.addToStart(const SizedBox(height: 5)), .addToStart(const SizedBox(height: 5)),
), ),
), ),
if(widget.icon != null) _generateIcon(), if (widget.icon != null) _generateIcon(),
if (widget.imagePath != null) _generateImage() if (widget.imagePath != null) _generateImage()
] ]
.addToEnd(const SizedBox(width: 10)) .addToEnd(const SizedBox(width: 10))
.addToStart(const SizedBox(width: 10)), .addToStart(const SizedBox(width: 10)),
), ),
] ].addToStart(SizedBox(height: 5)).addToEnd(SizedBox(height: 5)),
.addToStart(SizedBox(height: 5))
.addToEnd(SizedBox(height: 5)),
); );
} else { } else {
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (widget.imagePath != null) _generateImage(), if (widget.imagePath != null) _generateImage(),
if(widget.icon != null) _generateIcon(), if (widget.icon != null) _generateIcon(),
Container( Container(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: Column( child: Column(

View File

@ -11,7 +11,7 @@ import 'package:hub/shared/utils/limited_text_size.dart';
class DetailsComponentWidget extends StatefulWidget { class DetailsComponentWidget extends StatefulWidget {
const DetailsComponentWidget({ const DetailsComponentWidget({
super.key, super.key,
required this.labelsHashMap, required this.labelsHashMap,
required this.statusHashMap, required this.statusHashMap,
this.imagePath, this.imagePath,
@ -98,7 +98,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useOldImageOnUrlChange: true, useOldImageOnUrlChange: true,
), ),
), ),
if (widget.icon != null && widget.icon != '') if (widget.icon != null && widget.icon != '')
Container( Container(
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
@ -171,19 +171,18 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
), ),
), ),
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
.override( .override(
fontFamily: FlutterFlowTheme.of(context) fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily, .labelMediumFamily,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: FlutterFlowTheme.of(context).info, color: FlutterFlowTheme.of(context).info,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context).labelMediumFamily,
.labelMediumFamily,
),
fontSize: limitedBodyFontSize,
), ),
fontSize: limitedBodyFontSize,
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: null, maxLines: null,
keyboardType: TextInputType.name, keyboardType: TextInputType.name,

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

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart'; import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
import 'package:hub/features/backend/index.dart'; import 'package:hub/features/backend/index.dart';

View File

@ -1,4 +1,3 @@
class DeadCode { class DeadCode {
final String? desc; final String? desc;

View File

@ -3,7 +3,6 @@
import 'package:hub/features/backend/index.dart'; import 'package:hub/features/backend/index.dart';
import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/nav.dart';
class DeviceStruct extends BaseStruct { class DeviceStruct extends BaseStruct {
DeviceStruct({ DeviceStruct({
String? devUUID, String? devUUID,

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_util.dart';

View File

@ -16,7 +16,8 @@ class HomePageWidget extends StatefulWidget {
State<HomePageWidget> createState() => _HomePageWidgetState(); State<HomePageWidget> createState() => _HomePageWidgetState();
} }
class _HomePageWidgetState extends State<HomePageWidget> with WidgetsBindingObserver { class _HomePageWidgetState extends State<HomePageWidget>
with WidgetsBindingObserver {
final scaffoldKey = GlobalKey<ScaffoldState>(); final scaffoldKey = GlobalKey<ScaffoldState>();
@override @override
@ -96,7 +97,8 @@ class _HomePageWidgetState extends State<HomePageWidget> with WidgetsBindingObse
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).info, color: FlutterFlowTheme.of(context).info,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
), ),
].divide(const SizedBox(width: 8.0)), ].divide(const SizedBox(width: 8.0)),

View File

@ -24,7 +24,8 @@ abstract class LocalsRemoteDataSource {
} }
class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
static final LocalsRemoteDataSourceImpl _instance = LocalsRemoteDataSourceImpl._internal(); static final LocalsRemoteDataSourceImpl _instance =
LocalsRemoteDataSourceImpl._internal();
factory LocalsRemoteDataSourceImpl() => _instance; factory LocalsRemoteDataSourceImpl() => _instance;
LocalsRemoteDataSourceImpl._internal(); LocalsRemoteDataSourceImpl._internal();
@ -50,7 +51,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
final List<dynamic> locals = response.jsonBody['locais'] ?? []; final List<dynamic> locals = response.jsonBody['locais'] ?? [];
final bool isEmpty = locals.isEmpty; final bool isEmpty = locals.isEmpty;
final bool isActive = locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty; final bool isActive =
locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty;
final bool isEnable = !isEmpty && isActive; final bool isEnable = !isEmpty && isActive;
if (isEnable) { if (isEnable) {
@ -95,7 +97,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
final bool isInactived = await LocalUtil.isInactived(locals); final bool isInactived = await LocalUtil.isInactived(locals);
final bool isPending = LocalUtil.isPending(locals); final bool isPending = LocalUtil.isPending(locals);
final bool isUnique = locals.length == 1; final bool isUnique = locals.length == 1;
final bool isBlocked = locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty; final bool isBlocked =
locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty;
final bool isEnabled = isUnique && isActive; final bool isEnabled = isUnique && isActive;
final bool isDisabled = isUnique && isBlocked; final bool isDisabled = isUnique && isBlocked;
final bool isUnselected = await LocalUtil.isUnselected(); final bool isUnselected = await LocalUtil.isUnselected();
@ -148,8 +151,10 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
@override @override
Future<bool> checkLocals(BuildContext context) async { Future<bool> checkLocals(BuildContext context) async {
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key); final String? cliUUID =
final String? cliName = await StorageHelper().get(ProfileStorageKey.clientName.key); await StorageHelper().get(ProfileStorageKey.clientUUID.key);
final String? cliName =
await StorageHelper().get(ProfileStorageKey.clientName.key);
final haveCli = cliUUID != null && cliUUID.isNotEmpty; final haveCli = cliUUID != null && cliUUID.isNotEmpty;
final haveName = cliName != null && cliName.isNotEmpty; final haveName = cliName != null && cliName.isNotEmpty;
return haveCli && haveName; return haveCli && haveName;
@ -175,7 +180,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
if (isError == true) { if (isError == true) {
final GetLocalsCall callback = PhpGroup.getLocalsCall; final GetLocalsCall callback = PhpGroup.getLocalsCall;
response = await callback.call(); response = await callback.call();
final String errorMsg = response.jsonBody['error_msg'] ?? 'Local indisponível'; final String errorMsg =
response.jsonBody['error_msg'] ?? 'Local indisponível';
// await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context, response)); // await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context, response));
return false; return false;
} else { } else {
@ -194,7 +200,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
} }
@override @override
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async { Future<bool> selectLocal(
BuildContext context, ApiCallResponse? response) async {
return await showModalBottomSheet( return await showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -224,13 +231,15 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
enText: 'Device unlinked successfully', enText: 'Device unlinked successfully',
ptText: 'Dispositivo desvinculado com sucesso', ptText: 'Dispositivo desvinculado com sucesso',
); );
final bool status = await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async { final bool status =
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
if (value.jsonBody['error'] == false) { if (value.jsonBody['error'] == false) {
await StorageHelper().set(ProfileStorageKey.clientName.key, ''); await StorageHelper().set(ProfileStorageKey.clientName.key, '');
await StorageHelper().set(ProfileStorageKey.ownerName.key, ''); await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
await StorageHelper().set(ProfileStorageKey.clientUUID.key, ''); await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
context.pop(); context.pop();
context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update}); context.go('/homePage',
extra: {'update': LocalsRepositoryImpl().update});
SnackBarUtil.showSnackBar(context, content); SnackBarUtil.showSnackBar(context, content);
return true; return true;
} }

View File

@ -49,8 +49,10 @@ class LocalsRepositoryImpl implements LocalsRepository {
} }
Future<void> check(BuildContext context) async { Future<void> check(BuildContext context) async {
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key); final String? cliUUID =
final String? ownerUUID = await StorageHelper().get(ProfileStorageKey.ownerUUID.key); await StorageHelper().get(ProfileStorageKey.clientUUID.key);
final String? ownerUUID =
await StorageHelper().get(ProfileStorageKey.ownerUUID.key);
final bool haveCli = cliUUID != null && cliUUID.isNotEmpty; final bool haveCli = cliUUID != null && cliUUID.isNotEmpty;
final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty; final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty;
if (!haveCli && !haveOwner) { if (!haveCli && !haveOwner) {

View File

@ -11,10 +11,13 @@ import 'package:hub/shared/utils/log_util.dart';
class LocalUtil { class LocalUtil {
static void handleError(BuildContext context, String errorMsg) async { static void handleError(BuildContext context, String errorMsg) async {
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; final String devUUID =
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
final String userUUID =
await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty; final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario'); final bool isDevLinked =
!errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
log('() => isLinked: $errorMsg'); log('() => isLinked: $errorMsg');
if (!isAuthenticated) { if (!isAuthenticated) {
errorMsg = FFLocalizations.of(context).getVariableText( errorMsg = FFLocalizations.of(context).getVariableText(
@ -36,13 +39,18 @@ class LocalUtil {
// await DialogUtil.error(context, errorMsg).whenComplete(() async => await LocalsRemoteDataSourceImpl().selectLocal(context, null)); // await DialogUtil.error(context, errorMsg).whenComplete(() async => await LocalsRemoteDataSourceImpl().selectLocal(context, null));
} }
static Future<bool> handleUnavailable(BuildContext context, List<dynamic> locals) async { static Future<bool> handleUnavailable(
BuildContext context, List<dynamic> locals) async {
log('() => isUnavailable'); log('() => isUnavailable');
try { try {
await StorageHelper().set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']); .set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']);
await StorageHelper().set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']); .set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']);
await StorageHelper()
.set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']);
await StorageHelper()
.set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']);
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A'); var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
if (response.jsonBody['error'] == true) { if (response.jsonBody['error'] == true) {
@ -54,10 +62,13 @@ class LocalUtil {
return false; return false;
} }
if (response.jsonBody['error'] == false) if (response.jsonBody['error'] == false)
return await LocalsRemoteDataSourceImpl().processProperty(context).then((value) => value); return await LocalsRemoteDataSourceImpl()
.processProperty(context)
.then((value) => value);
} catch (e, s) { } catch (e, s) {
await DialogUtil.errorDefault(context); await DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s); LogUtil.requestAPIFailed(
'responderVinculo.php', '', 'Responder Vínculo', e, s);
return false; return false;
} }
return false; return false;
@ -65,12 +76,19 @@ class LocalUtil {
static Future<bool> handleEnabled(BuildContext context, dynamic local) async { static Future<bool> handleEnabled(BuildContext context, dynamic local) async {
log('() => isEnabled'); log('() => isEnabled');
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']); .set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']); await StorageHelper()
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']); .set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
await StorageHelper().set(ProfileStorageKey.userName.key, local['USU_NOME']); await StorageHelper()
return await LocalsRemoteDataSourceImpl().processProperty(context).then((v) async { .set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
await StorageHelper()
.set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
await StorageHelper()
.set(ProfileStorageKey.userName.key, local['USU_NOME']);
return await LocalsRemoteDataSourceImpl()
.processProperty(context)
.then((v) async {
if (v == true) return await LicenseRepositoryImpl().updateLicense(); if (v == true) return await LicenseRepositoryImpl().updateLicense();
return v; return v;
}); });
@ -93,9 +111,12 @@ class LocalUtil {
static Future<bool> updateStorageUtil(Map<String, dynamic> jsonBody) async { static Future<bool> updateStorageUtil(Map<String, dynamic> jsonBody) async {
try { try {
await StorageHelper().set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false); await StorageHelper()
await StorageHelper().set(LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false); .set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false);
await StorageHelper().set(LocalsStorageKey.vehicleAutoApproval.key, jsonBody['vehicleAutoApproval'] ?? false); await StorageHelper().set(
LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false);
await StorageHelper().set(LocalsStorageKey.vehicleAutoApproval.key,
jsonBody['vehicleAutoApproval'] ?? false);
await StorageHelper().set( await StorageHelper().set(
LocalsStorageKey.pets.key, LocalsStorageKey.pets.key,
@ -118,19 +139,28 @@ class LocalUtil {
); );
} }
await StorageHelper().set(LocalsStorageKey.petAmount.key, await StorageHelper().set(
jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString()); LocalsStorageKey.petAmount.key,
jsonBody['petAmountRegister']?.toString().isEmpty ?? true
await StorageHelper().set(LocalsStorageKey.vehicleAmountRegister.key, ? '0'
jsonBody['vehicleAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['vehicleAmountRegister'].toString()); : jsonBody['petAmountRegister'].toString());
await StorageHelper().set(
LocalsStorageKey.vehicleAmountRegister.key,
jsonBody['vehicleAmountRegister']?.toString().isEmpty ?? true
? '0'
: jsonBody['vehicleAmountRegister'].toString());
await StorageHelper().set(ProfileStorageKey.userName.key, jsonBody['visitado']['VDO_NOME'] ?? ''); await StorageHelper().set(ProfileStorageKey.userName.key,
await StorageHelper().set(ProfileStorageKey.userEmail.key, jsonBody['visitado']['VDO_EMAIL'] ?? ''); jsonBody['visitado']['VDO_NOME'] ?? '');
await StorageHelper().set(LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false); await StorageHelper().set(ProfileStorageKey.userEmail.key,
jsonBody['visitado']['VDO_EMAIL'] ?? '');
await StorageHelper().set(
LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false);
final bool isNewVersion = jsonBody['newVersion'] ?? false; final bool isNewVersion = jsonBody['newVersion'] ?? false;
await StorageHelper().set(LocalsStorageKey.isNewVersion.key, isNewVersion); await StorageHelper()
.set(LocalsStorageKey.isNewVersion.key, isNewVersion);
return isNewVersion; return isNewVersion;
} catch (e, s) { } catch (e, s) {
log('Error in _updateStorageUtil: $e', stackTrace: s); log('Error in _updateStorageUtil: $e', stackTrace: s);
@ -143,30 +173,44 @@ class LocalUtil {
} }
static Future<bool> isInactived(List<dynamic> locals) async { static Future<bool> isInactived(List<dynamic> locals) async {
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; String cliUUID =
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty; (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
return locals
.where(
(local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A')
.isNotEmpty;
} }
static bool isPending(List<dynamic> locals) { static bool isPending(List<dynamic> locals) {
return locals.where((local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A').isNotEmpty; return locals
.where(
(local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A')
.isNotEmpty;
} }
static Future<bool> isUnselected() async { static Future<bool> isUnselected() async {
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; String cliUUID =
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; String cliName =
(await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
String ownerUUID =
(await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty; return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
} }
static Future<bool> isSelected(bool isInactived) async { static Future<bool> isSelected(bool isInactived) async {
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; String cliUUID =
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
String cliName =
(await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived; return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
} }
static Future<bool> isAvailable() async { static Future<bool> isAvailable() async {
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; String cliUUID =
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
String cliName =
(await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
return cliUUID.isNotEmpty && cliName.isNotEmpty; return cliUUID.isNotEmpty && cliName.isNotEmpty;
} }
} }

View File

@ -9,16 +9,19 @@ import 'package:hub/shared/extensions/dialog_extensions.dart';
import 'package:hub/shared/utils/path_util.dart'; import 'package:hub/shared/utils/path_util.dart';
abstract class MenuLocalDataSource { abstract class MenuLocalDataSource {
Future<MenuItem?> addMenuEntry( Future<MenuItem?> addMenuEntry(Key key, EnumMenuItem item,
Key key, EnumMenuItem item, List<MenuItem?> entries, IconData icon, String text, Function() action); List<MenuItem?> entries, IconData icon, String text, Function() action);
Future<bool> processDisplayDefault(EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries); Future<bool> processDisplayDefault(
EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries);
Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List<MenuItem?> entries); Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt,
List<MenuItem?> entries);
} }
class MenuLocalDataSourceImpl implements MenuLocalDataSource { class MenuLocalDataSourceImpl implements MenuLocalDataSource {
static final MenuLocalDataSourceImpl _instance = MenuLocalDataSourceImpl._internal(); static final MenuLocalDataSourceImpl _instance =
MenuLocalDataSourceImpl._internal();
factory MenuLocalDataSourceImpl() => _instance; factory MenuLocalDataSourceImpl() => _instance;
@ -45,9 +48,12 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
} }
@override @override
Future<bool> processDisplayDefault(EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries) async { Future<bool> processDisplayDefault(
EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries) async {
if (opt.key == 'FRE-HUB-LOGOUT') { if (opt.key == 'FRE-HUB-LOGOUT') {
await addMenuEntry(ValueKey<String>(opt.key), item, entries, opt.icon, opt.name, () async { await addMenuEntry(
ValueKey<String>(opt.key), item, entries, opt.icon, opt.name,
() async {
await AuthenticationService.signOut(navigatorKey.currentContext!); await AuthenticationService.signOut(navigatorKey.currentContext!);
}); });
return true; return true;
@ -56,17 +62,23 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
} }
@override @override
Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List<MenuItem?> entries) async { Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt,
List<MenuItem?> entries) async {
try { try {
switch (display.value) { switch (display.value) {
case 'VISIVEL': case 'VISIVEL':
await addMenuEntry(ValueKey<String>(opt.key), item, entries, opt.icon, opt.name, () async { await addMenuEntry(
ValueKey<String>(opt.key), item, entries, opt.icon, opt.name,
() async {
await PathUtil.nav(opt.route); await PathUtil.nav(opt.route);
}); });
break; break;
case 'DESABILITADO': case 'DESABILITADO':
await addMenuEntry(ValueKey<String>(opt.key), item, entries, opt.icon, opt.name, () async { await addMenuEntry(
await DialogUnavailable.unavailableFeature(navigatorKey.currentContext!); ValueKey<String>(opt.key), item, entries, opt.icon, opt.name,
() async {
await DialogUnavailable.unavailableFeature(
navigatorKey.currentContext!);
}); });
break; break;
case 'INVISIVEL': case 'INVISIVEL':

View File

@ -10,13 +10,15 @@ class MenuRepositoryImpl implements MenuRepository {
final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl(); final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl();
@override @override
Future<List<MenuItem?>> entries2Items(List<MenuEntry> menuEntries, EnumMenuItem menuItem) async { Future<List<MenuItem?>> entries2Items(
List<MenuEntry> menuEntries, EnumMenuItem menuItem) async {
List<MenuItem?> entries = []; List<MenuItem?> entries = [];
// final bool isNewVersion = await StorageHelper().get(KeychainStorageKey.isNewVersion.value).then((v) => v.toBoolean()); // final bool isNewVersion = await StorageHelper().get(KeychainStorageKey.isNewVersion.value).then((v) => v.toBoolean());
try { try {
for (var entry in menuEntries) { for (var entry in menuEntries) {
final bool isDefault = await menuDataSource.processDisplayDefault(menuItem, entry, entries); final bool isDefault = await menuDataSource.processDisplayDefault(
menuItem, entry, entries);
if (isDefault) continue; if (isDefault) continue;
final licenseValue = await LicenseRepositoryImpl().getModule(entry.key); final licenseValue = await LicenseRepositoryImpl().getModule(entry.key);
if (licenseValue != null) { if (licenseValue != null) {
@ -25,17 +27,20 @@ class MenuRepositoryImpl implements MenuRepository {
final startDate = licenseMap['startDate'] ?? ''; final startDate = licenseMap['startDate'] ?? '';
final expirationDate = licenseMap['expirationDate'] ?? ''; final expirationDate = licenseMap['expirationDate'] ?? '';
final isStarted = await DateTimeUtil.processStartDate(startDate); final isStarted = await DateTimeUtil.processStartDate(startDate);
final isExpired = await DateTimeUtil.processExpirationDate(expirationDate); final isExpired =
await DateTimeUtil.processExpirationDate(expirationDate);
if (isStarted && !isExpired) { if (isStarted && !isExpired) {
await menuDataSource.handleMenu(menuItem, display, entry, entries); await menuDataSource.handleMenu(menuItem, display, entry, entries);
} }
if (isExpired) { if (isExpired) {
log('Entry ${entry.key} is expired'); log('Entry ${entry.key} is expired');
await menuDataSource.handleMenu(menuItem, EnumDisplay.inactive, entry, entries); await menuDataSource.handleMenu(
menuItem, EnumDisplay.inactive, entry, entries);
} }
if (!isStarted) { if (!isStarted) {
log('Entry ${entry.key} is not started'); log('Entry ${entry.key} is not started');
await menuDataSource.handleMenu(menuItem, EnumDisplay.inactive, entry, entries); await menuDataSource.handleMenu(
menuItem, EnumDisplay.inactive, entry, entries);
} }
} }
} }
@ -45,9 +50,11 @@ class MenuRepositoryImpl implements MenuRepository {
return entries; return entries;
} }
Future<EnumDisplay> processDisplay(Map<String, dynamic> module, bool isNewVersion) async { Future<EnumDisplay> processDisplay(
Map<String, dynamic> module, bool isNewVersion) async {
if (await _shouldUpdateDisplay(module, isNewVersion)) { if (await _shouldUpdateDisplay(module, isNewVersion)) {
final displayValue = module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL'; final displayValue =
module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL';
await LicenseLocalDataSourceImpl(DatabaseService.database) await LicenseLocalDataSourceImpl(DatabaseService.database)
.setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue); .setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue);
return EnumDisplay.fromString(displayValue); return EnumDisplay.fromString(displayValue);
@ -56,8 +63,13 @@ class MenuRepositoryImpl implements MenuRepository {
return EnumDisplay.fromString(module['display']); return EnumDisplay.fromString(module['display']);
} }
Future<bool> _shouldUpdateDisplay(Map<String, dynamic> module, bool isNewVersion) async { Future<bool> _shouldUpdateDisplay(
const keysToCheck = [LicenseKeys.residents, LicenseKeys.vehicles, LicenseKeys.openedVisits]; Map<String, dynamic> module, bool isNewVersion) async {
const keysToCheck = [
LicenseKeys.residents,
LicenseKeys.vehicles,
LicenseKeys.openedVisits
];
return isNewVersion && keysToCheck.any((key) => module['key'] == key.value); return isNewVersion && keysToCheck.any((key) => module['key'] == key.value);
} }
} }

View File

@ -61,7 +61,9 @@ class License {
} }
static Future<String> _precessWpp() async { static Future<String> _precessWpp() async {
final bool whatsapp = await StorageHelper().get(LocalsStorageKey.whatsapp.key).then((v) => v.toBoolean); final bool whatsapp = await StorageHelper()
.get(LocalsStorageKey.whatsapp.key)
.then((v) => v.toBoolean);
if (whatsapp) if (whatsapp)
return ModuleStatus.active.key; return ModuleStatus.active.key;
else else
@ -69,7 +71,9 @@ class License {
} }
static Future<String> _processProvisional() async { static Future<String> _processProvisional() async {
final bool provisional = await StorageHelper().get(LocalsStorageKey.provisional.key).then((v) => v.toBoolean); final bool provisional = await StorageHelper()
.get(LocalsStorageKey.provisional.key)
.then((v) => v.toBoolean);
if (provisional) if (provisional)
return ModuleStatus.active.key; return ModuleStatus.active.key;
else else
@ -77,7 +81,9 @@ class License {
} }
static Future<String> _processPets() async { static Future<String> _processPets() async {
final bool pets = await StorageHelper().get(LocalsStorageKey.pets.key).then((v) => v.toBoolean); final bool pets = await StorageHelper()
.get(LocalsStorageKey.pets.key)
.then((v) => v.toBoolean);
if (pets) if (pets)
return ModuleStatus.active.key; return ModuleStatus.active.key;
else else
@ -134,14 +140,18 @@ class License {
), ),
Module( Module(
key: LicenseKeys.openedVisits.value, key: LicenseKeys.openedVisits.value,
display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, display: isNewVersionWithModule
? ModuleStatus.active.key
: ModuleStatus.inactive.key,
expirationDate: '', expirationDate: '',
startDate: '', startDate: '',
quantity: 0, quantity: 0,
), ),
Module( Module(
key: LicenseKeys.vehicles.value, key: LicenseKeys.vehicles.value,
display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, display: isNewVersionWithModule
? ModuleStatus.active.key
: ModuleStatus.inactive.key,
expirationDate: '', expirationDate: '',
startDate: '', startDate: '',
quantity: 0, quantity: 0,
@ -155,7 +165,9 @@ class License {
), ),
Module( Module(
key: LicenseKeys.residents.value, key: LicenseKeys.residents.value,
display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, display: isNewVersionWithModule
? ModuleStatus.active.key
: ModuleStatus.inactive.key,
expirationDate: '', expirationDate: '',
startDate: '', startDate: '',
quantity: 0, quantity: 0,
@ -218,14 +230,18 @@ class License {
), ),
Module( Module(
key: LicenseKeys.property.value, key: LicenseKeys.property.value,
display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, display: isNewVersionWithModule
? ModuleStatus.active.key
: ModuleStatus.inactive.key,
expirationDate: '', expirationDate: '',
startDate: '', startDate: '',
quantity: 0, quantity: 0,
), ),
Module( Module(
key: LicenseKeys.people.value, key: LicenseKeys.people.value,
display: isNewVersionWithModule ? ModuleStatus.inactive.key : ModuleStatus.active.key, display: isNewVersionWithModule
? ModuleStatus.inactive.key
: ModuleStatus.active.key,
expirationDate: '', expirationDate: '',
startDate: '', startDate: '',
quantity: 0, quantity: 0,

View File

@ -65,7 +65,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

@ -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 VehiclePage()), builder: (context, params) => const VehiclePage()),
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

@ -1,4 +1,3 @@
import 'package:app_tracking_transparency/app_tracking_transparency.dart'; import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';

View File

@ -53,7 +53,8 @@ class App extends StatefulWidget {
@override @override
State<App> createState() => _AppState(); State<App> createState() => _AppState();
static _AppState of(BuildContext context) => context.findAncestorStateOfType<_AppState>()!; static _AppState of(BuildContext context) =>
context.findAncestorStateOfType<_AppState>()!;
} }
class _AppState extends State<App> { class _AppState extends State<App> {
@ -95,7 +96,8 @@ class _AppState extends State<App> {
}), }),
), ),
); );
final Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates = const [ final Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates =
const [
FFLocalizationsDelegate(), FFLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@ -137,7 +139,8 @@ class _AppState extends State<App> {
await StorageHelper().set(SecureStorageKey.haveLocal.value, true); await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
log('onMessageOpenedApp'); log('onMessageOpenedApp');
} else { } else {
onMessageReceived(message.data, message.notification!.body, message.data['click_action']); onMessageReceived(message.data, message.notification!.body,
message.data['click_action']);
} }
}); });
FirebaseMessaging.instance.getInitialMessage().then((message) async { FirebaseMessaging.instance.getInitialMessage().then((message) async {
@ -171,7 +174,9 @@ class _AppState extends State<App> {
_router = createRouter(_appStateNotifier); _router = createRouter(_appStateNotifier);
Future.delayed( Future.delayed(
const Duration(milliseconds: 1000), const Duration(milliseconds: 1000),
() => mounted ? setState(() => _appStateNotifier.stopShowingSplashImage()) : null, () => mounted
? setState(() => _appStateNotifier.stopShowingSplashImage())
: null,
); );
_setupFirebaseMessaging(); _setupFirebaseMessaging();

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

@ -504,7 +504,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
); );
}); });
}); });
}, },
options: FFButtonOptions( options: FFButtonOptions(
height: 40, height: 40,

View File

@ -1049,6 +1049,4 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
), ),
); );
} }
} }

View File

@ -1,4 +1,3 @@
import 'package:awesome_notifications/awesome_notifications.dart'; import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';

View File

@ -35,10 +35,13 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
children: [ children: [
CustomInputUtil( CustomInputUtil(
controller: widget.model.textFieldControllerLicensePlate, controller: widget.model.textFieldControllerLicensePlate,
validator: widget.model.textControllerLicensePlateValidator.asValidator(context), validator: widget.model.textControllerLicensePlateValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusLicensePlate, focusNode: widget.model.textFieldFocusLicensePlate,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Placa', enText: 'License Plate'), labelText: FFLocalizations.of(context)
hintText: FFLocalizations.of(context).getVariableText(ptText: 'Placa', enText: 'License Plate'), .getVariableText(ptText: 'Placa', enText: 'License Plate'),
hintText: FFLocalizations.of(context)
.getVariableText(ptText: 'Placa', enText: 'License Plate'),
suffixIcon: Symbols.format_color_text, suffixIcon: Symbols.format_color_text,
haveMaxLength: true, haveMaxLength: true,
onChanged: (value) => setState(() {}), onChanged: (value) => setState(() {}),
@ -46,9 +49,11 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
), ),
CustomInputUtil( CustomInputUtil(
controller: widget.model.textFieldControllerModel, controller: widget.model.textFieldControllerModel,
validator: widget.model.textControllerModelValidator.asValidator(context), validator: widget.model.textControllerModelValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusModel, focusNode: widget.model.textFieldFocusModel,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Modelo', enText: 'Model'), labelText: FFLocalizations.of(context)
.getVariableText(ptText: 'Modelo', enText: 'Model'),
hintText: FFLocalizations.of(context).getVariableText( hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Ex: Voyage, Ford', ptText: 'Ex: Voyage, Ford',
enText: 'e.g. Voyage, Ford', enText: 'e.g. Voyage, Ford',
@ -60,9 +65,11 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
), ),
CustomInputUtil( CustomInputUtil(
controller: widget.model.textFieldControllerColor, controller: widget.model.textFieldControllerColor,
validator: widget.model.textControllerColorValidator.asValidator(context), validator: widget.model.textControllerColorValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusColor, focusNode: widget.model.textFieldFocusColor,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cor', enText: 'Color'), labelText: FFLocalizations.of(context)
.getVariableText(ptText: 'Cor', enText: 'Color'),
hintText: FFLocalizations.of(context).getVariableText( hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Ex: Preto, Amarelo, Branco', ptText: 'Ex: Preto, Amarelo, Branco',
enText: 'e.g. Black, Yellow, White', enText: 'e.g. Black, Yellow, White',
@ -75,8 +82,11 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
child: SubmitButtonUtil( child: SubmitButtonUtil(
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register'), labelText: FFLocalizations.of(context)
onPressed: widget.model.isFormValid(context) ? widget.model.registerVehicle : null), .getVariableText(ptText: 'Cadastrar', enText: 'Register'),
onPressed: widget.model.isFormValid(context)
? widget.model.registerVehicle
: null),
), ),
], ],
)); ));
@ -84,7 +94,8 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
Align _buildHeader(BuildContext context) { Align _buildHeader(BuildContext context) {
// double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); // double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); double limitedHeaderFontSize =
LimitedFontSizeUtil.getHeaderFontSize(context);
// double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); // double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context);
return Align( return Align(
@ -93,14 +104,16 @@ class _VehicleRegisterScreenState extends State<VehicleRegisterScreen> {
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 20, 0.0, 15), padding: const EdgeInsetsDirectional.fromSTEB(24.0, 20, 0.0, 15),
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Preencha o formulário de cadastro com os dados do seu veículo', ptText:
'Preencha o formulário de cadastro com os dados do seu veículo',
enText: 'Fill out the registration form with your vehicle data', enText: 'Fill out the registration form with your vehicle data',
), ),
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,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedHeaderFontSize, fontSize: limitedHeaderFontSize,
), ),
), ),

View File

@ -24,14 +24,16 @@ class _VehicleUpdateScreenState extends State<VehicleUpdateScreen> {
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 20, 0.0, 15), padding: const EdgeInsetsDirectional.fromSTEB(24.0, 20, 0.0, 15),
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Preencha o formulário de alteração com os dados do seu veículo', ptText:
'Preencha o formulário de alteração com os dados do seu veículo',
enText: 'Fill out the update form with your vehicle data', enText: 'Fill out the update form with your vehicle data',
), ),
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,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
), ),
), ),
@ -45,10 +47,13 @@ class _VehicleUpdateScreenState extends State<VehicleUpdateScreen> {
children: [ children: [
CustomInputUtil( CustomInputUtil(
controller: widget.model.textFieldControllerLicensePlate, controller: widget.model.textFieldControllerLicensePlate,
validator: widget.model.textControllerLicensePlateValidator.asValidator(context), validator: widget.model.textControllerLicensePlateValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusLicensePlate, focusNode: widget.model.textFieldFocusLicensePlate,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Placa', enText: 'License Plate'), labelText: FFLocalizations.of(context).getVariableText(
hintText: FFLocalizations.of(context).getVariableText(ptText: 'Placa', enText: 'License Plate'), ptText: 'Placa', enText: 'License Plate'),
hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Placa', enText: 'License Plate'),
suffixIcon: Symbols.format_color_text, suffixIcon: Symbols.format_color_text,
haveMaxLength: true, haveMaxLength: true,
onChanged: (value) => setState(() {}), onChanged: (value) => setState(() {}),
@ -58,9 +63,11 @@ class _VehicleUpdateScreenState extends State<VehicleUpdateScreen> {
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
child: CustomInputUtil( child: CustomInputUtil(
controller: widget.model.textFieldControllerModel, controller: widget.model.textFieldControllerModel,
validator: widget.model.textControllerModelValidator.asValidator(context), validator: widget.model.textControllerModelValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusModel, focusNode: widget.model.textFieldFocusModel,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Modelo', enText: 'Model'), labelText: FFLocalizations.of(context)
.getVariableText(ptText: 'Modelo', enText: 'Model'),
hintText: FFLocalizations.of(context).getVariableText( hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Ex: Voyage, Ford', ptText: 'Ex: Voyage, Ford',
enText: 'e.g. Voyage, Ford', enText: 'e.g. Voyage, Ford',
@ -75,9 +82,11 @@ class _VehicleUpdateScreenState extends State<VehicleUpdateScreen> {
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
child: CustomInputUtil( child: CustomInputUtil(
controller: widget.model.textFieldControllerColor, controller: widget.model.textFieldControllerColor,
validator: widget.model.textControllerColorValidator.asValidator(context), validator: widget.model.textControllerColorValidator
.asValidator(context),
focusNode: widget.model.textFieldFocusColor, focusNode: widget.model.textFieldFocusColor,
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cor', enText: 'Color'), labelText: FFLocalizations.of(context)
.getVariableText(ptText: 'Cor', enText: 'Color'),
hintText: FFLocalizations.of(context).getVariableText( hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Ex: Preto, Amarelo, Branco', ptText: 'Ex: Preto, Amarelo, Branco',
enText: 'e.g. Black, Yellow, White', enText: 'e.g. Black, Yellow, White',
@ -91,8 +100,11 @@ class _VehicleUpdateScreenState extends State<VehicleUpdateScreen> {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
child: SubmitButtonUtil( child: SubmitButtonUtil(
labelText: FFLocalizations.of(context).getVariableText(ptText: 'Salvar', enText: 'Save'), labelText: FFLocalizations.of(context)
onPressed: widget.model.isFormValid(context) ? widget.model.updateVehicle : null), .getVariableText(ptText: 'Salvar', enText: 'Save'),
onPressed: widget.model.isFormValid(context)
? widget.model.updateVehicle
: null),
), ),
], ],
)), )),

View File

@ -1,4 +1,3 @@
import 'dart:collection'; import 'dart:collection';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,7 +30,8 @@ class VehiclePage extends StatefulWidget {
_VehiclePageState createState() => _VehiclePageState(); _VehiclePageState createState() => _VehiclePageState();
} }
class _VehiclePageState extends State<VehiclePage> with TickerProviderStateMixin { class _VehiclePageState extends State<VehiclePage>
with TickerProviderStateMixin {
int count = 0; int count = 0;
late final VehicleModel _model; late final VehicleModel _model;
@ -99,7 +99,8 @@ class _VehiclePageState extends State<VehiclePage> with TickerProviderStateMixin
Future<bool> _initializeModule() async { Future<bool> _initializeModule() async {
try { try {
final module = await LicenseRepositoryImpl().getModule('FRE-HUB-VEHICLES-MANAGER'); final module =
await LicenseRepositoryImpl().getModule('FRE-HUB-VEHICLES-MANAGER');
return await LicenseUtil.processModule(module); return await LicenseUtil.processModule(module);
} catch (e) { } catch (e) {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
@ -121,20 +122,25 @@ class _VehiclePageState extends State<VehiclePage> with TickerProviderStateMixin
} }
Widget _buildVehicleManager(BuildContext context) { Widget _buildVehicleManager(BuildContext context) {
final vehicleHistoryScreenLabel = final vehicleHistoryScreenLabel = FFLocalizations.of(context)
FFLocalizations.of(context).getVariableText(ptText: 'Consultar', enText: 'History'); .getVariableText(ptText: 'Consultar', enText: 'History');
final vehicleRegisterScreenLabel = final vehicleRegisterScreenLabel = FFLocalizations.of(context)
FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register'); .getVariableText(ptText: 'Cadastrar', enText: 'Register');
final vehicleUpdateScreenLabel = FFLocalizations.of(context).getVariableText(ptText: 'Editar', enText: 'Edit'); final vehicleUpdateScreenLabel = FFLocalizations.of(context)
.getVariableText(ptText: 'Editar', enText: 'Edit');
return TabViewUtil( return TabViewUtil(
context: context, context: context,
model: _model, model: _model,
labelTab1: vehicleHistoryScreenLabel, labelTab1: vehicleHistoryScreenLabel,
labelTab2: _model.isEditing ? vehicleUpdateScreenLabel : vehicleRegisterScreenLabel, labelTab2: _model.isEditing
? vehicleUpdateScreenLabel
: vehicleRegisterScreenLabel,
controller: _model.tabBarController, controller: _model.tabBarController,
widget1: VehicleHistoryScreen(_model), widget1: VehicleHistoryScreen(_model),
widget2: _model.isEditing ? VehicleUpdateScreen(_model) : VehicleRegisterScreen(_model), widget2: _model.isEditing
? VehicleUpdateScreen(_model)
: VehicleRegisterScreen(_model),
onEditingChanged: onEditingChanged, onEditingChanged: onEditingChanged,
); );
} }
@ -145,14 +151,16 @@ class _VehiclePageState extends State<VehiclePage> with TickerProviderStateMixin
final theme = FlutterFlowTheme.of(context); final theme = FlutterFlowTheme.of(context);
final backgroundColor = theme.primaryBackground; final backgroundColor = theme.primaryBackground;
final primaryText = theme.primaryText; final primaryText = theme.primaryText;
final title = FFLocalizations.of(context).getVariableText(enText: 'Vehicles', ptText: 'Veículos'); final title = FFLocalizations.of(context)
.getVariableText(enText: 'Vehicles', ptText: 'Veículos');
final titleStyle = theme.headlineMedium.override( final titleStyle = theme.headlineMedium.override(
fontFamily: theme.headlineMediumFamily, fontFamily: theme.headlineMediumFamily,
color: primaryText, color: primaryText,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), useGoogleFonts:
GoogleFonts.asMap().containsKey(theme.headlineMediumFamily),
); );
final backButton = _backButton(context, theme); final backButton = _backButton(context, theme);

View File

@ -11,7 +11,8 @@ class VisitsModel extends FlutterFlowModel<VehiclePage> {
VisitsModel._internal({this.onRefresh}); VisitsModel._internal({this.onRefresh});
factory VisitsModel({VoidCallback? onRefresh}) => _instance ??= VisitsModel._internal(onRefresh: onRefresh); factory VisitsModel({VoidCallback? onRefresh}) =>
_instance ??= VisitsModel._internal(onRefresh: onRefresh);
static void resetInstance() => _instance = null; static void resetInstance() => _instance = null;
late final VoidCallback? onRefresh; late final VoidCallback? onRefresh;
@ -33,7 +34,8 @@ class VisitsModel extends FlutterFlowModel<VehiclePage> {
Future<void> initAsync() async { Future<void> initAsync() async {
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; cliUUID =
(await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
onRefresh?.call(); onRefresh?.call();
} }
@ -87,7 +89,9 @@ class VisitsModel extends FlutterFlowModel<VehiclePage> {
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: item['VTA_FIXA'] ? "Entrada Recorrente" : "Entrada Única", ptText: item['VTA_FIXA'] ? "Entrada Recorrente" : "Entrada Única",
enText: item['VTA_FIXA'] ? "Recurrent Entry" : "Single Entry", enText: item['VTA_FIXA'] ? "Recurrent Entry" : "Single Entry",
): item['VTA_FIXA'] == false ? FlutterFlowTheme.of(context).success : FlutterFlowTheme.of(context).warning, ): item['VTA_FIXA'] == false
? FlutterFlowTheme.of(context).success
: FlutterFlowTheme.of(context).warning,
}) })
], ],
); );

View File

@ -0,0 +1 @@

View File

@ -10,7 +10,7 @@ extension StringNullableExtensions on String? {
return false; return false;
} }
bool get isNotNullAndEmpty { bool get isNotNullAndEmpty {
if (this == null) return false; if (this == null) return false;
if (this == '') return false; if (this == '') return false;
return true; return true;
@ -19,7 +19,6 @@ extension StringNullableExtensions on String? {
extension StringExtensions on String { extension StringExtensions on String {
bool get toBoolean { bool get toBoolean {
return toLowerCase() == 'true'; return toLowerCase() == 'true';
} }
} }

View File

@ -10,7 +10,8 @@ class LicenseUtil {
final expirationDate = moduleMap['expirationDate'] ?? ''; final expirationDate = moduleMap['expirationDate'] ?? '';
final isStarted = await DateTimeUtil.processStartDate(startDate); final isStarted = await DateTimeUtil.processStartDate(startDate);
final isExpired = await DateTimeUtil.processExpirationDate(expirationDate); final isExpired = await DateTimeUtil.processExpirationDate(expirationDate);
if (isStarted && !isExpired) return EnumDisplay.fromString(moduleMap["display"]) == EnumDisplay.active; if (isStarted && !isExpired)
return EnumDisplay.fromString(moduleMap["display"]) == EnumDisplay.active;
if (isExpired) return false; if (isExpired) return false;
return false; return false;
} }