193 lines
5.7 KiB
Dart
193 lines
5.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
|
import 'package:hub/commons/components/molecules/menu_list_view/model.dart';
|
|
import 'package:hub/commons/components/molecules/menu_staggered_view/model.dart';
|
|
|
|
import 'package:hub/modals/filters/selections/widget.dart';
|
|
|
|
|
|
import '/commons/widgets/flutter_flow_util.dart';
|
|
import 'widget.dart' show MenuComponentWidget;
|
|
|
|
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|
/// Local state fields for this component.
|
|
|
|
bool isGrid = false;
|
|
|
|
/// State fields for stateful widgets in this component.
|
|
|
|
// Model for menuListViewComponent.
|
|
late MenuListViewComponentModel menuListViewComponentModel;
|
|
|
|
// Model for menuStaggeredViewComponent.
|
|
late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel;
|
|
|
|
@override
|
|
void initState(BuildContext context) {
|
|
menuListViewComponentModel =
|
|
createModel(context, () => MenuListViewComponentModel());
|
|
menuStaggeredViewComponentModel =
|
|
createModel(context, () => MenuStaggeredViewComponentModel());
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
menuListViewComponentModel.dispose();
|
|
menuStaggeredViewComponentModel.dispose();
|
|
}
|
|
|
|
/// Action blocks.
|
|
Future changeMenuStyle(BuildContext context) async {
|
|
isGrid = !isGrid;
|
|
}
|
|
|
|
Future scheduleVisitOptAction(BuildContext context) async {
|
|
await showAdaptiveDialog(
|
|
context: context,
|
|
builder: (context) {
|
|
return Padding(
|
|
padding: MediaQuery.viewInsetsOf(context),
|
|
child: OptionSelectionModalWidget(
|
|
routesListStr: <String>[
|
|
'scheduleCompleteVisitPage',
|
|
'scheduleProvisionalVisitPage',
|
|
'fastPassPage',
|
|
],
|
|
iconsListIcon: <IconData>[
|
|
Icons.date_range_rounded,
|
|
Icons.date_range_rounded,
|
|
Icons.date_range_rounded,
|
|
],
|
|
nameListStr: <String>[
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Visita\nCompleta',
|
|
enText: 'Complete\nSchedule',
|
|
),
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Visita\nProvisória',
|
|
enText: 'Provisional\nSchedule',
|
|
),
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Visita\nRápida',
|
|
enText: 'Fast\nSchedule',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
Future registerVisitorOptAction(BuildContext context) async {
|
|
context.pushNamed(
|
|
'registerVisitorPage',
|
|
extra: <String, dynamic>{
|
|
kTransitionInfoKey: const TransitionInfo(
|
|
hasTransition: true,
|
|
transitionType: PageTransitionType.scale,
|
|
alignment: Alignment.bottomCenter,
|
|
),
|
|
},
|
|
);
|
|
}
|
|
|
|
Future peopleOnThePropertyAction(BuildContext context) async {
|
|
context.pushNamed(
|
|
'peopleOnThePropertyPage',
|
|
extra: <String, dynamic>{
|
|
kTransitionInfoKey: const TransitionInfo(
|
|
hasTransition: true,
|
|
transitionType: PageTransitionType.fade,
|
|
),
|
|
},
|
|
);
|
|
}
|
|
|
|
Future preferencesSettings(BuildContext context) async {
|
|
context.pushNamed(
|
|
'preferencesSettings',
|
|
extra: <String, dynamic>{
|
|
kTransitionInfoKey: const TransitionInfo(
|
|
hasTransition: true,
|
|
transitionType: PageTransitionType.scale,
|
|
alignment: Alignment.bottomCenter,
|
|
),
|
|
},
|
|
);
|
|
}
|
|
|
|
Future liberationHistoryOptAction(BuildContext context) async {
|
|
await showAdaptiveDialog(
|
|
// isScrollControlled: true,
|
|
// backgroundColor: Colors.transparent,
|
|
// enableDrag: false,
|
|
context: context,
|
|
builder: (context) {
|
|
return Padding(
|
|
padding: MediaQuery.viewInsetsOf(context),
|
|
child: OptionSelectionModalWidget(
|
|
routesListStr: <String>[
|
|
'liberationHistory',
|
|
'acessHistoryPage',
|
|
'scheduleCompleteVisitPage',
|
|
'messageHistoryPage'
|
|
],
|
|
iconsListIcon: <IconData>[
|
|
Icons.history_rounded,
|
|
Icons.history_rounded,
|
|
Icons.history_rounded,
|
|
Icons.history_rounded,
|
|
],
|
|
nameListStr: <String>[
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Histórico\nde Liberação',
|
|
enText: 'Liberation\nHistory',
|
|
),
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Histórico\nde Acesso',
|
|
enText: 'Access\nHistory',
|
|
),
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Histórico\nde Visita',
|
|
enText: 'Visit\nHistory',
|
|
),
|
|
FFLocalizations.of(context).getVariableText(
|
|
ptText: 'Histórico\nde Mensagens',
|
|
enText: 'Message\nHistory',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
Future accessQRCodeOptAction(BuildContext context) async {
|
|
context.pushNamed(
|
|
'qrCodePage',
|
|
extra: <String, dynamic>{
|
|
kTransitionInfoKey: const TransitionInfo(
|
|
hasTransition: true,
|
|
transitionType: PageTransitionType.scale,
|
|
alignment: Alignment.bottomCenter,
|
|
),
|
|
},
|
|
);
|
|
}
|
|
|
|
Future messageHistoryAction(BuildContext context) async {
|
|
context.pushNamed(
|
|
'messageHistoryPage',
|
|
extra: <String, dynamic>{
|
|
kTransitionInfoKey: const TransitionInfo(
|
|
hasTransition: true,
|
|
transitionType: PageTransitionType.scale,
|
|
alignment: Alignment.bottomCenter,
|
|
),
|
|
},
|
|
);
|
|
}
|
|
|
|
|
|
}
|