This commit is contained in:
jantunesmessias 2025-02-18 16:29:07 -03:00
parent 963ccb64db
commit 642daa3848
15 changed files with 107 additions and 132 deletions

View File

@ -48,11 +48,11 @@ class AuthenticationTest {
await _navigateToSignIn($);
for (var credential in credentials) {
print('Função: ${credential.functionName}');
print('Entradas: ${credential.inputs}');
print('Saída: ${credential.output}');
print('Mensagem: ${credential.message}');
print('---');
log('Função: ${credential.functionName}');
log('Entradas: ${credential.inputs}');
log('Saída: ${credential.output}');
log('Mensagem: ${credential.message}');
log('---');
await _auth(credential.output, $, throwsException);
}
@ -156,11 +156,11 @@ class AuthenticationTest {
await $.pumpWidgetAndSettle(const App());
for (var credential in credentials) {
print('Função: ${credential.functionName}');
print('Entradas: ${credential.inputs}');
print('Saída: ${credential.output}');
print('Mensagem: ${credential.message}');
print('---');
log('Função: ${credential.functionName}');
log('Entradas: ${credential.inputs}');
log('Saída: ${credential.output}');
log('Mensagem: ${credential.message}');
log('---');
await _navigateToSignUp($);
await _auth(credential.output, $, throwsException);

View File

@ -68,8 +68,8 @@ class MenuTest {
route = entry.key;
title = entry.value;
print('route: $route');
print('title: $title');
log('route: $route');
log('title: $title');
if (route == '/petsPage') continue;
if (route == '/fastPassPage') continue;
@ -326,7 +326,6 @@ class MenuTest {
final Key? widgetKey = entry.key;
expect(widgetKey, isNotNull);
print('WIDGETKEY = $widgetKey');
if (widgetKey == ValueKey<String>('FRE-HUB-FASTPASS')) continue;
if (widgetKey == ValueKey<String>('FRE-HUB-QRCODE')) continue;
if (widgetKey == ValueKey<String>('FRE-HUB-RESERVATIONS')) continue;

View File

@ -206,7 +206,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
}
Widget _item(BuildContext context, dynamic local) {
log('local: ${local['CLI_NOME']}');
return CardItemTemplateComponentWidget(
key: ValueKey<String>(local['CLI_NOME']),
imagePath: _imagePath(local),

View File

@ -1,4 +1,5 @@
import 'dart:collection';
import 'dart:developer';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
@ -101,7 +102,7 @@ class _CardItemTemplateComponentWidgetState
}
Widget _generateImage() {
print('img: ${widget.imagePath ?? ''}');
log('img: ${widget.imagePath ?? ''}');
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
return ClipRRect(
borderRadius: BorderRadius.circular(20),

View File

@ -43,14 +43,11 @@ class DocumentPageState extends PageState<DocumentPage> {
@override
Widget build(BuildContext context) {
log('Build -> DocumentPage');
return RxBlocMultiBuilder2<DocumentPageBlocType, bool, (Document, Uri)?>(
state1: (bloc) => bloc.states.isDocumentSelected,
state2: (bloc) => bloc.states.currentDocument,
bloc: context.read<DocumentPageBloc>(),
builder: (context, isSelect, current, bloc) {
log('-> Build -> DocumentPage -> RxBlocMultiBuilder2');
if (isSelect.hasData && isSelect.data!) {
return _buildDocumentViewScreen(current, bloc);
} else {
@ -122,13 +119,12 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
/// [Body]
void onView(Document document, BuildContext context) async {
log('Disparando evento selectDocument');
bloc.events.selectDocument(document);
}
Widget itemBodyBuilder<T extends Document>(
BuildContext context, T item, int index) {
print('ItemBuilder -> $index');
log('ItemBuilder -> $index');
return DocumentItem(
document: item,
@ -138,10 +134,8 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
Future<List<T?>> generateBodyItems<T, Q>(
int pageKey, int pageSize, Q query) async {
log('generateDocuments: $query');
final List<T?> error = [null];
print('Query: ${query is Document}');
log('Query: ${query is Document}');
final GetDocuments getDocuments = FreAccessWSGlobal.getDocuments;
final ApiCallResponse newItems = await getDocuments.call(pageKey, query);
@ -153,7 +147,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
late final List<Document> docs = [];
for (var item in list) {
log('-> generateDocuments: $item');
final String description = item['description'];
final String type = item['type'];
final String category = item['category']['description'];
@ -222,7 +215,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
});
Future<List<T?>> generateFooterItems<T>() async {
log('generateCategories: ');
final List<T?> error = [null];
final GetCategories getCategories = FreAccessWSGlobal.getCategories;
@ -244,7 +236,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
);
cats.add(cat);
}
log('cats: $cats');
return cats as List<T?>;
}
@ -385,7 +376,6 @@ class DocumentPageBloc extends $DocumentPageBloc {
@override
Stream<(Document, Uri)?> _mapToCurrentDocumentState() => _$selectDocumentEvent
.switchMap((event) async* {
log('Evento selectDocument recebido: ${event.description}');
final uri = await GetPDF().call(event.id);
yield (event, uri);
})
@ -432,7 +422,6 @@ class DocumentManagerScreen extends StatelessScreen {
}
Widget buildBody(BuildContext context) {
log('Build -> DocumentManagerScreen');
final SizedBox space = SizedBox(height: 30);
return Column(
children: [
@ -478,47 +467,40 @@ class _DocumentViewScreenState extends ScreenState<DocumentViewScreen> {
final locale = FFLocalizations.of(context);
backAction() => widget.bloc.events.unselectDocument();
infoAction() async => await showDialog(
useSafeArea: true,
context: context,
builder: (context) {
return Material(
child: DetailsComponentWidget(
buttons: [],
statusHashMap: [],
labelsHashMap: Map<String, String>.from({
locale.getVariableText(
enText: 'Description',
ptText: 'Descrição',
): widget.doc.$1.description,
locale.getVariableText(
enText: 'Type',
ptText: 'Tipo',
): widget.doc.$1.type,
locale.getVariableText(
enText: 'Category',
ptText: 'Categoria',
): widget.doc.$1.category.title,
locale.getVariableText(
enText: 'Person',
ptText: 'Pessoa',
): widget.doc.$1.person,
locale.getVariableText(
enText: 'Property',
ptText: 'Propriedade',
): widget.doc.$1.property,
locale.getVariableText(
enText: 'Created At',
ptText: 'Criado em',
): widget.doc.$1.createdAt,
locale.getVariableText(
enText: 'Updated At',
ptText: 'Atualizado em',
): widget.doc.$1.updatedAt,
}),
),
);
});
infoAction() => DetailsComponentWidget(
buttons: [],
statusHashMap: [],
labelsHashMap: Map<String, String>.from({
locale.getVariableText(
enText: 'Description',
ptText: 'Descrição',
): widget.doc.$1.description,
locale.getVariableText(
enText: 'Type',
ptText: 'Tipo',
): widget.doc.$1.type,
locale.getVariableText(
enText: 'Category',
ptText: 'Categoria',
): widget.doc.$1.category.title,
locale.getVariableText(
enText: 'Person',
ptText: 'Pessoa',
): widget.doc.$1.person,
locale.getVariableText(
enText: 'Property',
ptText: 'Propriedade',
): widget.doc.$1.property,
locale.getVariableText(
enText: 'Created At',
ptText: 'Criado em',
): widget.doc.$1.createdAt,
locale.getVariableText(
enText: 'Updated At',
ptText: 'Atualizado em',
): widget.doc.$1.updatedAt,
}),
);
return PopScope(
canPop: false,

View File

@ -74,7 +74,7 @@ class LocalsLocalDataSourceImpl implements LocalsLocalDataSource {
await DatabaseService.database
.delete(LocalsConstants.tableLocalsKeychain);
} catch (e, s) {
log('() => clearAll keychain: $e', stackTrace: s);
log('() => clearAll keychain: $e stackTrace: $s');
}
}
}

View File

@ -70,7 +70,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
@override
Future<bool> processLocals(BuildContext context) async {
log('() => processLocals');
print('-> processLocals');
try {
final GetLocalsCall callback = FreAccessWSGlobal.getLocalsCall;
final ApiCallResponse response = await callback.call();
@ -114,31 +114,30 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
} else if (isEnabled) {
return await LocalUtil.handleEnabled(context, locals[0]);
} else if (isUnselected) {
log('() => isUnselected');
log('-> isUnselected');
return await selectLocal(context, response);
} else if (isSelected) {
log('() => isSelected');
log('-> isSelected');
return await processProperty(context).then((v) async {
if (v == true) return await LicenseRepositoryImpl().updateLicense();
return v;
});
} else if (isAvailable) {
log('() => isAvailable');
log('-> isAvailable');
return await processProperty(context).then((v) async {
if (v == true) return await LicenseRepositoryImpl().updateLicense();
return v;
});
} else {
if (!isUnique && !isActive) log('() => not unique and not active');
if (!isUnique && isInactived) log('() => not unique and inactived');
if (!isUnique && isPending) log('() => not unique and pending');
if (!isUnique && isBlocked) log('() => not unique and blocked');
log('() => else');
if (!isUnique && !isActive) log('-> not unique and not active');
if (!isUnique && isInactived) log('-> not unique and inactived');
if (!isUnique && isPending) log('-> not unique and pending');
if (!isUnique && isBlocked) log('-> not unique and blocked');
log('-> else');
return await selectLocal(context, response);
}
} catch (e, s) {
log('() => stack: $s');
log('() => catch: $e', stackTrace: s);
log('-> catch: $e', stackTrace: s);
// return await selectLocal(context);
// final String errorMsg = FFLocalizations.of(context).getVariableText(
// enText: 'Error getting locals, verify your connection',
@ -189,7 +188,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
return true;
}
} catch (e, s) {
log('() => error processData: $e', stackTrace: s);
log('-> error processData: $e', stackTrace: s);
// final String errorMsg = FFLocalizations.of(context).getVariableText(
// enText: 'Error getting data, verify your connection',
// ptText: 'Erro ao obter dados, verifique sua conexão',

View File

@ -21,7 +21,7 @@ class DeepLinkService {
if (_isInitialized) return;
try {
_appLinks = AppLinks();
print('initDeepLinks');
log('initDeepLinks');
_linkSubscription = _appLinks.uriLinkStream.listen((uri) async {
if (!StorageHelper().isRecovered) {
await _handleDeepLink(uri);
@ -29,25 +29,25 @@ class DeepLinkService {
});
_isInitialized = true;
} catch (e) {
print('Error initializing deep links: $e');
log('Error initializing deep links: $e');
}
}
Future<void> _handleDeepLink(Uri uri) async {
try {
print('Handling deep link: $uri');
log('Handling deep link: $uri');
if (StorageHelper().isRecovered) return;
StorageHelper().isRecovered = true;
final email = uri.queryParameters['email'] ?? '';
final token = uri.queryParameters['token'] ?? '';
print('email: $email, token: $token');
log('email: $email, token: $token');
if (email.isNotEmpty && token.isNotEmpty) {
await _showForgotPasswordScreen(email, token);
}
} catch (e, s) {
print('Error handling deep link: $e, $s');
log('Error handling deep link: $e, $s');
}
}
@ -72,11 +72,11 @@ class DeepLinkService {
enableDrag: true,
).whenComplete(() {
StorageHelper().isRecovered = false;
print('showModalBottomSheet completed');
log('showModalBottomSheet completed');
});
});
} catch (e, s) {
print('Error showing forgot password screen: $e, $s');
log('Error showing forgot password screen: $e, $s');
}
}

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:hub/features/module/index.dart';
import 'package:hub/features/storage/index.dart';
import 'package:sqflite/sqflite.dart';
@ -33,29 +35,29 @@ class DatabaseService {
onOpen: _onOpen,
onConfigure: _onConfigure,
);
print('Database initialized');
log('Database initialized');
await LicenseRepositoryImpl().updateLicense();
isInitialized = true;
}
Future<void> _onConfigure(Database database) async {
print('Configuring database...');
log('Configuring database...');
}
Future<void> _onOpen(Database database) async {
print('Opening database...');
log('Opening database...');
await _executePragmas(database);
}
Future<void> _onCreate(Database database, int version) async {
print('Creating database...');
log('Creating database...');
await database.execute(createKeychainTable);
await _onUpgrade(database, 1, _dbVersion);
}
Future<void> _onUpgrade(
Database database, int oldVersion, int newVersion) async {
print('Upgrading database from version $oldVersion to $newVersion...');
log('Upgrading database from version $oldVersion to $newVersion...');
if (oldVersion < 2 && newVersion >= 2) {
await database.execute(LicenseConstants.createLicenseTable);
await database.execute(LicenseConstants.updatePetsHistoryTrigger);
@ -70,7 +72,7 @@ class DatabaseService {
Future<void> _onDowngrade(
Database database, int oldVersion, int newVersion) async {
print('Downgrading database from version $oldVersion to $newVersion...');
log('Downgrading database from version $oldVersion to $newVersion...');
if (oldVersion >= 2 && newVersion < 2) {
await database.execute(LicenseConstants.deleteLicenseTable);
await database.execute(LicenseConstants.dropPeopleDisplayTrigger);

View File

@ -50,7 +50,7 @@ Future<Map<String, String>> stringToMap(String v) async {
}),
));
} catch (e) {
print('Error parsing string to map: $e');
log('Error parsing string to map: $e');
return Future.value({});
}
}

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
@ -25,68 +27,68 @@ Future<void> initializeApp() async {
}
Future<void> _initializeTracking() async {
print('Requesting tracking authorization...');
log('Requesting tracking authorization...');
await AppTrackingTransparency.requestTrackingAuthorization();
print('Tracking authorization requested');
log('Tracking authorization requested');
}
Future<void> _initializeFirebase() async {
print('Initializing Firebase...');
log('Initializing Firebase...');
await Firebase.initializeApp();
print('Firebase initialized');
log('Firebase initialized');
}
Future<void> _initializeNotificationService() async {
print('Initializing Notification Service...');
log('Initializing Notification Service...');
await NotificationService.initialize();
print('Notification Service initialized');
log('Notification Service initialized');
}
void _initializeUrlStrategy() {
print('Initializing URL Strategy...');
log('Initializing URL Strategy...');
setUrlStrategy(PathUrlStrategy());
print('URL Strategy initialized');
log('URL Strategy initialized');
}
Future<void> _initializeSystemSettings() async {
print('Initializing System Settings...');
log('Initializing System Settings...');
final crashlyticsInstance = FirebaseCrashlytics.instance;
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
if (kDebugMode) {
print('Debug mode');
log('Debug mode');
} else {
print('Release mode');
log('Release mode');
// bool unsentReports =
// await FirebaseCrashlytics.instance.checkForUnsentReports();
// if (unsentReports) {
// // Existem relatórios não enviados
// await crashlyticsInstance.sendUnsentReports();
// print('Existem relatórios de falhas não enviados.');
// log('Existem relatórios de falhas não enviados.');
// } else {
// // Não existem relatórios não enviados
// print('Todos os relatórios de falhas foram enviados.');
// log('Todos os relatórios de falhas foram enviados.');
// }
await crashlyticsInstance.setCrashlyticsCollectionEnabled(true);
// if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
FlutterError.onError = crashlyticsInstance.recordFlutterError;
print('Crashlytics enabled');
log('Crashlytics enabled');
// }
}
}
Future<void> _initializeFlutterFlow() async {
print('Initializing FlutterFlow...');
log('Initializing FlutterFlow...');
await FlutterFlowTheme.initialize();
await FFLocalizations.initialize();
print('FlutterFlow initialized');
log('FlutterFlow initialized');
}
Future<void> _initializeNav() async {
print('Initializing Nav...');
log('Initializing Nav...');
GoRouter.optionURLReflectsImperativeAPIs = true;
usePathUrlStrategy();
print('Nav initialized');
log('Nav initialized');
}

View File

@ -125,7 +125,6 @@
// }
// Widget buildLoadingIndicator(BuildContext context) {
// print('Loading');
// return Container(
// padding: const EdgeInsets.symmetric(vertical: 15),
// child: Center(

View File

@ -434,7 +434,6 @@ class EnhancedListViewBloc<T, H, F, Q>
}
void filterBodyItems(Q query) {
print('filterBodyItems Q: ${query == null}');
_$loadBodyItemsEvent.add((query: query, reset: true));
}

View File

@ -218,7 +218,6 @@ part of 'widgets.dart';
// ));
// widget.pagingController.refresh();
// } else if (data is Document) {
// log('filter: ${data.description}');
// safeSetState(() => query = data);
// widget.pagingController.refresh();

View File

@ -35,21 +35,15 @@ mixin Template {
if (action == null) return [];
return [
IconButton(
onPressed: () async => await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Info'),
content: Text('This is a sample app.'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('Close'))
],
)),
icon: Icon(
Symbols.info_i_rounded,
color: Colors.black,
))
onPressed: () async => await showDialog(
context: context,
builder: (context) => action(),
),
icon: Icon(
Symbols.info_i_rounded,
color: Colors.black,
),
)
];
}