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,133 +55,203 @@ 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( return <MenuEntry>[
icon: Icons.event, MenuButtonWidget(
action: () async { icon: FFIcons.kvector1,
await _model.scheduleCompleteVisitAction(context); action: () async {
setState(() {}); await _model.scheduleVisitOptAction(context);
}, setState(() {});
title: FFLocalizations.of(context).getVariableText( },
enText: 'Complete\nSchedule', title: FFLocalizations.of(context).getVariableText(
ptText: 'Agenda\nCompleta', enText: 'Schedule\nVisit',
ptText: 'Agendar\nVisita',
),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: FFIcons.khome,
icon: Icons.perm_contact_calendar_outlined, action: () async {
action: () async { await _model.registerVisitorOptAction(context);
await _model.scheduleProvisionalVisitAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Register\nVisitor',
enText: 'Provisional\nSchedule', ptText: 'Cadastro\nde Visitante',
ptText: 'Agenda\nProvisória', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.qr_code,
icon: Icons.event_repeat, action: () async {
action: () async { await _model.accessQRCodeOptAction(context);
await _model.fastPassAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'QRCode\nAccess',
enText: 'Fast\nSchedule', ptText: 'QRCode\nde Acesso',
ptText: 'Agenda\nRápida', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.people,
icon: FFIcons.khome, action: () async {
action: () async { await _model.peopleOnThePropertyAction(context);
await _model.registerVisitorOptAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Poeple on\nthe Property',
enText: 'Register\nVisitor', ptText: 'Pessoas na\nPropriedade',
ptText: 'Cadastro\nde Visitante', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.history_sharp,
icon: Icons.qr_code, action: () async {
action: () async { await _model.consultHistoriesAction(context);
await _model.accessQRCodeOptAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Consult\nHistories',
enText: 'QRCode\nAccess', ptText: 'Consultar\nHistóricos',
ptText: 'QRCode\nde Acesso', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.settings,
icon: Icons.group_add, action: () async {
action: () async { await _model.preferencesSettings(context);
await _model.peopleOnThePropertyAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Preferences\nSettings',
enText: 'Poeple on\nthe Property', ptText: 'Preferências \nde Configurações',
ptText: 'Pessoas na\nPropriedade', ),
), ),
), ];
MenuButtonWidget( else
icon: Icons.history_sharp, return <MenuEntry>[
action: () async { MenuButtonWidget(
await _model.liberationHistoryAction(context); icon: Icons.event,
setState(() {}); action: () async {
}, await _model.scheduleCompleteVisitAction(context);
title: FFLocalizations.of(context).getVariableText( setState(() {});
enText: 'Liberations\nHistory', },
ptText: 'Consultar\nLiberações', title: FFLocalizations.of(context).getVariableText(
enText: 'Complete\nSchedule',
ptText: 'Agenda\nCompleta',
),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.pending_actions,
icon: Icons.key, action: () async {
action: () async { await _model.scheduleProvisionalVisitAction(context);
await _model.accessHistoryAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Provisional\nSchedule',
enText: 'Access\nHistory', ptText: 'Agenda\nProvisória',
ptText: 'Consultar\nAcessos', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.confirmation_num_outlined,
icon: Icons.group, action: () async {
action: () async { await _model.fastPassAction(context);
await _model.visitHistoryAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Fast\nVisit',
enText: 'Visit\nHistory', ptText: 'Agendar\nVisita',
ptText: 'Consultar\nVisitas', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: FFIcons.khome,
icon: Icons.sms_outlined, action: () async {
action: () async { await _model.registerVisitorOptAction(context);
await _model.consultHistoriesAction(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'Register\nVisitor',
enText: 'Messages\nHistory', ptText: 'Cadastro\nde Visitante',
ptText: 'Consultar\nMensagens', ),
), ),
), MenuButtonWidget(
MenuButtonWidget( icon: Icons.qr_code,
icon: Icons.settings, action: () async {
action: () async { await _model.accessQRCodeOptAction(context);
await _model.preferencesSettings(context); setState(() {});
setState(() {}); },
}, title: FFLocalizations.of(context).getVariableText(
title: FFLocalizations.of(context).getVariableText( enText: 'QRCode\nAccess',
enText: 'Settings', ptText: 'QRCode\nde Acesso',
ptText: 'Configurações', ),
), ),
), 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) { if (widget.item == MenuItem.card) {
return <MenuEntry>[ return <MenuEntry>[
MenuButtonWidget( MenuCardItem(
icon: FFIcons.kvector1, icon: FFIcons.kvector1,
action: () async { action: () async {
await _model.scheduleVisitOptAction(context); await _model.scheduleVisitOptAction(context);
@ -192,7 +262,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Agendar\nVisita', ptText: 'Agendar\nVisita',
), ),
), ),
MenuButtonWidget( MenuCardItem(
icon: FFIcons.khome, icon: FFIcons.khome,
action: () async { action: () async {
await _model.registerVisitorOptAction(context); await _model.registerVisitorOptAction(context);
@ -203,7 +273,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Cadastro\nde Visitante', ptText: 'Cadastro\nde Visitante',
), ),
), ),
MenuButtonWidget( MenuCardItem(
icon: Icons.qr_code, icon: Icons.qr_code,
action: () async { action: () async {
await _model.accessQRCodeOptAction(context); await _model.accessQRCodeOptAction(context);
@ -214,7 +284,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'QRCode\nde Acesso', ptText: 'QRCode\nde Acesso',
), ),
), ),
MenuButtonWidget( MenuCardItem(
icon: Icons.people, icon: Icons.people,
action: () async { action: () async {
await _model.peopleOnThePropertyAction(context); await _model.peopleOnThePropertyAction(context);
@ -225,7 +295,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Pessoas\nna Propriedade', ptText: 'Pessoas\nna Propriedade',
), ),
), ),
MenuButtonWidget( MenuCardItem(
icon: Icons.history_sharp, icon: Icons.history_sharp,
action: () async { action: () async {
await _model.consultHistoriesAction(context); await _model.consultHistoriesAction(context);
@ -236,15 +306,15 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Consultar\nHistoricos', ptText: 'Consultar\nHistoricos',
), ),
), ),
MenuButtonWidget( MenuCardItem(
icon: Icons.settings, icon: Icons.settings,
action: () async { action: () async {
await _model.preferencesSettings(context); await _model.preferencesSettings(context);
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çã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,57 +87,97 @@ class _MenuStaggeredViewComponentWidgetState
); );
} }
Align collapseExpandMethod(BuildContext context) { Widget collapseExpandMethod(BuildContext context) {
return Align( if (widget.isGrid == true) {
alignment: const AlignmentDirectional(0.0, 0.0), return Align(
child: Container( alignment: const AlignmentDirectional(0.0, 0.0),
decoration: const BoxDecoration( child: Container(
borderRadius: BorderRadius.only( decoration: const BoxDecoration(
bottomLeft: Radius.circular(0.0), borderRadius: BorderRadius.only(
bottomRight: Radius.circular(0.0), bottomLeft: Radius.circular(0.0),
topLeft: Radius.circular(0.0), bottomRight: Radius.circular(0.0),
topRight: Radius.circular(0.0), topLeft: Radius.circular(0.0),
topRight: Radius.circular(0.0),
),
),
alignment: const AlignmentDirectional(0.0, 0.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
FFLocalizations.of(context).getVariableText(
enText: 'Minimize',
ptText: 'Minimizar',
),
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: 1.0,
buttonSize: 50.0,
fillColor: const Color(0x00FFFFFF),
icon: Icon(
Icons.keyboard_arrow_up_sharp,
color: FlutterFlowTheme.of(context).primary,
),
onPressed: () async {
await widget.changeMenuStyle?.call();
},
),
),
],
), ),
), ),
alignment: const AlignmentDirectional(0.0, 0.0), );
child: Row( } else {
crossAxisAlignment: CrossAxisAlignment.center, return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Text( children: [
FFLocalizations.of(context).getVariableText( Text(
enText: 'Minimize', FFLocalizations.of(context).getVariableText(
ptText: 'Minimizar', 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( style: FlutterFlowTheme.of(context).title1.override(
alignment: const AlignmentDirectional(0.0, 0.0), fontFamily: 'Nunito',
child: FlutterFlowIconButton( color: FlutterFlowTheme.of(context).primaryText,
borderColor: Colors.transparent, fontSize: 12.0,
borderRadius: 20.0, fontWeight: FontWeight.w600,
borderWidth: 1.0, fontStyle: FontStyle.normal,
buttonSize: 50.0,
fillColor: const Color(0x00FFFFFF),
icon: Icon(
Icons.keyboard_arrow_up_sharp,
color: FlutterFlowTheme.of(context).primary,
), ),
onPressed: () async { ),
await widget.changeMenuStyle?.call(); 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"