WIP
This commit is contained in:
parent
963ccb64db
commit
642daa3848
|
@ -48,11 +48,11 @@ class AuthenticationTest {
|
||||||
await _navigateToSignIn($);
|
await _navigateToSignIn($);
|
||||||
|
|
||||||
for (var credential in credentials) {
|
for (var credential in credentials) {
|
||||||
print('Função: ${credential.functionName}');
|
log('Função: ${credential.functionName}');
|
||||||
print('Entradas: ${credential.inputs}');
|
log('Entradas: ${credential.inputs}');
|
||||||
print('Saída: ${credential.output}');
|
log('Saída: ${credential.output}');
|
||||||
print('Mensagem: ${credential.message}');
|
log('Mensagem: ${credential.message}');
|
||||||
print('---');
|
log('---');
|
||||||
|
|
||||||
await _auth(credential.output, $, throwsException);
|
await _auth(credential.output, $, throwsException);
|
||||||
}
|
}
|
||||||
|
@ -156,11 +156,11 @@ class AuthenticationTest {
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
|
|
||||||
for (var credential in credentials) {
|
for (var credential in credentials) {
|
||||||
print('Função: ${credential.functionName}');
|
log('Função: ${credential.functionName}');
|
||||||
print('Entradas: ${credential.inputs}');
|
log('Entradas: ${credential.inputs}');
|
||||||
print('Saída: ${credential.output}');
|
log('Saída: ${credential.output}');
|
||||||
print('Mensagem: ${credential.message}');
|
log('Mensagem: ${credential.message}');
|
||||||
print('---');
|
log('---');
|
||||||
|
|
||||||
await _navigateToSignUp($);
|
await _navigateToSignUp($);
|
||||||
await _auth(credential.output, $, throwsException);
|
await _auth(credential.output, $, throwsException);
|
||||||
|
|
|
@ -68,8 +68,8 @@ class MenuTest {
|
||||||
route = entry.key;
|
route = entry.key;
|
||||||
title = entry.value;
|
title = entry.value;
|
||||||
|
|
||||||
print('route: $route');
|
log('route: $route');
|
||||||
print('title: $title');
|
log('title: $title');
|
||||||
|
|
||||||
if (route == '/petsPage') continue;
|
if (route == '/petsPage') continue;
|
||||||
if (route == '/fastPassPage') continue;
|
if (route == '/fastPassPage') continue;
|
||||||
|
@ -326,7 +326,6 @@ class MenuTest {
|
||||||
final Key? widgetKey = entry.key;
|
final Key? widgetKey = entry.key;
|
||||||
expect(widgetKey, isNotNull);
|
expect(widgetKey, isNotNull);
|
||||||
|
|
||||||
print('WIDGETKEY = $widgetKey');
|
|
||||||
if (widgetKey == ValueKey<String>('FRE-HUB-FASTPASS')) continue;
|
if (widgetKey == ValueKey<String>('FRE-HUB-FASTPASS')) continue;
|
||||||
if (widgetKey == ValueKey<String>('FRE-HUB-QRCODE')) continue;
|
if (widgetKey == ValueKey<String>('FRE-HUB-QRCODE')) continue;
|
||||||
if (widgetKey == ValueKey<String>('FRE-HUB-RESERVATIONS')) continue;
|
if (widgetKey == ValueKey<String>('FRE-HUB-RESERVATIONS')) continue;
|
||||||
|
|
|
@ -206,7 +206,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _item(BuildContext context, dynamic local) {
|
Widget _item(BuildContext context, dynamic local) {
|
||||||
log('local: ${local['CLI_NOME']}');
|
|
||||||
return CardItemTemplateComponentWidget(
|
return CardItemTemplateComponentWidget(
|
||||||
key: ValueKey<String>(local['CLI_NOME']),
|
key: ValueKey<String>(local['CLI_NOME']),
|
||||||
imagePath: _imagePath(local),
|
imagePath: _imagePath(local),
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -101,7 +102,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _generateImage() {
|
Widget _generateImage() {
|
||||||
print('img: ${widget.imagePath ?? ''}');
|
log('img: ${widget.imagePath ?? ''}');
|
||||||
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
|
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
|
|
@ -43,14 +43,11 @@ class DocumentPageState extends PageState<DocumentPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
log('Build -> DocumentPage');
|
|
||||||
|
|
||||||
return RxBlocMultiBuilder2<DocumentPageBlocType, bool, (Document, Uri)?>(
|
return RxBlocMultiBuilder2<DocumentPageBlocType, bool, (Document, Uri)?>(
|
||||||
state1: (bloc) => bloc.states.isDocumentSelected,
|
state1: (bloc) => bloc.states.isDocumentSelected,
|
||||||
state2: (bloc) => bloc.states.currentDocument,
|
state2: (bloc) => bloc.states.currentDocument,
|
||||||
bloc: context.read<DocumentPageBloc>(),
|
bloc: context.read<DocumentPageBloc>(),
|
||||||
builder: (context, isSelect, current, bloc) {
|
builder: (context, isSelect, current, bloc) {
|
||||||
log('-> Build -> DocumentPage -> RxBlocMultiBuilder2');
|
|
||||||
if (isSelect.hasData && isSelect.data!) {
|
if (isSelect.hasData && isSelect.data!) {
|
||||||
return _buildDocumentViewScreen(current, bloc);
|
return _buildDocumentViewScreen(current, bloc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -122,13 +119,12 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
|
||||||
/// [Body]
|
/// [Body]
|
||||||
|
|
||||||
void onView(Document document, BuildContext context) async {
|
void onView(Document document, BuildContext context) async {
|
||||||
log('Disparando evento selectDocument');
|
|
||||||
bloc.events.selectDocument(document);
|
bloc.events.selectDocument(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget itemBodyBuilder<T extends Document>(
|
Widget itemBodyBuilder<T extends Document>(
|
||||||
BuildContext context, T item, int index) {
|
BuildContext context, T item, int index) {
|
||||||
print('ItemBuilder -> $index');
|
log('ItemBuilder -> $index');
|
||||||
|
|
||||||
return DocumentItem(
|
return DocumentItem(
|
||||||
document: item,
|
document: item,
|
||||||
|
@ -138,10 +134,8 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
|
||||||
|
|
||||||
Future<List<T?>> generateBodyItems<T, Q>(
|
Future<List<T?>> generateBodyItems<T, Q>(
|
||||||
int pageKey, int pageSize, Q query) async {
|
int pageKey, int pageSize, Q query) async {
|
||||||
log('generateDocuments: $query');
|
|
||||||
|
|
||||||
final List<T?> error = [null];
|
final List<T?> error = [null];
|
||||||
print('Query: ${query is Document}');
|
log('Query: ${query is Document}');
|
||||||
final GetDocuments getDocuments = FreAccessWSGlobal.getDocuments;
|
final GetDocuments getDocuments = FreAccessWSGlobal.getDocuments;
|
||||||
final ApiCallResponse newItems = await getDocuments.call(pageKey, query);
|
final ApiCallResponse newItems = await getDocuments.call(pageKey, query);
|
||||||
|
|
||||||
|
@ -153,7 +147,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
|
||||||
late final List<Document> docs = [];
|
late final List<Document> docs = [];
|
||||||
|
|
||||||
for (var item in list) {
|
for (var item in list) {
|
||||||
log('-> generateDocuments: $item');
|
|
||||||
final String description = item['description'];
|
final String description = item['description'];
|
||||||
final String type = item['type'];
|
final String type = item['type'];
|
||||||
final String category = item['category']['description'];
|
final String category = item['category']['description'];
|
||||||
|
@ -222,7 +215,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<List<T?>> generateFooterItems<T>() async {
|
Future<List<T?>> generateFooterItems<T>() async {
|
||||||
log('generateCategories: ');
|
|
||||||
final List<T?> error = [null];
|
final List<T?> error = [null];
|
||||||
|
|
||||||
final GetCategories getCategories = FreAccessWSGlobal.getCategories;
|
final GetCategories getCategories = FreAccessWSGlobal.getCategories;
|
||||||
|
@ -244,7 +236,6 @@ class DocumentPageModel extends FlutterFlowModel<DocumentPage> {
|
||||||
);
|
);
|
||||||
cats.add(cat);
|
cats.add(cat);
|
||||||
}
|
}
|
||||||
log('cats: $cats');
|
|
||||||
return cats as List<T?>;
|
return cats as List<T?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +376,6 @@ class DocumentPageBloc extends $DocumentPageBloc {
|
||||||
@override
|
@override
|
||||||
Stream<(Document, Uri)?> _mapToCurrentDocumentState() => _$selectDocumentEvent
|
Stream<(Document, Uri)?> _mapToCurrentDocumentState() => _$selectDocumentEvent
|
||||||
.switchMap((event) async* {
|
.switchMap((event) async* {
|
||||||
log('Evento selectDocument recebido: ${event.description}');
|
|
||||||
final uri = await GetPDF().call(event.id);
|
final uri = await GetPDF().call(event.id);
|
||||||
yield (event, uri);
|
yield (event, uri);
|
||||||
})
|
})
|
||||||
|
@ -432,7 +422,6 @@ class DocumentManagerScreen extends StatelessScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildBody(BuildContext context) {
|
Widget buildBody(BuildContext context) {
|
||||||
log('Build -> DocumentManagerScreen');
|
|
||||||
final SizedBox space = SizedBox(height: 30);
|
final SizedBox space = SizedBox(height: 30);
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
@ -478,47 +467,40 @@ class _DocumentViewScreenState extends ScreenState<DocumentViewScreen> {
|
||||||
final locale = FFLocalizations.of(context);
|
final locale = FFLocalizations.of(context);
|
||||||
|
|
||||||
backAction() => widget.bloc.events.unselectDocument();
|
backAction() => widget.bloc.events.unselectDocument();
|
||||||
infoAction() async => await showDialog(
|
infoAction() => DetailsComponentWidget(
|
||||||
useSafeArea: true,
|
buttons: [],
|
||||||
context: context,
|
statusHashMap: [],
|
||||||
builder: (context) {
|
labelsHashMap: Map<String, String>.from({
|
||||||
return Material(
|
locale.getVariableText(
|
||||||
child: DetailsComponentWidget(
|
enText: 'Description',
|
||||||
buttons: [],
|
ptText: 'Descrição',
|
||||||
statusHashMap: [],
|
): widget.doc.$1.description,
|
||||||
labelsHashMap: Map<String, String>.from({
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Type',
|
||||||
enText: 'Description',
|
ptText: 'Tipo',
|
||||||
ptText: 'Descrição',
|
): widget.doc.$1.type,
|
||||||
): widget.doc.$1.description,
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Category',
|
||||||
enText: 'Type',
|
ptText: 'Categoria',
|
||||||
ptText: 'Tipo',
|
): widget.doc.$1.category.title,
|
||||||
): widget.doc.$1.type,
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Person',
|
||||||
enText: 'Category',
|
ptText: 'Pessoa',
|
||||||
ptText: 'Categoria',
|
): widget.doc.$1.person,
|
||||||
): widget.doc.$1.category.title,
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Property',
|
||||||
enText: 'Person',
|
ptText: 'Propriedade',
|
||||||
ptText: 'Pessoa',
|
): widget.doc.$1.property,
|
||||||
): widget.doc.$1.person,
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Created At',
|
||||||
enText: 'Property',
|
ptText: 'Criado em',
|
||||||
ptText: 'Propriedade',
|
): widget.doc.$1.createdAt,
|
||||||
): widget.doc.$1.property,
|
locale.getVariableText(
|
||||||
locale.getVariableText(
|
enText: 'Updated At',
|
||||||
enText: 'Created At',
|
ptText: 'Atualizado em',
|
||||||
ptText: 'Criado em',
|
): widget.doc.$1.updatedAt,
|
||||||
): widget.doc.$1.createdAt,
|
}),
|
||||||
locale.getVariableText(
|
);
|
||||||
enText: 'Updated At',
|
|
||||||
ptText: 'Atualizado em',
|
|
||||||
): widget.doc.$1.updatedAt,
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
|
|
|
@ -74,7 +74,7 @@ class LocalsLocalDataSourceImpl implements LocalsLocalDataSource {
|
||||||
await DatabaseService.database
|
await DatabaseService.database
|
||||||
.delete(LocalsConstants.tableLocalsKeychain);
|
.delete(LocalsConstants.tableLocalsKeychain);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log('() => clearAll keychain: $e', stackTrace: s);
|
log('() => clearAll keychain: $e stackTrace: $s');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> processLocals(BuildContext context) async {
|
Future<bool> processLocals(BuildContext context) async {
|
||||||
log('() => processLocals');
|
print('-> processLocals');
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = FreAccessWSGlobal.getLocalsCall;
|
final GetLocalsCall callback = FreAccessWSGlobal.getLocalsCall;
|
||||||
final ApiCallResponse response = await callback.call();
|
final ApiCallResponse response = await callback.call();
|
||||||
|
@ -114,31 +114,30 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
} else if (isEnabled) {
|
} else if (isEnabled) {
|
||||||
return await LocalUtil.handleEnabled(context, locals[0]);
|
return await LocalUtil.handleEnabled(context, locals[0]);
|
||||||
} else if (isUnselected) {
|
} else if (isUnselected) {
|
||||||
log('() => isUnselected');
|
log('-> isUnselected');
|
||||||
return await selectLocal(context, response);
|
return await selectLocal(context, response);
|
||||||
} else if (isSelected) {
|
} else if (isSelected) {
|
||||||
log('() => isSelected');
|
log('-> isSelected');
|
||||||
return await processProperty(context).then((v) async {
|
return await processProperty(context).then((v) async {
|
||||||
if (v == true) return await LicenseRepositoryImpl().updateLicense();
|
if (v == true) return await LicenseRepositoryImpl().updateLicense();
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
} else if (isAvailable) {
|
} else if (isAvailable) {
|
||||||
log('() => isAvailable');
|
log('-> isAvailable');
|
||||||
return await processProperty(context).then((v) async {
|
return await processProperty(context).then((v) async {
|
||||||
if (v == true) return await LicenseRepositoryImpl().updateLicense();
|
if (v == true) return await LicenseRepositoryImpl().updateLicense();
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!isUnique && !isActive) log('() => not unique and not active');
|
if (!isUnique && !isActive) log('-> not unique and not active');
|
||||||
if (!isUnique && isInactived) log('() => not unique and inactived');
|
if (!isUnique && isInactived) log('-> not unique and inactived');
|
||||||
if (!isUnique && isPending) log('() => not unique and pending');
|
if (!isUnique && isPending) log('-> not unique and pending');
|
||||||
if (!isUnique && isBlocked) log('() => not unique and blocked');
|
if (!isUnique && isBlocked) log('-> not unique and blocked');
|
||||||
log('() => else');
|
log('-> else');
|
||||||
return await selectLocal(context, response);
|
return await selectLocal(context, response);
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log('() => stack: $s');
|
log('-> catch: $e', stackTrace: s);
|
||||||
log('() => catch: $e', stackTrace: s);
|
|
||||||
// return await selectLocal(context);
|
// return await selectLocal(context);
|
||||||
// final String errorMsg = FFLocalizations.of(context).getVariableText(
|
// final String errorMsg = FFLocalizations.of(context).getVariableText(
|
||||||
// enText: 'Error getting locals, verify your connection',
|
// enText: 'Error getting locals, verify your connection',
|
||||||
|
@ -189,7 +188,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log('() => error processData: $e', stackTrace: s);
|
log('-> error processData: $e', stackTrace: s);
|
||||||
// final String errorMsg = FFLocalizations.of(context).getVariableText(
|
// final String errorMsg = FFLocalizations.of(context).getVariableText(
|
||||||
// enText: 'Error getting data, verify your connection',
|
// enText: 'Error getting data, verify your connection',
|
||||||
// ptText: 'Erro ao obter dados, verifique sua conexão',
|
// ptText: 'Erro ao obter dados, verifique sua conexão',
|
||||||
|
|
|
@ -21,7 +21,7 @@ class DeepLinkService {
|
||||||
if (_isInitialized) return;
|
if (_isInitialized) return;
|
||||||
try {
|
try {
|
||||||
_appLinks = AppLinks();
|
_appLinks = AppLinks();
|
||||||
print('initDeepLinks');
|
log('initDeepLinks');
|
||||||
_linkSubscription = _appLinks.uriLinkStream.listen((uri) async {
|
_linkSubscription = _appLinks.uriLinkStream.listen((uri) async {
|
||||||
if (!StorageHelper().isRecovered) {
|
if (!StorageHelper().isRecovered) {
|
||||||
await _handleDeepLink(uri);
|
await _handleDeepLink(uri);
|
||||||
|
@ -29,25 +29,25 @@ class DeepLinkService {
|
||||||
});
|
});
|
||||||
_isInitialized = true;
|
_isInitialized = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error initializing deep links: $e');
|
log('Error initializing deep links: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleDeepLink(Uri uri) async {
|
Future<void> _handleDeepLink(Uri uri) async {
|
||||||
try {
|
try {
|
||||||
print('Handling deep link: $uri');
|
log('Handling deep link: $uri');
|
||||||
if (StorageHelper().isRecovered) return;
|
if (StorageHelper().isRecovered) return;
|
||||||
|
|
||||||
StorageHelper().isRecovered = true;
|
StorageHelper().isRecovered = true;
|
||||||
final email = uri.queryParameters['email'] ?? '';
|
final email = uri.queryParameters['email'] ?? '';
|
||||||
final token = uri.queryParameters['token'] ?? '';
|
final token = uri.queryParameters['token'] ?? '';
|
||||||
print('email: $email, token: $token');
|
log('email: $email, token: $token');
|
||||||
|
|
||||||
if (email.isNotEmpty && token.isNotEmpty) {
|
if (email.isNotEmpty && token.isNotEmpty) {
|
||||||
await _showForgotPasswordScreen(email, token);
|
await _showForgotPasswordScreen(email, token);
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} 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,
|
enableDrag: true,
|
||||||
).whenComplete(() {
|
).whenComplete(() {
|
||||||
StorageHelper().isRecovered = false;
|
StorageHelper().isRecovered = false;
|
||||||
print('showModalBottomSheet completed');
|
log('showModalBottomSheet completed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
print('Error showing forgot password screen: $e, $s');
|
log('Error showing forgot password screen: $e, $s');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/features/module/index.dart';
|
import 'package:hub/features/module/index.dart';
|
||||||
import 'package:hub/features/storage/index.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
@ -33,29 +35,29 @@ class DatabaseService {
|
||||||
onOpen: _onOpen,
|
onOpen: _onOpen,
|
||||||
onConfigure: _onConfigure,
|
onConfigure: _onConfigure,
|
||||||
);
|
);
|
||||||
print('Database initialized');
|
log('Database initialized');
|
||||||
await LicenseRepositoryImpl().updateLicense();
|
await LicenseRepositoryImpl().updateLicense();
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onConfigure(Database database) async {
|
Future<void> _onConfigure(Database database) async {
|
||||||
print('Configuring database...');
|
log('Configuring database...');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onOpen(Database database) async {
|
Future<void> _onOpen(Database database) async {
|
||||||
print('Opening database...');
|
log('Opening database...');
|
||||||
await _executePragmas(database);
|
await _executePragmas(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onCreate(Database database, int version) async {
|
Future<void> _onCreate(Database database, int version) async {
|
||||||
print('Creating database...');
|
log('Creating database...');
|
||||||
await database.execute(createKeychainTable);
|
await database.execute(createKeychainTable);
|
||||||
await _onUpgrade(database, 1, _dbVersion);
|
await _onUpgrade(database, 1, _dbVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onUpgrade(
|
Future<void> _onUpgrade(
|
||||||
Database database, int oldVersion, int newVersion) async {
|
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) {
|
if (oldVersion < 2 && newVersion >= 2) {
|
||||||
await database.execute(LicenseConstants.createLicenseTable);
|
await database.execute(LicenseConstants.createLicenseTable);
|
||||||
await database.execute(LicenseConstants.updatePetsHistoryTrigger);
|
await database.execute(LicenseConstants.updatePetsHistoryTrigger);
|
||||||
|
@ -70,7 +72,7 @@ class DatabaseService {
|
||||||
|
|
||||||
Future<void> _onDowngrade(
|
Future<void> _onDowngrade(
|
||||||
Database database, int oldVersion, int newVersion) async {
|
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) {
|
if (oldVersion >= 2 && newVersion < 2) {
|
||||||
await database.execute(LicenseConstants.deleteLicenseTable);
|
await database.execute(LicenseConstants.deleteLicenseTable);
|
||||||
await database.execute(LicenseConstants.dropPeopleDisplayTrigger);
|
await database.execute(LicenseConstants.dropPeopleDisplayTrigger);
|
||||||
|
|
|
@ -50,7 +50,7 @@ Future<Map<String, String>> stringToMap(String v) async {
|
||||||
}),
|
}),
|
||||||
));
|
));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error parsing string to map: $e');
|
log('Error parsing string to map: $e');
|
||||||
return Future.value({});
|
return Future.value({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
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';
|
||||||
|
@ -25,68 +27,68 @@ Future<void> initializeApp() async {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeTracking() async {
|
Future<void> _initializeTracking() async {
|
||||||
print('Requesting tracking authorization...');
|
log('Requesting tracking authorization...');
|
||||||
await AppTrackingTransparency.requestTrackingAuthorization();
|
await AppTrackingTransparency.requestTrackingAuthorization();
|
||||||
print('Tracking authorization requested');
|
log('Tracking authorization requested');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeFirebase() async {
|
Future<void> _initializeFirebase() async {
|
||||||
print('Initializing Firebase...');
|
log('Initializing Firebase...');
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
print('Firebase initialized');
|
log('Firebase initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeNotificationService() async {
|
Future<void> _initializeNotificationService() async {
|
||||||
print('Initializing Notification Service...');
|
log('Initializing Notification Service...');
|
||||||
await NotificationService.initialize();
|
await NotificationService.initialize();
|
||||||
print('Notification Service initialized');
|
log('Notification Service initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initializeUrlStrategy() {
|
void _initializeUrlStrategy() {
|
||||||
print('Initializing URL Strategy...');
|
log('Initializing URL Strategy...');
|
||||||
setUrlStrategy(PathUrlStrategy());
|
setUrlStrategy(PathUrlStrategy());
|
||||||
print('URL Strategy initialized');
|
log('URL Strategy initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeSystemSettings() async {
|
Future<void> _initializeSystemSettings() async {
|
||||||
print('Initializing System Settings...');
|
log('Initializing System Settings...');
|
||||||
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
final crashlyticsInstance = FirebaseCrashlytics.instance;
|
||||||
|
|
||||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print('Debug mode');
|
log('Debug mode');
|
||||||
} else {
|
} else {
|
||||||
print('Release mode');
|
log('Release mode');
|
||||||
|
|
||||||
// bool unsentReports =
|
// bool unsentReports =
|
||||||
// await FirebaseCrashlytics.instance.checkForUnsentReports();
|
// await FirebaseCrashlytics.instance.checkForUnsentReports();
|
||||||
// if (unsentReports) {
|
// if (unsentReports) {
|
||||||
// // Existem relatórios não enviados
|
// // Existem relatórios não enviados
|
||||||
// await crashlyticsInstance.sendUnsentReports();
|
// await crashlyticsInstance.sendUnsentReports();
|
||||||
// print('Existem relatórios de falhas não enviados.');
|
// log('Existem relatórios de falhas não enviados.');
|
||||||
// } else {
|
// } else {
|
||||||
// // Não existem relatórios não enviados
|
// // 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);
|
await crashlyticsInstance.setCrashlyticsCollectionEnabled(true);
|
||||||
// if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
|
// if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
|
||||||
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
FlutterError.onError = crashlyticsInstance.recordFlutterError;
|
||||||
print('Crashlytics enabled');
|
log('Crashlytics enabled');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeFlutterFlow() async {
|
Future<void> _initializeFlutterFlow() async {
|
||||||
print('Initializing FlutterFlow...');
|
log('Initializing FlutterFlow...');
|
||||||
await FlutterFlowTheme.initialize();
|
await FlutterFlowTheme.initialize();
|
||||||
await FFLocalizations.initialize();
|
await FFLocalizations.initialize();
|
||||||
print('FlutterFlow initialized');
|
log('FlutterFlow initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeNav() async {
|
Future<void> _initializeNav() async {
|
||||||
print('Initializing Nav...');
|
log('Initializing Nav...');
|
||||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||||
usePathUrlStrategy();
|
usePathUrlStrategy();
|
||||||
print('Nav initialized');
|
log('Nav initialized');
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,6 @@
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Widget buildLoadingIndicator(BuildContext context) {
|
// Widget buildLoadingIndicator(BuildContext context) {
|
||||||
// print('Loading');
|
|
||||||
// return Container(
|
// return Container(
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 15),
|
// padding: const EdgeInsets.symmetric(vertical: 15),
|
||||||
// child: Center(
|
// child: Center(
|
||||||
|
|
|
@ -434,7 +434,6 @@ class EnhancedListViewBloc<T, H, F, Q>
|
||||||
}
|
}
|
||||||
|
|
||||||
void filterBodyItems(Q query) {
|
void filterBodyItems(Q query) {
|
||||||
print('filterBodyItems Q: ${query == null}');
|
|
||||||
_$loadBodyItemsEvent.add((query: query, reset: true));
|
_$loadBodyItemsEvent.add((query: query, reset: true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,6 @@ part of 'widgets.dart';
|
||||||
// ));
|
// ));
|
||||||
// widget.pagingController.refresh();
|
// widget.pagingController.refresh();
|
||||||
// } else if (data is Document) {
|
// } else if (data is Document) {
|
||||||
// log('filter: ${data.description}');
|
|
||||||
|
|
||||||
// safeSetState(() => query = data);
|
// safeSetState(() => query = data);
|
||||||
// widget.pagingController.refresh();
|
// widget.pagingController.refresh();
|
||||||
|
|
|
@ -35,21 +35,15 @@ mixin Template {
|
||||||
if (action == null) return [];
|
if (action == null) return [];
|
||||||
return [
|
return [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async => await showDialog(
|
onPressed: () async => await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => action(),
|
||||||
title: Text('Info'),
|
),
|
||||||
content: Text('This is a sample app.'),
|
icon: Icon(
|
||||||
actions: [
|
Symbols.info_i_rounded,
|
||||||
TextButton(
|
color: Colors.black,
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
),
|
||||||
child: Text('Close'))
|
)
|
||||||
],
|
|
||||||
)),
|
|
||||||
icon: Icon(
|
|
||||||
Symbols.info_i_rounded,
|
|
||||||
color: Colors.black,
|
|
||||||
))
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue