WIP
This commit is contained in:
parent
fdcc3d9c33
commit
98dc243aa2
|
@ -39,6 +39,45 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
isGrid = !isGrid;
|
isGrid = !isGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future scheduleCompleteVisitAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'scheduleCompleteVisitPage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future scheduleProvisionalVisitAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'scheduleProvisionalVisitPage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future fastPassAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'fastPassPage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future scheduleVisitOptAction(BuildContext context) async {
|
Future scheduleVisitOptAction(BuildContext context) async {
|
||||||
final isWpp = AppState().whatsapp;
|
final isWpp = AppState().whatsapp;
|
||||||
final isProvisional = AppState().provisional;
|
final isProvisional = AppState().provisional;
|
||||||
|
@ -147,7 +186,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
).then((value) => true);
|
).then((value) => true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future liberationHistoryOptAction(BuildContext context) async {
|
Future consultHistoriesAction(BuildContext context) async {
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
// isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
// backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
|
@ -193,6 +232,45 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future liberationHistoryAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'liberationHistory',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future accessHistoryAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'acessHistoryPage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future visitHistoryAction(BuildContext context) async {
|
||||||
|
context.pushNamed(
|
||||||
|
'scheduleCompleteVisitPage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future accessQRCodeOptAction(BuildContext context) async {
|
Future accessQRCodeOptAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'qrCodePage',
|
'qrCodePage',
|
||||||
|
|
|
@ -57,14 +57,36 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
if (widget.item == MenuItem.button) {
|
if (widget.item == MenuItem.button) {
|
||||||
return <MenuEntry>[
|
return <MenuEntry>[
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.kvector1,
|
icon: Icons.event,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.scheduleVisitOptAction(context);
|
await _model.scheduleCompleteVisitAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Schedule\nVisit',
|
enText: 'Complete\nSchedule',
|
||||||
ptText: 'Agendar\nVisita',
|
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(
|
MenuButtonWidget(
|
||||||
|
@ -90,7 +112,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.people,
|
icon: Icons.group_add,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.peopleOnThePropertyAction(context);
|
await _model.peopleOnThePropertyAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
@ -103,12 +125,45 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.history_sharp,
|
icon: Icons.history_sharp,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.liberationHistoryOptAction(context);
|
await _model.liberationHistoryAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Consult\nHistories',
|
enText: 'Liberations\nHistory',
|
||||||
ptText: 'Consultar\nHistóricos',
|
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(
|
MenuButtonWidget(
|
||||||
|
@ -126,7 +181,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
if (widget.item == MenuItem.card) {
|
if (widget.item == MenuItem.card) {
|
||||||
return <MenuEntry>[
|
return <MenuEntry>[
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.kvector1,
|
icon: FFIcons.kvector1,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.scheduleVisitOptAction(context);
|
await _model.scheduleVisitOptAction(context);
|
||||||
|
@ -137,7 +192,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Agendar\nVisita',
|
ptText: 'Agendar\nVisita',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.khome,
|
icon: FFIcons.khome,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.registerVisitorOptAction(context);
|
await _model.registerVisitorOptAction(context);
|
||||||
|
@ -148,7 +203,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Cadastro\nde Visitante',
|
ptText: 'Cadastro\nde Visitante',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: Icons.qr_code,
|
icon: Icons.qr_code,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.accessQRCodeOptAction(context);
|
await _model.accessQRCodeOptAction(context);
|
||||||
|
@ -159,7 +214,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'QRCode\nde Acesso',
|
ptText: 'QRCode\nde Acesso',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: Icons.people,
|
icon: Icons.people,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.peopleOnThePropertyAction(context);
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
@ -170,10 +225,10 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Pessoas\nna Propriedade',
|
ptText: 'Pessoas\nna Propriedade',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: Icons.history_sharp,
|
icon: Icons.history_sharp,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.liberationHistoryOptAction(context);
|
await _model.consultHistoriesAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -181,7 +236,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Consultar\nHistoricos',
|
ptText: 'Consultar\nHistoricos',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuButtonWidget(
|
||||||
icon: Icons.settings,
|
icon: Icons.settings,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.preferencesSettings(context);
|
await _model.preferencesSettings(context);
|
||||||
|
@ -243,7 +298,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.history_sharp,
|
icon: Icons.history_sharp,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.liberationHistoryOptAction(context);
|
await _model.consultHistoriesAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
|
||||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/backend/schema/enums/enums.dart';
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/custom_icons.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_model.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';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
||||||
const MenuStaggeredViewComponentWidget({
|
const MenuStaggeredViewComponentWidget({
|
||||||
|
@ -58,97 +51,92 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return Column(
|
||||||
spacing: 0.0,
|
|
||||||
runSpacing: 0.0,
|
|
||||||
alignment: WrapAlignment.start,
|
|
||||||
crossAxisAlignment: WrapCrossAlignment.start,
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
runAlignment: WrapAlignment.start,
|
|
||||||
verticalDirection: VerticalDirection.down,
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
GridView.builder(
|
||||||
width: double.infinity,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
height: MediaQuery.sizeOf(context).height * 0.498,
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
decoration: const BoxDecoration(),
|
crossAxisCount: 3,
|
||||||
child: Padding(
|
crossAxisSpacing: 10.0,
|
||||||
padding: const EdgeInsets.all(14.0),
|
mainAxisSpacing: 10.0,
|
||||||
child: MasonryGridView.builder(
|
),
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
itemCount: widget.options.length,
|
||||||
gridDelegate:
|
padding: const EdgeInsets.all(14),
|
||||||
const SliverSimpleGridDelegateWithFixedCrossAxisCount(
|
shrinkWrap: true,
|
||||||
crossAxisCount: 3,
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
height: 100,
|
||||||
|
width: 100,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
color: Colors.transparent,
|
||||||
|
boxShadow: const [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.transparent,
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
crossAxisSpacing: 10.0,
|
child: Center(child: widget.options[index]),
|
||||||
mainAxisSpacing: 10.0,
|
);
|
||||||
itemCount: widget.options.length,
|
},
|
||||||
padding: const EdgeInsets.fromLTRB(
|
),
|
||||||
0,
|
].addToEnd(collapseExpandMethod(context)),
|
||||||
10.0,
|
);
|
||||||
0,
|
}
|
||||||
10.0,
|
|
||||||
),
|
Align collapseExpandMethod(BuildContext context) {
|
||||||
shrinkWrap: true,
|
return Align(
|
||||||
itemBuilder: (context, index) {
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
return SizedBox(
|
child: Container(
|
||||||
height: 100, width: 100, child: widget.options[index]);
|
decoration: const BoxDecoration(
|
||||||
},
|
borderRadius: BorderRadius.only(
|
||||||
),
|
bottomLeft: Radius.circular(0.0),
|
||||||
|
bottomRight: Radius.circular(0.0),
|
||||||
|
topLeft: Radius.circular(0.0),
|
||||||
|
topRight: Radius.circular(0.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
child: Row(
|
||||||
child: Container(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
decoration: const BoxDecoration(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
borderRadius: BorderRadius.only(
|
mainAxisSize: MainAxisSize.max,
|
||||||
bottomLeft: Radius.circular(0.0),
|
children: [
|
||||||
bottomRight: Radius.circular(0.0),
|
Text(
|
||||||
topLeft: Radius.circular(0.0),
|
FFLocalizations.of(context).getVariableText(
|
||||||
topRight: Radius.circular(0.0),
|
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(
|
|
||||||
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();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue