WIP
This commit is contained in:
parent
a8c7897eff
commit
e209c95591
|
@ -163,10 +163,12 @@ class MenuTest {
|
|||
final PatrolFinder local = $('FRE ACCESS DEMO');
|
||||
await $(local)
|
||||
.waitUntilVisible()
|
||||
.tap(settlePolicy: SettlePolicy.trySettle);
|
||||
.tap(settlePolicy: SettlePolicy.noSettle);
|
||||
|
||||
await $.waitUntilVisible($(MenuStaggeredView));
|
||||
|
||||
///
|
||||
|
||||
final Finder gridView = find.byType(GridView);
|
||||
final Finder gridEntries = find.descendant(
|
||||
of: gridView,
|
||||
|
@ -175,15 +177,39 @@ class MenuTest {
|
|||
await $.pumpAndSettle();
|
||||
expect(gridEntries, findsWidgets);
|
||||
|
||||
final List<String?> menuKeys = gridEntries
|
||||
.evaluate()
|
||||
.map((element) {
|
||||
final key = element.widget.key;
|
||||
if (key is ValueKey<String>) {
|
||||
return key.value;
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.where((key) => key != null)
|
||||
.toList();
|
||||
final List<MenuEntry> entries = MenuEntry.entries;
|
||||
final List<String> entriesKey = entries
|
||||
.where((entry) => entry.types.contains(MenuEntryType.Home))
|
||||
.map((entry) => entry.key)
|
||||
.toList();
|
||||
await $.pumpAndSettle();
|
||||
expect(entriesKey, containsAll(menuKeys));
|
||||
|
||||
///
|
||||
|
||||
final int gridEntriesCount = gridEntries.evaluate().length;
|
||||
|
||||
for (int i = 0; i < gridEntriesCount; i++) {
|
||||
await tester.tap(gridEntries.at(i));
|
||||
await tester.pumpAndSettle();
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
await tester.tap(find.byIcon(Icons.keyboard_arrow_left));
|
||||
await tester.pumpAndSettle();
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return;
|
||||
final ButtonMenuItem entry = tester.widget
|
||||
await $(gridEntries.at(i)).waitUntilVisible().tap();
|
||||
|
||||
try {
|
||||
await $(#BackNavigationAppBar).waitUntilVisible().tap();
|
||||
// await $(Icons.keyboard_arrow_down).waitUntilVisible().tap();
|
||||
} catch (e) {
|
||||
await _navigateBackUsingSystemGesture();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -7,9 +7,11 @@ class AppBarUtil extends StatelessWidget implements PreferredSizeWidget {
|
|||
final String title;
|
||||
final VoidCallback? onBackButtonPressed;
|
||||
final Widget? actionButton;
|
||||
final Key appBarKey;
|
||||
|
||||
const AppBarUtil({
|
||||
super.key,
|
||||
required this.appBarKey,
|
||||
required this.title,
|
||||
this.onBackButtonPressed,
|
||||
this.actionButton,
|
||||
|
@ -18,6 +20,7 @@ class AppBarUtil extends StatelessWidget implements PreferredSizeWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
key: appBarKey,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
|
@ -11,18 +10,18 @@ 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_util.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
@immutable
|
||||
// ignore: must_be_immutable
|
||||
class ProvisionalHistoryPage extends StatefulWidget {
|
||||
Map<String, String> opt;
|
||||
|
||||
ProvisionalHistoryPage({super.key, Map<String, String>? opt})
|
||||
: opt = opt ?? const {'AGP_STATUS': '.*'};
|
||||
|
||||
@override
|
||||
State<ProvisionalHistoryPage> createState() => ProvisionalHistoryState(opt);
|
||||
}
|
||||
|
@ -92,6 +91,7 @@ class ProvisionalHistoryState extends State<ProvisionalHistoryPage> {
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
|
||||
import 'package:hub/features/menu/index.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
|
@ -71,6 +70,8 @@ class _AboutPropertyPageState extends State<AboutPropertyPage>
|
|||
final String title = FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Sobre a Propriedade", enText: "About the Property");
|
||||
return AppBarUtil(
|
||||
key: UniqueKey(),
|
||||
appBarKey: ValueKey<String>('BackNavigationAppBar'),
|
||||
title: title,
|
||||
onBackButtonPressed: () => context.pop(),
|
||||
);
|
||||
|
|
|
@ -36,6 +36,7 @@ class _DeliveryScheduleState extends State<DeliverySchedule> {
|
|||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -13,7 +13,6 @@ import 'package:hub/shared/utils/dialog_util.dart';
|
|||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
|
||||
class LiberationHistoryWidget extends StatefulWidget {
|
||||
|
@ -104,6 +103,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -146,6 +146,7 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
|||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -10,11 +10,9 @@ import 'package:hub/features/storage/index.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_util.dart';
|
||||
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
|
@ -145,6 +143,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -47,6 +47,7 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> {
|
|||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||
import 'package:hub/features/backend/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_theme.dart';
|
||||
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/pages/pets_page/pets_page_model.dart';
|
||||
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
|
@ -85,6 +82,7 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen>
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -76,6 +76,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
|||
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return AppBarUtil(
|
||||
key: UniqueKey(),
|
||||
appBarKey: ValueKey<String>('BackNavigationAppBar'),
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Cadastrar Pets',
|
||||
enText: 'Pets Register',
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/features/local/data/index.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_util.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PreferencesPageWidget extends StatefulWidget {
|
||||
|
@ -41,6 +38,7 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
|||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -36,6 +36,7 @@ class _ProvisionalScheduleState extends State<ProvisionalSchedule> {
|
|||
automaticallyImplyLeading: false,
|
||||
forceMaterialTransparency: true,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -472,6 +472,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
|
|||
|
||||
AppBar buildAppBar(BuildContext context) {
|
||||
return AppBar(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
leading: FlutterFlowIconButton(
|
||||
|
|
|
@ -43,6 +43,7 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
|
|||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -157,6 +157,7 @@ class _ResidentsOnThePropertyState extends State<ResidentsOnTheProperty>
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -126,6 +126,7 @@ class _ScheduleCompleteVisitPageWidgetState
|
|||
forceMaterialTransparency: true,
|
||||
elevation: 0.0,
|
||||
leading: FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -152,6 +152,7 @@ class _VehicleOnThePropertyState extends State<VehicleOnTheProperty>
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
|
@ -157,6 +157,7 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty>
|
|||
|
||||
Widget _backButton(BuildContext context, FlutterFlowTheme theme) {
|
||||
return FlutterFlowIconButton(
|
||||
key: ValueKey<String>('BackNavigationAppBar'),
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 30.0,
|
||||
borderWidth: 1.0,
|
||||
|
|
Loading…
Reference in New Issue