This commit is contained in:
jantunesmesias 2024-08-23 10:13:39 -03:00
parent 040ad232da
commit d1b74a706b
4 changed files with 311 additions and 198 deletions

View File

@ -34,7 +34,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
await widget.action?.call(); await widget.action?.call();
}, },
child: Container( child: Container(
width: 100.0, width: 120.0,
height: 100.0, height: 100.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,

View File

@ -55,131 +55,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final options = () { final options = () {
if (widget.item == MenuItem.button) { if (widget.item == MenuItem.button) {
return <MenuEntry>[ if (_model.isGrid == false)
MenuButtonWidget(
icon: Icons.event,
action: () async {
await _model.scheduleCompleteVisitAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Complete\nSchedule',
ptText: 'Agenda\nCompleta',
),
),
MenuButtonWidget(
icon: Icons.perm_contact_calendar_outlined,
action: () async {
await _model.scheduleProvisionalVisitAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Provisional\nSchedule',
ptText: 'Agenda\nProvisória',
),
),
MenuButtonWidget(
icon: Icons.event_repeat,
action: () async {
await _model.fastPassAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Fast\nSchedule',
ptText: 'Agenda\nRápida',
),
),
MenuButtonWidget(
icon: FFIcons.khome,
action: () async {
await _model.registerVisitorOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Register\nVisitor',
ptText: 'Cadastro\nde Visitante',
),
),
MenuButtonWidget(
icon: Icons.qr_code,
action: () async {
await _model.accessQRCodeOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'QRCode\nAccess',
ptText: 'QRCode\nde Acesso',
),
),
MenuButtonWidget(
icon: Icons.group_add,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Poeple on\nthe Property',
ptText: 'Pessoas na\nPropriedade',
),
),
MenuButtonWidget(
icon: Icons.history_sharp,
action: () async {
await _model.liberationHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Liberations\nHistory',
ptText: 'Consultar\nLiberações',
),
),
MenuButtonWidget(
icon: Icons.key,
action: () async {
await _model.accessHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Access\nHistory',
ptText: 'Consultar\nAcessos',
),
),
MenuButtonWidget(
icon: Icons.group,
action: () async {
await _model.visitHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Visit\nHistory',
ptText: 'Consultar\nVisitas',
),
),
MenuButtonWidget(
icon: Icons.sms_outlined,
action: () async {
await _model.consultHistoriesAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Messages\nHistory',
ptText: 'Consultar\nMensagens',
),
),
MenuButtonWidget(
icon: Icons.settings,
action: () async {
await _model.preferencesSettings(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Settings',
ptText: 'Configurações',
),
),
];
}
if (widget.item == MenuItem.card) {
return <MenuEntry>[ return <MenuEntry>[
MenuButtonWidget( MenuButtonWidget(
icon: FFIcons.kvector1, icon: FFIcons.kvector1,
@ -222,7 +98,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Poeple on\nthe Property', enText: 'Poeple on\nthe Property',
ptText: 'Pessoas\nna Propriedade', ptText: 'Pessoas na\nPropriedade',
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
@ -233,7 +109,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Consult\nHistories', enText: 'Consult\nHistories',
ptText: 'Consultar\nHistoricos', ptText: 'Consultar\nHistóricos',
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
@ -243,8 +119,202 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Settings', enText: 'Preferences\nSettings',
ptText: 'Configuração', ptText: 'Preferências \nde Configurações',
),
),
];
else
return <MenuEntry>[
MenuButtonWidget(
icon: Icons.event,
action: () async {
await _model.scheduleCompleteVisitAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Complete\nSchedule',
ptText: 'Agenda\nCompleta',
),
),
MenuButtonWidget(
icon: Icons.pending_actions,
action: () async {
await _model.scheduleProvisionalVisitAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Provisional\nSchedule',
ptText: 'Agenda\nProvisória',
),
),
MenuButtonWidget(
icon: Icons.confirmation_num_outlined,
action: () async {
await _model.fastPassAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Fast\nVisit',
ptText: 'Agendar\nVisita',
),
),
MenuButtonWidget(
icon: FFIcons.khome,
action: () async {
await _model.registerVisitorOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Register\nVisitor',
ptText: 'Cadastro\nde Visitante',
),
),
MenuButtonWidget(
icon: Icons.qr_code,
action: () async {
await _model.accessQRCodeOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'QRCode\nAccess',
ptText: 'QRCode\nde Acesso',
),
),
MenuButtonWidget(
icon: Icons.groups,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Poeple on\nthe Property',
ptText: 'Pessoas na\nPropriedade',
),
),
MenuButtonWidget(
icon: Icons.group_add_outlined,
action: () async {
await _model.liberationHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Liberation\nHistory',
ptText: 'Consultar\nLiberation',
),
),
MenuButtonWidget(
icon: Icons.key_outlined,
action: () async {
await _model.accessHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Access\nHistory',
ptText: 'Consultar\nAccessos',
),
),
MenuButtonWidget(
icon: Icons.people_outline_sharp,
action: () async {
await _model.visitHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Visit\nHistory',
ptText: 'Consultar\nVisitas',
),
),
MenuButtonWidget(
icon: Icons.chat_outlined,
action: () async {
await _model.messageHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Message\nHistory',
ptText: 'Consultar\nMessages',
),
),
MenuButtonWidget(
icon: Icons.settings,
action: () async {
await _model.preferencesSettings(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Preferences\nSettings',
ptText: 'Preferências \nde Configurações',
),
),
];
}
if (widget.item == MenuItem.card) {
return <MenuEntry>[
MenuCardItem(
icon: FFIcons.kvector1,
action: () async {
await _model.scheduleVisitOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Schedule\nVisit',
ptText: 'Agendar\nVisita',
),
),
MenuCardItem(
icon: FFIcons.khome,
action: () async {
await _model.registerVisitorOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Register\nVisitor',
ptText: 'Cadastro\nde Visitante',
),
),
MenuCardItem(
icon: Icons.qr_code,
action: () async {
await _model.accessQRCodeOptAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'QRCode\nAccess',
ptText: 'QRCode\nde Acesso',
),
),
MenuCardItem(
icon: Icons.people,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Poeple on\nthe Property',
ptText: 'Pessoas\nna Propriedade',
),
),
MenuCardItem(
icon: Icons.history_sharp,
action: () async {
await _model.consultHistoriesAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Consult\nHistories',
ptText: 'Consultar\nHistoricos',
),
),
MenuCardItem(
icon: Icons.settings,
action: () async {
await _model.preferencesSettings(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Preferences\nSettings',
ptText: 'Preferências\nde Configuração',
), ),
), ),
]; ];
@ -324,8 +394,8 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Settings', enText: 'Preferences Settings',
ptText: 'Configuração', ptText: 'Preferências de Configuração',
), ),
), ),
]; ];
@ -340,10 +410,10 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
widget.item == MenuItem.button) { widget.item == MenuItem.button) {
if (_model.isGrid == true) { if (_model.isGrid == true) {
return wrapWithModel( return wrapWithModel(
model: _model.menuListViewComponentModel, model: _model.menuStaggeredViewComponentModel,
updateCallback: () => setState(() {}), updateCallback: () => setState(() {}),
updateOnChange: true, updateOnChange: true,
child: MenuListViewComponentWidget( child: MenuStaggeredViewComponentWidget(
options: options, options: options,
expandable: widget.expandable, expandable: widget.expandable,
item: widget.item, item: widget.item,
@ -351,6 +421,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
await _model.changeMenuStyle(context); await _model.changeMenuStyle(context);
setState(() {}); setState(() {});
}, },
isGrid: _model.isGrid,
), ),
); );
} else { } else {
@ -366,6 +437,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
await _model.changeMenuStyle(context); await _model.changeMenuStyle(context);
setState(() {}); setState(() {});
}, },
isGrid: _model.isGrid,
), ),
); );
} }

