WIP
This commit is contained in:
parent
fb2344d637
commit
337a5dcb82
|
@ -57,7 +57,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(0.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
||||||
|
|
||||||
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
||||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
||||||
|
@ -53,6 +54,8 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future scheduleProvisionalVisitAction(BuildContext context) async {
|
Future scheduleProvisionalVisitAction(BuildContext context) async {
|
||||||
|
final isProvisional = AppState().provisional;
|
||||||
|
if (isProvisional) {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'scheduleProvisionalVisitPage',
|
'scheduleProvisionalVisitPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -63,9 +66,14 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
DialogUnavailable.unavailableFeature(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future fastPassAction(BuildContext context) async {
|
Future fastPassAction(BuildContext context) async {
|
||||||
|
final isWpp = AppState().whatsapp;
|
||||||
|
if (isWpp) {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'fastPassPage',
|
'fastPassPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -76,6 +84,9 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
DialogUnavailable.unavailableFeature(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future scheduleVisitOptAction(BuildContext context) async {
|
Future scheduleVisitOptAction(BuildContext context) async {
|
||||||
|
|
|
@ -138,7 +138,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.confirmation_num_outlined,
|
icon: Icons.share_location_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.fastPassAction(context);
|
await _model.fastPassAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
@ -355,7 +355,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.confirmation_num_outlined,
|
icon: Icons.share_location_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.fastPassAction(context);
|
await _model.fastPassAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
|
@ -56,20 +56,7 @@ class _MenuListViewComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return buildMenuItem(context);
|
||||||
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: [
|
|
||||||
buildMenuItem(context),
|
|
||||||
if (widget.expandable) buildExpandableButton(context),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildMenuItem(BuildContext context) {
|
Widget buildMenuItem(BuildContext context) {
|
||||||
|
@ -115,9 +102,14 @@ class _MenuListViewComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
case MenuItem.tile:
|
case MenuItem.tile:
|
||||||
|
return buildMenuList(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMenuList(BuildContext context) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height * 0.7,
|
height: MediaQuery.of(context).size.height * 0.8,
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
@ -137,7 +129,6 @@ class _MenuListViewComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row buildExpandableButton(BuildContext context) {
|
Row buildExpandableButton(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
|
|
|
@ -13,7 +13,7 @@ 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/pages/home_page/home_page_model.dart';
|
import 'package:hub/pages/home_page/home_page_model.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/widgets/drawer_widget/drawer_widget.dart';
|
import 'package:hub/shared/widgets/drawer_widget/drawer_widget.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class HomePageWidget extends StatefulWidget {
|
class HomePageWidget extends StatefulWidget {
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
|
||||||
|
export 'dialog_extensions.dart' show DialogUnavailable;
|
||||||
|
|
||||||
|
extension DialogUnavailable on DialogUtil {
|
||||||
|
static Future<dynamic> unavailableFeature(BuildContext context) {
|
||||||
|
final message = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
"Essa funcionalidade não está disponível para este local. Por favor, selecione outro local ou entre em contato com os responsáveis para alterar o plano de contrato para sua localidade.",
|
||||||
|
enText:
|
||||||
|
"This functionality is not available for this location. Please select another location or contact the responsible parties to change the contract plan for your location.");
|
||||||
|
return DialogUtil.warning(context, message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -162,9 +162,8 @@ class CustomDrawer extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Expanded _buildDrawerBody() {
|
Widget _buildDrawerBody() {
|
||||||
return Expanded(
|
return SingleChildScrollView(
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: wrapWithModel(
|
child: wrapWithModel(
|
||||||
model: model.menuComponentModel,
|
model: model.menuComponentModel,
|
||||||
updateCallback: () {},
|
updateCallback: () {},
|
||||||
|
@ -174,7 +173,6 @@ class CustomDrawer extends StatelessWidget {
|
||||||
item: MenuItem.tile,
|
item: MenuItem.tile,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue