WIP
This commit is contained in:
parent
fb91e62a25
commit
f33081a773
|
@ -12,6 +12,7 @@ import 'package:go_router/go_router.dart';
|
||||||
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart';
|
import 'package:hub/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart';
|
||||||
import 'package:hub/features/backend/api_requests/index.dart';
|
import 'package:hub/features/backend/api_requests/index.dart';
|
||||||
import 'package:hub/features/local/index.dart';
|
import 'package:hub/features/local/index.dart';
|
||||||
|
@ -25,6 +26,8 @@ import 'package:hub/flutter_flow/index.dart';
|
||||||
import 'package:hub/initialization.dart';
|
import 'package:hub/initialization.dart';
|
||||||
import 'package:hub/main.dart';
|
import 'package:hub/main.dart';
|
||||||
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
||||||
|
import 'package:hub/pages/vehicles_on_the_property/vehicle_model.dart';
|
||||||
|
import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart';
|
||||||
import 'package:integration_test/integration_test.dart';
|
import 'package:integration_test/integration_test.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:patrol/patrol.dart';
|
import 'package:patrol/patrol.dart';
|
||||||
|
@ -49,6 +52,7 @@ part 'setting_test.dart';
|
||||||
part 'storage_test.dart';
|
part 'storage_test.dart';
|
||||||
part 'utils_test.dart';
|
part 'utils_test.dart';
|
||||||
part 'welcome_test.dart';
|
part 'welcome_test.dart';
|
||||||
|
part 'vehicle_test.dart';
|
||||||
|
|
||||||
late PatrolIntegrationTester $;
|
late PatrolIntegrationTester $;
|
||||||
|
|
||||||
|
@ -76,4 +80,9 @@ void main() {
|
||||||
|
|
||||||
// LocalsTest.setLocal();
|
// LocalsTest.setLocal();
|
||||||
// LocalsTest.unlinkLocal();
|
// LocalsTest.unlinkLocal();
|
||||||
|
|
||||||
|
VehicleTest.vehiclePage();
|
||||||
|
VehicleTest.historyScreen();
|
||||||
|
VehicleTest.registerScreen();
|
||||||
|
VehicleTest.updateScreen();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
part of 'app_test.dart';
|
||||||
|
|
||||||
|
class VehicleTest {
|
||||||
|
static Future<void> vehiclePage() async {
|
||||||
|
patrol(
|
||||||
|
'Vehicle Page',
|
||||||
|
(PatrolIntegrationTester tester) async {
|
||||||
|
$ = tester;
|
||||||
|
$.tester.printToConsole('Vehicle Page');
|
||||||
|
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||||
|
|
||||||
|
await _loggedWithMultiLocalsAccount($);
|
||||||
|
await $.pumpWidgetAndSettle(const App());
|
||||||
|
|
||||||
|
ff.navigatorKey.currentContext!.go('/vehiclesOnThePropertyPage');
|
||||||
|
|
||||||
|
final String title = MenuEntry.entries //
|
||||||
|
.where((entry) => entry.key == 'FRE-HUB-VEHICLES') //
|
||||||
|
.map((entry) => entry.name)
|
||||||
|
.first;
|
||||||
|
|
||||||
|
final PatrolFinder appBar = await $(AppBar) //
|
||||||
|
.waitUntilExists();
|
||||||
|
final PatrolFinder titleAppBar = await appBar //
|
||||||
|
.$(title)
|
||||||
|
.waitUntilVisible();
|
||||||
|
expect(titleAppBar, findsOneWidget);
|
||||||
|
|
||||||
|
final PatrolFinder tab1 = await $(#TabView_Tab1) //
|
||||||
|
.waitUntilExists();
|
||||||
|
final PatrolFinder tab2 = await $(#TabView_Tab2) //
|
||||||
|
.waitUntilExists();
|
||||||
|
|
||||||
|
await tab2.tap();
|
||||||
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
|
await tab1.tap();
|
||||||
|
|
||||||
|
final PatrolFinder listViewFinder = await $(VehicleHistoryScreen) //
|
||||||
|
.$(ListView)
|
||||||
|
.waitUntilVisible();
|
||||||
|
|
||||||
|
expect(listViewFinder, findsOneWidget);
|
||||||
|
|
||||||
|
final PatrolFinder entriesFinder =
|
||||||
|
await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible();
|
||||||
|
|
||||||
|
expect(entriesFinder, findsWidgets);
|
||||||
|
final int entriesCount = entriesFinder.evaluate().length;
|
||||||
|
await $.pumpAndSettle();
|
||||||
|
|
||||||
|
for (int i = 0; i < entriesCount; i++) {
|
||||||
|
await $(entriesFinder.at(i)).scrollTo();
|
||||||
|
|
||||||
|
await $(entriesFinder.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap(
|
||||||
|
settleTimeout: const Duration(seconds: 1),
|
||||||
|
settlePolicy: SettlePolicy.noSettle,
|
||||||
|
);
|
||||||
|
|
||||||
|
await $.pumpAndSettle(duration: Duration(milliseconds: 500));
|
||||||
|
final PatrolFinder detailsFinder = await $(DetailsComponentWidget).waitUntilVisible();
|
||||||
|
expect(detailsFinder, findsOneWidget);
|
||||||
|
|
||||||
|
await $.native.pressBack().then((_) => $.pumpAndSettle());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> historyScreen() async {
|
||||||
|
patrol(
|
||||||
|
'historyScreen',
|
||||||
|
(PatrolIntegrationTester tester) async {
|
||||||
|
$ = tester;
|
||||||
|
$.tester.printToConsole('Vehicle Page');
|
||||||
|
final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget);
|
||||||
|
|
||||||
|
await _loggedWithMultiLocalsAccount($);
|
||||||
|
await $.pumpWidgetAndSettle(const App());
|
||||||
|
|
||||||
|
ff.navigatorKey.currentContext!.go('/vehiclesOnThePropertyPage');
|
||||||
|
|
||||||
|
final String title = MenuEntry.entries //
|
||||||
|
.where((entry) => entry.key == 'FRE-HUB-VEHICLES') //
|
||||||
|
.map((entry) => entry.name)
|
||||||
|
.first;
|
||||||
|
|
||||||
|
final PatrolFinder appBar = await $(AppBar) //
|
||||||
|
.waitUntilExists();
|
||||||
|
final PatrolFinder titleAppBar = await appBar //
|
||||||
|
.$(title)
|
||||||
|
.waitUntilVisible();
|
||||||
|
expect(titleAppBar, findsOneWidget);
|
||||||
|
|
||||||
|
final PatrolFinder tab2 = await $(#TabView_Tab2) //
|
||||||
|
.waitUntilExists();
|
||||||
|
|
||||||
|
await tab2.tap();
|
||||||
|
|
||||||
|
final PatrolFinder listViewFinder = await $(VehicleHistoryScreen) //
|
||||||
|
.$(ListView)
|
||||||
|
.waitUntilVisible();
|
||||||
|
|
||||||
|
expect(listViewFinder, findsOneWidget);
|
||||||
|
|
||||||
|
final PatrolFinder entriesFinder =
|
||||||
|
await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible();
|
||||||
|
|
||||||
|
expect(entriesFinder, findsWidgets);
|
||||||
|
final int entriesCount = entriesFinder.evaluate().length;
|
||||||
|
await $.pumpAndSettle();
|
||||||
|
|
||||||
|
for (int i = 0; i < entriesCount; i++) {
|
||||||
|
await $(entriesFinder.at(i)).scrollTo();
|
||||||
|
|
||||||
|
await $(entriesFinder.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap(
|
||||||
|
settleTimeout: const Duration(seconds: 1),
|
||||||
|
settlePolicy: SettlePolicy.noSettle,
|
||||||
|
);
|
||||||
|
|
||||||
|
await $.pumpAndSettle(duration: Duration(milliseconds: 500));
|
||||||
|
final PatrolFinder detailsFinder = await $(DetailsComponentWidget).waitUntilVisible();
|
||||||
|
expect(detailsFinder, findsOneWidget);
|
||||||
|
|
||||||
|
await $.native.pressBack().then((_) => $.pumpAndSettle());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> registerScreen() async {}
|
||||||
|
static Future<void> updateScreen() async {}
|
||||||
|
}
|
|
@ -41,17 +41,18 @@ 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(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily),
|
||||||
FlutterFlowTheme.of(context).titleMediumFamily),
|
|
||||||
),
|
),
|
||||||
unselectedLabelStyle: const TextStyle(),
|
unselectedLabelStyle: const TextStyle(),
|
||||||
indicatorColor: FlutterFlowTheme.of(context).primary,
|
indicatorColor: FlutterFlowTheme.of(context).primary,
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(
|
Tab(
|
||||||
|
key: ValueKey('TabView_Tab1'),
|
||||||
text: labelTab1,
|
text: labelTab1,
|
||||||
),
|
),
|
||||||
Tab(
|
Tab(
|
||||||
|
key: ValueKey('TabView_Tab2'),
|
||||||
text: labelTab2,
|
text: labelTab2,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/features/home/presentation/widgets/drawer_widget.dart';
|
import 'package:hub/features/home/presentation/widgets/drawer_widget.dart';
|
||||||
import 'package:hub/features/local/index.dart';
|
import 'package:hub/features/local/index.dart';
|
||||||
import 'package:hub/features/menu/index.dart';
|
import 'package:hub/features/menu/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -16,8 +17,7 @@ class HomePageWidget extends StatefulWidget {
|
||||||
State<HomePageWidget> createState() => _HomePageWidgetState();
|
State<HomePageWidget> createState() => _HomePageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageWidgetState extends State<HomePageWidget>
|
class _HomePageWidgetState extends State<HomePageWidget> with WidgetsBindingObserver {
|
||||||
with WidgetsBindingObserver {
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -25,6 +25,15 @@ class _HomePageWidgetState extends State<HomePageWidget>
|
||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
final email = await StorageHelper().get(SecureStorageKey.email.value);
|
||||||
|
final pass = await StorageHelper().get(SecureStorageKey.password.value);
|
||||||
|
final cli = await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
||||||
|
final owner = await StorageHelper().get(ProfileStorageKey.ownerUUID.key);
|
||||||
|
print('Email: $email');
|
||||||
|
print('Password: $pass');
|
||||||
|
print('Client: $cli');
|
||||||
|
print('Owner: $owner');
|
||||||
|
|
||||||
await LocalsRepositoryImpl().check(context);
|
await LocalsRepositoryImpl().check(context);
|
||||||
if (widget.update != null) {
|
if (widget.update != null) {
|
||||||
await widget.update!(context);
|
await widget.update!(context);
|
||||||
|
@ -97,8 +106,7 @@ class _HomePageWidgetState extends State<HomePageWidget>
|
||||||
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(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(const SizedBox(width: 8.0)),
|
].divide(const SizedBox(width: 8.0)),
|
||||||
|
|
|
@ -24,8 +24,7 @@ abstract class LocalsRemoteDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
static final LocalsRemoteDataSourceImpl _instance =
|
static final LocalsRemoteDataSourceImpl _instance = LocalsRemoteDataSourceImpl._internal();
|
||||||
LocalsRemoteDataSourceImpl._internal();
|
|
||||||
factory LocalsRemoteDataSourceImpl() => _instance;
|
factory LocalsRemoteDataSourceImpl() => _instance;
|
||||||
LocalsRemoteDataSourceImpl._internal();
|
LocalsRemoteDataSourceImpl._internal();
|
||||||
|
|
||||||
|
@ -51,8 +50,7 @@ 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 =
|
final bool isActive = locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty;
|
||||||
locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty;
|
|
||||||
final bool isEnable = !isEmpty && isActive;
|
final bool isEnable = !isEmpty && isActive;
|
||||||
|
|
||||||
if (isEnable) {
|
if (isEnable) {
|
||||||
|
@ -97,8 +95,7 @@ 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 =
|
final bool isBlocked = locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty;
|
||||||
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();
|
||||||
|
@ -151,11 +148,11 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> checkLocals(BuildContext context) async {
|
Future<bool> checkLocals(BuildContext context) async {
|
||||||
String cliUUID =
|
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
||||||
(await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
final String? cliName = await StorageHelper().get(ProfileStorageKey.clientName.key);
|
||||||
String cliName =
|
final haveCli = cliUUID != null && cliUUID.isNotEmpty;
|
||||||
(await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
final haveName = cliName != null && cliName.isNotEmpty;
|
||||||
return cliUUID.isEmpty && cliName.isEmpty;
|
return haveCli && haveName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -178,8 +175,7 @@ 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 =
|
final String errorMsg = response.jsonBody['error_msg'] ?? 'Local indisponível';
|
||||||
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 {
|
||||||
|
@ -198,8 +194,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> selectLocal(
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async {
|
||||||
BuildContext context, ApiCallResponse? response) async {
|
|
||||||
return await showModalBottomSheet(
|
return await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
@ -229,15 +224,13 @@ 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 =
|
final bool status = await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
||||||
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',
|
context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update});
|
||||||
extra: {'update': LocalsRepositoryImpl().update});
|
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,13 +49,12 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> check(BuildContext context) async {
|
Future<void> check(BuildContext context) async {
|
||||||
final String? cliUUID =
|
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
||||||
await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
final String? ownerUUID = await StorageHelper().get(ProfileStorageKey.ownerUUID.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) {
|
||||||
|
log('No client or owner selected');
|
||||||
await update(context);
|
await update(context);
|
||||||
await FirebaseMessagingService().updateDeviceToken();
|
await FirebaseMessagingService().updateDeviceToken();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +63,8 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
Future<bool> _handleLocal(BuildContext context) async {
|
Future<bool> _handleLocal(BuildContext context) async {
|
||||||
bool response = false;
|
bool response = false;
|
||||||
final bool isUnselected = await remoteDataSource.checkLocals(context);
|
final bool isUnselected = await remoteDataSource.checkLocals(context);
|
||||||
if (isUnselected) {
|
if (!isUnselected) {
|
||||||
|
log('_handleLocal -> No local selected');
|
||||||
while (!response) {
|
while (!response) {
|
||||||
try {
|
try {
|
||||||
response = await remoteDataSource.processLocals(context);
|
response = await remoteDataSource.processLocals(context);
|
||||||
|
@ -77,6 +77,7 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
log('_handleLocal -> Local selected');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export 'vehicles_on_the_property.dart';
|
||||||
|
export 'vehicle_model.dart';
|
|
@ -78,7 +78,7 @@ class _VehiclePageState extends State<VehiclePage> with TickerProviderStateMixin
|
||||||
|
|
||||||
Widget _buildBody(BuildContext context) {
|
Widget _buildBody(BuildContext context) {
|
||||||
final vehicleHistoryScreenLabel =
|
final vehicleHistoryScreenLabel =
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Consultar', enText: 'Consult');
|
FFLocalizations.of(context).getVariableText(ptText: 'Consultar', enText: 'History');
|
||||||
final vehicleRegisterScreenLabel =
|
final vehicleRegisterScreenLabel =
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register');
|
FFLocalizations.of(context).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');
|
||||||
|
|
Loading…
Reference in New Issue