View File

@ -7,16 +7,17 @@ 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';
class MenuStaggeredViewComponentWidget extends StatefulWidget { class MenuStaggeredViewComponentWidget extends StatefulWidget {
const MenuStaggeredViewComponentWidget({ const MenuStaggeredViewComponentWidget(
super.key, {super.key,
required this.changeMenuStyle, required this.changeMenuStyle,
required this.expandable, required this.expandable,
required this.item, required this.item,
required this.options, required this.options,
}); required this.isGrid});
final bool expandable; final bool expandable;
final MenuItem item; final MenuItem item;
final bool isGrid;
final List<MenuEntry> options; final List<MenuEntry> options;
final Future Function()? changeMenuStyle; final Future Function()? changeMenuStyle;
@ -86,7 +87,8 @@ class _MenuStaggeredViewComponentWidgetState
); );
} }
Align collapseExpandMethod(BuildContext context) { Widget collapseExpandMethod(BuildContext context) {
if (widget.isGrid == true) {
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: Container( child: Container(
@ -138,5 +140,44 @@ class _MenuStaggeredViewComponentWidgetState
), ),
), ),
); );
} else {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
FFLocalizations.of(context).getVariableText(
enText: 'Expand',
ptText: 'Expandir',
),
style: FlutterFlowTheme.of(context).title1.override(
fontFamily: 'Nunito',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 12.0,
fontWeight: FontWeight.w600,
fontStyle: FontStyle.normal,
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: FlutterFlowIconButton(
borderColor: Colors.transparent,
borderRadius: 20.0,
borderWidth: 0.0,
buttonSize: 50.0,
fillColor: const Color(0x00FFFFFF),
icon: Icon(
Icons.keyboard_arrow_down_outlined,
color: FlutterFlowTheme.of(context).primary,
),
onPressed: () async {
await widget.changeMenuStyle?.call();
},
),
),
],
);
}
} }
} }

View File

@ -817,18 +817,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.5" version: "10.0.4"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "3.0.3"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
@ -905,10 +905,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.11.1" version: "0.8.0"
maybe_just_nothing: maybe_just_nothing:
dependency: transitive dependency: transitive
description: description:
@ -921,10 +921,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.12.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1286,10 +1286,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: sqflite_common name: sqflite_common
sha256: "7b41b6c3507854a159e24ae90a8e3e9cc01eb26a477c118d6dca065b5f55453e" sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.5.4+2" version: "2.5.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -1342,10 +1342,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.2" version: "0.7.0"
timeago: timeago:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1510,10 +1510,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.4" version: "14.2.1"
web: web:
dependency: transitive dependency: transitive
description: description:
@ -1526,10 +1526,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: webview_flutter name: webview_flutter
sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736 sha256: "6869c8786d179f929144b4a1f86e09ac0eddfe475984951ea6c634774c16b522"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.9.0" version: "4.8.0"
webview_flutter_android: webview_flutter_android:
dependency: transitive dependency: transitive
description: description:
@ -1550,10 +1550,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_wkwebview name: webview_flutter_wkwebview
sha256: "1942a12224ab31e9508cf00c0c6347b931b023b8a4f0811e5dec3b06f94f117d" sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.15.0" version: "3.14.0"
win32: win32:
dependency: "direct overridden" dependency: "direct overridden"
description: description:
@ -1595,5 +1595,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.5.0 <4.0.0" dart: ">=3.4.0 <4.0.0"
flutter: ">=3.24.0" flutter: ">=3.22.0"