WIP
This commit is contained in:
parent
bb6e6e4861
commit
54fcab5c16
|
@ -32,6 +32,7 @@ analyzer:
|
||||||
errors:
|
errors:
|
||||||
curly_braces_in_flow_control_structures: ignore
|
curly_braces_in_flow_control_structures: ignore
|
||||||
use_build_context_synchronously: ignore
|
use_build_context_synchronously: ignore
|
||||||
|
invalid_annotation_target: ignore
|
||||||
exclude:
|
exclude:
|
||||||
- lib/custom_code/**
|
- lib/custom_code/**
|
||||||
- lib/flutter_flow/custom_functions.dart
|
- lib/flutter_flow/custom_functions.dart
|
||||||
|
|
|
@ -5,18 +5,6 @@ enum AppHeaderComponent {
|
||||||
home,
|
home,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MenuView {
|
|
||||||
list_grid,
|
|
||||||
list,
|
|
||||||
grid,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum MenuItem {
|
|
||||||
button,
|
|
||||||
card,
|
|
||||||
tile,
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FFEnumExtensions<T extends Enum> on T {
|
extension FFEnumExtensions<T extends Enum> on T {
|
||||||
String serialize() => name;
|
String serialize() => name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
enum MenuOption {
|
|
||||||
CompleteSchedule,
|
|
||||||
DeliverySchedule,
|
|
||||||
WorkersOnTheProperty,
|
|
||||||
FastPassSchedule,
|
|
||||||
QRCodeAccessInProperty,
|
|
||||||
AccessOnTheProperty,
|
|
||||||
LiberationsOnTheProperty,
|
|
||||||
MessagesOnTheProperty,
|
|
||||||
ReservationsOnTheLocal,
|
|
||||||
PackagesOnTheProperty,
|
|
||||||
VehiclesOnTheProperty,
|
|
||||||
PetsOnTheProperty,
|
|
||||||
PetsRegister,
|
|
||||||
VisitorsRegister,
|
|
||||||
VisitsOnTheProperty,
|
|
||||||
ResidentsOnTheProperty,
|
|
||||||
SettingsOnTheApp,
|
|
||||||
AboutProperty,
|
|
||||||
LogoutOnTheApp,
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class MenuEntry extends StatefulWidget {
|
|
||||||
const MenuEntry({
|
|
||||||
super.key,
|
|
||||||
required this.action,
|
|
||||||
required this.title,
|
|
||||||
required this.icon,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Function() action;
|
|
||||||
final String title;
|
|
||||||
final IconData icon;
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
import 'package:hub/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_bloc.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import 'package:hub/shared/helpers/license/license_helper.dart';
|
|
||||||
import 'package:hub/shared/services/license/license_service.dart';
|
|
||||||
|
|
||||||
class MenuComponentWidget extends StatelessWidget {
|
|
||||||
final MenuView style;
|
|
||||||
final MenuItem item;
|
|
||||||
final bool expandable;
|
|
||||||
final List<Module> menuOptions;
|
|
||||||
|
|
||||||
const MenuComponentWidget({
|
|
||||||
super.key,
|
|
||||||
required this.style,
|
|
||||||
required this.item,
|
|
||||||
required this.expandable,
|
|
||||||
required this.menuOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return StreamBuilder<List<dynamic>>(
|
|
||||||
stream: LicenseService().licenseStream,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return const Center(
|
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
);
|
|
||||||
} else if (snapshot.hasError) {
|
|
||||||
return Center(
|
|
||||||
child: Text('Error: ${snapshot.error}'),
|
|
||||||
);
|
|
||||||
} else if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
|
||||||
return Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 10),
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
backgroundColor: FlutterFlowTheme.of(key.currentContext!).primaryBackground,
|
|
||||||
color: FlutterFlowTheme.of(key.currentContext!).primary),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return BlocProvider(
|
|
||||||
create: (context) => MenuBloc(
|
|
||||||
style: style,
|
|
||||||
item: item,
|
|
||||||
expandable: expandable,
|
|
||||||
menuOptions: menuOptions,
|
|
||||||
)..add(MenuEvent()),
|
|
||||||
child: BlocBuilder<MenuBloc, MenuState>(
|
|
||||||
builder: (context, state) {
|
|
||||||
if (style == MenuView.list_grid) {
|
|
||||||
return MenuStaggeredViewComponentWidget(
|
|
||||||
options: state.menuEntries,
|
|
||||||
expandable: expandable,
|
|
||||||
item: item,
|
|
||||||
changeMenuStyle: () async {},
|
|
||||||
isGrid: state.isGrid,
|
|
||||||
);
|
|
||||||
} else if (style == MenuView.list) {
|
|
||||||
return MenuListViewComponentWidget(
|
|
||||||
options: state.menuEntries,
|
|
||||||
expandable: expandable,
|
|
||||||
item: item,
|
|
||||||
changeMenuStyle: () async {},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return const SizedBox();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class MenuListViewComponentModel extends FlutterFlowModel<MenuListViewComponentWidget> {
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentModel extends FlutterFlowModel<MenuStaggeredViewComponentWidget> {
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,193 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.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/flutter_flow/flutter_flow_icon_button.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
|
||||||
const MenuStaggeredViewComponentWidget(
|
|
||||||
{super.key,
|
|
||||||
required this.changeMenuStyle,
|
|
||||||
required this.expandable,
|
|
||||||
required this.item,
|
|
||||||
required this.options,
|
|
||||||
required this.isGrid});
|
|
||||||
|
|
||||||
final bool expandable;
|
|
||||||
final MenuItem item;
|
|
||||||
final bool isGrid;
|
|
||||||
|
|
||||||
final List<MenuEntry?> options;
|
|
||||||
final Future Function()? changeMenuStyle;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MenuStaggeredViewComponentWidget> createState() => _MenuStaggeredViewComponentWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MenuStaggeredViewComponentWidgetState extends State<MenuStaggeredViewComponentWidget> {
|
|
||||||
late MenuStaggeredViewComponentModel _model;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
_model.onUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_model = createModel(context, () => MenuStaggeredViewComponentModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.maybeDispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final textScaler = MediaQuery.textScalerOf(context);
|
|
||||||
final double scaledFontSize = 14 * textScaler.scale(1);
|
|
||||||
final int crossAxisCount = scaledFontSize >= 26
|
|
||||||
? 1
|
|
||||||
: scaledFontSize >= 18
|
|
||||||
? 2
|
|
||||||
: 3;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
GridView.builder(
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: crossAxisCount,
|
|
||||||
crossAxisSpacing: 10.0,
|
|
||||||
mainAxisSpacing: 10.0,
|
|
||||||
childAspectRatio: 1,
|
|
||||||
mainAxisExtent: 100,
|
|
||||||
),
|
|
||||||
itemCount: widget.options.length,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Container(
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(0),
|
|
||||||
color: Colors.transparent,
|
|
||||||
boxShadow: const [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.transparent,
|
|
||||||
blurRadius: 4,
|
|
||||||
offset: Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Center(child: widget.options[index]),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
].addToStart(const SizedBox(height: 30)).addToEnd(const SizedBox(height: 30)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget collapseExpandMethod(BuildContext context) {
|
|
||||||
if (widget.isGrid == true) {
|
|
||||||
return Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} 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();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
import 'package:hub/shared/components/atoms/term_of_use/atom_terms_of_use.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -215,8 +215,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -263,12 +262,10 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
validator:
|
validator: _model.emailAddressTextControllerValidator.asValidator(context),
|
||||||
_model.emailAddressTextControllerValidator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -281,27 +278,23 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
controller: _model.passwordTextController,
|
controller: _model.passwordTextController,
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
focusNode: _model.passwordFocusNode,
|
focusNode: _model.passwordFocusNode,
|
||||||
onChanged: (_) => EasyDebounce.debounce('_model.passwordTextController',
|
onChanged: (_) => EasyDebounce.debounce('_model.passwordTextController', const Duration(milliseconds: 500), () => setState(() {})),
|
||||||
const Duration(milliseconds: 500), () => setState(() {})),
|
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
autofillHints: const [AutofillHints.password],
|
autofillHints: const [AutofillHints.password],
|
||||||
textInputAction: TextInputAction.send,
|
textInputAction: TextInputAction.send,
|
||||||
obscureText: !_model.passwordVisibility,
|
obscureText: !_model.passwordVisibility,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
||||||
FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).customColor1, width: 0.25),
|
||||||
color: FlutterFlowTheme.of(context).customColor1, width: 0.25),
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
|
@ -310,9 +303,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), borderRadius: BorderRadius.circular(12.0)),
|
||||||
const BorderSide(color: Color(0xFF1AAB5F), width: 0.25),
|
|
||||||
borderRadius: BorderRadius.circular(12.0)),
|
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -324,15 +315,10 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
onTap: () => setState(
|
onTap: () => setState(() => _model.passwordVisibility = !_model.passwordVisibility),
|
||||||
() => _model.passwordVisibility = !_model.passwordVisibility),
|
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(_model.passwordVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
_model.passwordVisibility
|
color: FlutterFlowTheme.of(context).accent1, size: 24.0),
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
size: 24.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
|
@ -341,8 +327,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.passwordTextControllerValidator.asValidator(context),
|
validator: _model.passwordTextControllerValidator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
@ -377,8 +362,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -386,8 +370,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -409,8 +392,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).customColor1,
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -418,8 +400,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
|
@ -453,22 +434,15 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
await DialogUtil.errorDefault(context);
|
await DialogUtil.errorDefault(context);
|
||||||
LogUtil.requestAPIFailed(
|
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s);
|
||||||
'login.php',
|
|
||||||
_model.emailAddressTextController.text,
|
|
||||||
"Login",
|
|
||||||
e,
|
|
||||||
s);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText('1x926nsn'),
|
text: FFLocalizations.of(context).getText('1x926nsn'),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -476,8 +450,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
@ -497,15 +470,12 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('toggleSignUpPage'),
|
key: const ValueKey<String>('toggleSignUpPage'),
|
||||||
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */),
|
||||||
.getText('jwvd4ai1' /* Cadastrar */),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).customColor1,
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -513,8 +483,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
@ -565,16 +534,14 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */),
|
||||||
.getText('p5c6d54y' /* Recupere aqui */),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
mouseCursor: SystemMouseCursors.click,
|
mouseCursor: SystemMouseCursors.click,
|
||||||
)
|
)
|
||||||
|
@ -582,8 +549,7 @@ class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentW
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize),
|
fontSize: limitedInputFontSize),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
import 'package:hub/shared/components/atoms/term_of_use/atom_terms_of_use.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
@ -111,9 +111,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
|
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
|
||||||
|
|
||||||
bool isFormInvalid() {
|
bool isFormInvalid() {
|
||||||
if (_model.nameRegisterFormTextController.text == '' ||
|
if (_model.nameRegisterFormTextController.text == '' || _model.emailRegisterFormTextController.text == '' || _model.passwordRegisterFormTextController.text == '') {
|
||||||
_model.emailRegisterFormTextController.text == '' ||
|
|
||||||
_model.passwordRegisterFormTextController.text == '') {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,8 +238,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -292,11 +289,9 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.nameRegisterFormTextControllerValidator
|
validator: _model.nameRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -327,8 +322,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -379,12 +373,10 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
validator: _model.emailRegisterFormTextControllerValidator
|
validator: _model.emailRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -415,8 +407,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -458,14 +449,11 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
||||||
onTap: () => setState(
|
onTap: () => setState(
|
||||||
() => _model.passwordRegisterFormVisibility =
|
() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility,
|
||||||
!_model.passwordRegisterFormVisibility,
|
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_model.passwordRegisterFormVisibility
|
_model.passwordRegisterFormVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
|
@ -477,11 +465,9 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model.passwordRegisterFormTextControllerValidator
|
validator: _model.passwordRegisterFormTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -575,16 +561,14 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
|
class DeadCode {
|
||||||
|
final String? desc;
|
||||||
|
|
||||||
|
const DeadCode([this.desc = '']);
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'pages/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -2,16 +2,14 @@ import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/features/home/index.dart';
|
||||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart';
|
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.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_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/shared/helpers/license/license_helper.dart';
|
import 'package:hub/shared/components/molecules/drawer/index.dart';
|
||||||
import 'package:hub/shared/widgets/drawer_widget/drawer_widget.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
import 'index.dart';
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
class HomePageWidget extends StatefulWidget {
|
class HomePageWidget extends StatefulWidget {
|
||||||
const HomePageWidget({super.key});
|
const HomePageWidget({super.key});
|
||||||
|
@ -122,11 +120,10 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 40),
|
padding: const EdgeInsets.only(bottom: 40),
|
||||||
child: MenuComponentWidget(
|
child: MenuFactory(
|
||||||
expandable: true,
|
menuEntry: MenuEntries.home,
|
||||||
style: MenuView.list_grid,
|
menuItem: MenuItem.button,
|
||||||
item: MenuItem.button,
|
menuView: MenuView.list_grid,
|
||||||
menuOptions: Module.values.where((e) => e != Module.logout).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
export 'home_page.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'pages/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -2,36 +2,29 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/backend/schema/enums/enums.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.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/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/about_property_page/about_property_model.dart';
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
import 'package:hub/shared/helpers/license/license_helper.dart';
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
enum AboutPropertyModules {
|
class AboutPropertyModel extends FlutterFlowModel<AboutPropertyPage> {
|
||||||
residents,
|
dynamic item;
|
||||||
vehicles,
|
|
||||||
openedVisits,
|
VoidCallback? safeSetState;
|
||||||
petsHistory,
|
|
||||||
|
Future<void> initAsync() async {
|
||||||
|
safeSetState?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AboutPropertyModulesExtension on AboutPropertyModules {
|
@override
|
||||||
String get value {
|
void initState(BuildContext context) {
|
||||||
switch (this) {
|
initAsync();
|
||||||
case AboutPropertyModules.openedVisits:
|
|
||||||
return 'FRE-HUB-OPENED-VISITS';
|
|
||||||
case AboutPropertyModules.vehicles:
|
|
||||||
return 'FRE-HUB-VEHICLES';
|
|
||||||
case AboutPropertyModules.residents:
|
|
||||||
return 'FRE-HUB-RESIDENTS';
|
|
||||||
case AboutPropertyModules.petsHistory:
|
|
||||||
return 'FRE-HUB-PETS';
|
|
||||||
default:
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
|
@ -84,13 +77,11 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> with SingleTicker
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: MenuComponentWidget(expandable: true, style: MenuView.list_grid, item: MenuItem.button, menuOptions: [
|
child: MenuFactory(
|
||||||
Module.petsHistory,
|
menuEntry: MenuEntries.AboutProperty,
|
||||||
Module.residents,
|
menuItem: MenuItem.button,
|
||||||
Module.openedVisits,
|
menuView: MenuView.list_grid,
|
||||||
Module.vehicles,
|
),
|
||||||
Module.orders,
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export 'about_property_screen.dart';
|
|
@ -4,14 +4,14 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/schema/util/schema_util.dart';
|
import 'package:hub/backend/schema/util/schema_util.dart';
|
||||||
|
import 'package:hub/features/home/index.dart';
|
||||||
|
import 'package:hub/features/property/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/about_property_page/about_property_screen.dart';
|
|
||||||
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart';
|
||||||
import 'package:hub/pages/delivery_schedule_page/delivery_schedule_widget.dart';
|
import 'package:hub/pages/delivery_schedule_page/delivery_schedule_widget.dart';
|
||||||
import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart';
|
import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart';
|
||||||
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
||||||
import 'package:hub/pages/home_page/home_page.dart';
|
|
||||||
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
import 'package:hub/pages/liberation_history/liberation_history_widget.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
import 'package:hub/pages/package_order_page/package_order_page.dart';
|
import 'package:hub/pages/package_order_page/package_order_page.dart';
|
||||||
|
@ -41,7 +41,7 @@ export 'serialization_util.dart';
|
||||||
|
|
||||||
const kTransitionInfoKey = '__transition_info__';
|
const kTransitionInfoKey = '__transition_info__';
|
||||||
|
|
||||||
final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
class AppStateNotifier extends ChangeNotifier {
|
class AppStateNotifier extends ChangeNotifier {
|
||||||
AppStateNotifier._();
|
AppStateNotifier._();
|
||||||
|
@ -59,7 +59,7 @@ class AppStateNotifier extends ChangeNotifier {
|
||||||
|
|
||||||
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
navigatorKey: key,
|
navigatorKey: navigatorKey,
|
||||||
initialLocation: '/',
|
initialLocation: '/',
|
||||||
debugLogDiagnostics: true,
|
debugLogDiagnostics: true,
|
||||||
redirect: (context, state) {
|
redirect: (context, state) {
|
||||||
|
@ -135,6 +135,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => PreferencesPageWidget()),
|
FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => PreferencesPageWidget()),
|
||||||
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()),
|
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()),
|
||||||
FFRoute(name: 'residentsOnThePropertyPage', path: '/residentsOnThePropertyPage', builder: (context, params) => ResidentsOnTheProperty()),
|
FFRoute(name: 'residentsOnThePropertyPage', path: '/residentsOnThePropertyPage', builder: (context, params) => ResidentsOnTheProperty()),
|
||||||
|
FFRoute(name: 'visitsOnThePropertyPage', path: '/visitsOnThePropertyPage', builder: (context, params) => VisitsOnTheProperty()),
|
||||||
FFRoute(name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => PeopleOnThePropertyPage()),
|
FFRoute(name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => PeopleOnThePropertyPage()),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'acessHistoryPage',
|
name: 'acessHistoryPage',
|
||||||
|
|
|
@ -1,11 +1 @@
|
||||||
export 'pages/acess_history_page/acess_history_page_widget.dart' show AccessHistoryScreen;
|
|
||||||
export 'pages/home_page/home_page.dart' show HomePageWidget;
|
|
||||||
export 'pages/liberation_history/liberation_history_widget.dart' show LiberationHistoryWidget;
|
|
||||||
export 'pages/people_on_the_property_page/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPage;
|
|
||||||
export 'pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget;
|
|
||||||
export 'pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget;
|
|
||||||
export 'pages/register_visitor_page/register_visitor_page_widget.dart' show RegisterVisitorPageWidget;
|
|
||||||
export 'pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart' show ScheduleCompleteVisitPageWidget;
|
|
||||||
export 'pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget;
|
|
||||||
export 'pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget;
|
|
||||||
export 'pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget;
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ 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/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
Future<void> initializeApp() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
|
@ -16,11 +16,11 @@ 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';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/database/database_helper.dart';
|
import 'package:hub/shared/helpers/database/database_helper.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/deeplink/deep_link_service.dart';
|
import 'package:hub/shared/services/deeplink/deep_link_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
import 'package:responsive_framework/responsive_framework.dart';
|
import 'package:responsive_framework/responsive_framework.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||||
if (state == AppLifecycleState.detached) {
|
if (state == AppLifecycleState.detached) {
|
||||||
await LocalizationService.processLocals(context);
|
await LocalsRepositoryImpl().processLocals(context);
|
||||||
await FirebaseMessagingService().updateDeviceToken();
|
await FirebaseMessagingService().updateDeviceToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
|
|
||||||
import 'package:hub/pages/about_property_page/about_property_screen.dart';
|
|
||||||
|
|
||||||
class AboutPropertyModel extends FlutterFlowModel<AboutPropertyPage> {
|
|
||||||
dynamic item;
|
|
||||||
|
|
||||||
VoidCallback? safeSetState;
|
|
||||||
|
|
||||||
Future<void> initAsync() async {
|
|
||||||
safeSetState?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {
|
|
||||||
initAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -5,10 +5,10 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
import '../../shared/utils/snackbar_util.dart';
|
import '../../shared/utils/snackbar_util.dart';
|
||||||
|
@ -262,7 +262,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
enText: 'Are you sure you want to unlink your device?',
|
enText: 'Are you sure you want to unlink your device?',
|
||||||
ptText: 'Tem certeza que deseja desvincular seu dispositivo?',
|
ptText: 'Tem certeza que deseja desvincular seu dispositivo?',
|
||||||
);
|
);
|
||||||
onConfirm() async => LocalizationService.unlinkLocal(context);
|
onConfirm() async => LocalsRepositoryImpl().unlinkLocal(context);
|
||||||
|
|
||||||
showAlertDialog(context, title, content, onConfirm);
|
showAlertDialog(context, title, content, onConfirm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,9 @@ 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/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
}();
|
}();
|
||||||
|
|
||||||
FirebaseMessagingService().updateDeviceToken();
|
FirebaseMessagingService().updateDeviceToken();
|
||||||
LocalizationService.checkLocals(context);
|
LocalsRepositoryImpl().checkLocals(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -48,7 +48,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
log('() => state: $state');
|
log('() => state: $state');
|
||||||
if (state == AppLifecycleState.resumed) {
|
if (state == AppLifecycleState.resumed) {
|
||||||
setState(() {
|
setState(() {
|
||||||
LocalizationService.checkLocals(context);
|
LocalsRepositoryImpl().checkLocals(context);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,8 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0),
|
padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context)
|
||||||
ptText: 'Falta pouco para você utilizar o FRE Access Hub...',
|
.getVariableText(ptText: 'Falta pouco para você utilizar o FRE Access Hub...', enText: 'You are close to using the FRE Access Hub...'),
|
||||||
enText: 'You are close to using the FRE Access Hub...'),
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: FlutterFlowTheme.of(context).displayLarge.override(
|
style: FlutterFlowTheme.of(context).displayLarge.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -94,8 +93,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40),
|
padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.',
|
||||||
'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.',
|
|
||||||
enText: 'Send your identifier to your condominium to link your account to our systems.'),
|
enText: 'Send your identifier to your condominium to link your account to our systems.'),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||||
|
@ -115,10 +113,8 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(60, 0, 60, 10),
|
padding: const EdgeInsets.fromLTRB(60, 0, 60, 10),
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: FFLocalizations.of(context).getVariableText(
|
message: FFLocalizations.of(context)
|
||||||
ptText:
|
.getVariableText(ptText: 'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.', enText: 'My Identifier'),
|
||||||
'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.',
|
|
||||||
enText: 'My Identifier'),
|
|
||||||
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
||||||
fontFamily: 'Nunito Sans',
|
fontFamily: 'Nunito Sans',
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
|
@ -129,8 +125,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
),
|
),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () => model.getIdenfifier(context),
|
onPressed: () => model.getIdenfifier(context),
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'),
|
||||||
.getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 30,
|
height: 30,
|
||||||
|
@ -164,8 +159,7 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> with WidgetsB
|
||||||
AuthenticationService.signOut(context);
|
AuthenticationService.signOut(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getVariableText(ptText: 'Sair da Conta', enText: 'Logout'),
|
||||||
.getVariableText(ptText: 'Sair da Conta', enText: 'Logout'),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 30,
|
height: 30,
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
|
||||||
import '../../../flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import '../../../flutter_flow/flutter_flow_util.dart';
|
|
||||||
|
|
||||||
class AtomTermsOfUse extends StatelessWidget {
|
class AtomTermsOfUse extends StatelessWidget {
|
||||||
const AtomTermsOfUse({super.key});
|
const AtomTermsOfUse({super.key});
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/features/home/index.dart';
|
||||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.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/pages/home_page/home_bloc.dart';
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
import 'package:hub/pages/home_page/home_state.dart';
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
import 'package:hub/shared/helpers/license/license_helper.dart';
|
|
||||||
import 'package:hub/shared/services/license/license_service.dart';
|
|
||||||
|
|
||||||
class CustomDrawer extends StatelessWidget {
|
class CustomDrawer extends StatelessWidget {
|
||||||
const CustomDrawer({super.key});
|
const CustomDrawer({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StreamBuilder<List<dynamic>>(
|
return StreamBuilder<TModule>(
|
||||||
stream: LicenseService().licenseStream,
|
stream: LicenseRepositoryImpl.stream,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return const Center(
|
return const Center(
|
||||||
|
@ -27,7 +24,7 @@ class CustomDrawer extends StatelessWidget {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text('Error: ${snapshot.error}'),
|
child: Text('Error: ${snapshot.error}'),
|
||||||
);
|
);
|
||||||
} else if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
} else if (!snapshot.hasData || snapshot.data! == false) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 10),
|
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 10),
|
||||||
|
@ -192,11 +189,10 @@ class CustomDrawer extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDrawerBody(BuildContext context) {
|
Widget _buildDrawerBody(BuildContext context) {
|
||||||
return MenuComponentWidget(
|
return MenuFactory(
|
||||||
style: MenuView.list,
|
menuEntry: MenuEntries.drawer,
|
||||||
item: MenuItem.tile,
|
menuItem: MenuItem.tile,
|
||||||
expandable: false,
|
menuView: MenuView.list,
|
||||||
menuOptions: Module.values.where((e) => e != Module.settings).toList(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export 'drawer_widget.dart';
|
|
@ -0,0 +1,2 @@
|
||||||
|
export 'locals_local_data_source.dart';
|
||||||
|
export 'locals_remote_data_source.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
abstract class LocalsLocalDataSource {}
|
||||||
|
|
||||||
|
class LocalsLocalDataSourceImpl {}
|
|
@ -8,19 +8,30 @@ import 'package:hub/components/organism_components/bottom_arrow_linked_locals_co
|
||||||
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';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/database/database_helper.dart';
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/services/license/license_service.dart';
|
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||||
import 'package:hub/shared/extensions/string_extensions.dart';
|
|
||||||
|
|
||||||
class LocalizationService {
|
abstract class LocalsRemoteDataSource {
|
||||||
static Future<void> checkLocals(BuildContext context) async {
|
Future<void> checkLocals(BuildContext context) async {}
|
||||||
|
Future<bool> processLocals(BuildContext context) async => false;
|
||||||
|
Future<bool> processData(BuildContext context) async => false;
|
||||||
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async => false;
|
||||||
|
Future<void> unlinkLocal(BuildContext context) async {}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
static final LocalsRemoteDataSourceImpl _instance = LocalsRemoteDataSourceImpl._internal();
|
||||||
|
factory LocalsRemoteDataSourceImpl() => _instance;
|
||||||
|
LocalsRemoteDataSourceImpl._internal();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> checkLocals(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||||
var response = await callback.call();
|
var response = await callback.call();
|
||||||
|
@ -57,9 +68,10 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> processLocals(BuildContext context) async {
|
@override
|
||||||
|
Future<bool> processLocals(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
await LicenseService().cleanLicense();
|
await LicenseRepositoryImpl().cleanLicense();
|
||||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||||
final ApiCallResponse response = await callback.call();
|
final ApiCallResponse response = await callback.call();
|
||||||
final bool? isError = response.jsonBody['error'];
|
final bool? isError = response.jsonBody['error'];
|
||||||
|
@ -130,7 +142,8 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> processData(BuildContext context) async {
|
@override
|
||||||
|
Future<bool> processData(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
final GetDadosCall callback = PhpGroup.getDadosCall;
|
final GetDadosCall callback = PhpGroup.getDadosCall;
|
||||||
ApiCallResponse? response = await callback.call();
|
ApiCallResponse? response = await callback.call();
|
||||||
|
@ -153,10 +166,10 @@ class LocalizationService {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
final bool isNewVersion = await _updateStorageUtil(response.jsonBody);
|
final bool isNewVersion = await _updateStorageUtil(response.jsonBody);
|
||||||
await LicenseService().setupLicense(DatabaseStorage.database, isNewVersion);
|
await LicenseRepositoryImpl().setupLicense(isNewVersion);
|
||||||
if (isNewVersion) {
|
if (isNewVersion) {
|
||||||
log('(A) => isNewVersion: $isNewVersion');
|
log('(A) => isNewVersion: $isNewVersion');
|
||||||
return await LicenseService().fetchLicenses(isNewVersion);
|
return await LicenseRepositoryImpl().fetchLicense(isNewVersion);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +185,8 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async {
|
@override
|
||||||
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async {
|
||||||
return await showModalBottomSheet(
|
return await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
@ -191,7 +205,8 @@ class LocalizationService {
|
||||||
).then((_) async => await processData(context));
|
).then((_) async => await processData(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> unlinkLocal(BuildContext context) async {
|
@override
|
||||||
|
Future<void> unlinkLocal(BuildContext context) async {
|
||||||
String content;
|
String content;
|
||||||
try {
|
try {
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -235,7 +250,7 @@ class LocalizationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _handleError(BuildContext context, String errorMsg) async {
|
void _handleError(BuildContext context, String errorMsg) async {
|
||||||
final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().g(KeychainStorageKey.devUUID.value) ?? '';
|
||||||
final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().g(KeychainStorageKey.userUUID.value) ?? '';
|
||||||
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
||||||
|
@ -262,7 +277,7 @@ class LocalizationService {
|
||||||
await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context, null));
|
await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
Future<bool> _handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
||||||
log('() => isUnavailable');
|
log('() => isUnavailable');
|
||||||
try {
|
try {
|
||||||
await StorageHelper().s(KeychainStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
||||||
|
@ -284,7 +299,7 @@ class LocalizationService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _handleEnabled(BuildContext context, dynamic local) async {
|
Future<bool> _handleEnabled(BuildContext context, dynamic local) async {
|
||||||
log('() => isEnabled');
|
log('() => isEnabled');
|
||||||
await StorageHelper().s(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||||
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().s(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||||
|
@ -293,14 +308,14 @@ class LocalizationService {
|
||||||
return await processData(context);
|
return await processData(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _logLocalsStatus(List<dynamic> locals) {
|
void _logLocalsStatus(List<dynamic> locals) {
|
||||||
for (var local in locals) {
|
for (var local in locals) {
|
||||||
final String status = local['CLU_STATUS'];
|
final String status = local['CLU_STATUS'];
|
||||||
log('() => CLU_STATUS: $status');
|
log('() => CLU_STATUS: $status');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
Future<bool> _updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||||
await StorageHelper().s(KeychainStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp']);
|
await StorageHelper().s(KeychainStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp']);
|
||||||
await StorageHelper().s(KeychainStorageKey.provisional.value, jsonBody['provisional'] != null && jsonBody['provisional']);
|
await StorageHelper().s(KeychainStorageKey.provisional.value, jsonBody['provisional'] != null && jsonBody['provisional']);
|
||||||
await StorageHelper().s(KeychainStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet']);
|
await StorageHelper().s(KeychainStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet']);
|
||||||
|
@ -318,33 +333,33 @@ class LocalizationService {
|
||||||
return isNewVersion;
|
return isNewVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _isActive(List<dynamic> locals) {
|
bool _isActive(List<dynamic> locals) {
|
||||||
return locals.where((local) => local['CLU_STATUS'] == 'A').isNotEmpty;
|
return locals.where((local) => local['CLU_STATUS'] == 'A').isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isInactived(List<dynamic> locals) async {
|
Future<bool> _isInactived(List<dynamic> locals) async {
|
||||||
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _isPending(List<dynamic> locals) {
|
bool _isPending(List<dynamic> locals) {
|
||||||
return locals.where((local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A').isNotEmpty;
|
return locals.where((local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A').isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isUnselected() async {
|
Future<bool> _isUnselected() async {
|
||||||
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
String ownerUUID = (await StorageHelper().g(KeychainStorageKey.ownerUUID.value)) ?? '';
|
String ownerUUID = (await StorageHelper().g(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||||
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isSelected(bool isInactived) async {
|
Future<bool> _isSelected(bool isInactived) async {
|
||||||
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _isAvailable() async {
|
Future<bool> _isAvailable() async {
|
||||||
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||||
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().g(KeychainStorageKey.clientName.value)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'locals_repository_impl.dart';
|
|
@ -0,0 +1,32 @@
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
|
|
||||||
|
class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
|
final LocalsRemoteDataSource remoteDataSource = LocalsRemoteDataSourceImpl();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> checkLocals(BuildContext context) async {
|
||||||
|
return await remoteDataSource.checkLocals(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> processData(BuildContext context) async {
|
||||||
|
return await remoteDataSource.processData(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> processLocals(BuildContext context) async {
|
||||||
|
return await remoteDataSource.processLocals(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async {
|
||||||
|
return await remoteDataSource.selectLocal(context, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> unlinkLocal(BuildContext context) {
|
||||||
|
return remoteDataSource.unlinkLocal(context);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'locals_repository.dart';
|
|
@ -0,0 +1,10 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
|
||||||
|
abstract class LocalsRepository {
|
||||||
|
Future<void> checkLocals(BuildContext context) async {}
|
||||||
|
Future<bool> processLocals(BuildContext context) async => false;
|
||||||
|
Future<bool> processData(BuildContext context) async => false;
|
||||||
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) async => false;
|
||||||
|
Future<void> unlinkLocal(BuildContext context) async {}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'local_profile_bloc.dart';
|
|
@ -1,7 +1,7 @@
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'local_profile_widget.dart';
|
|
@ -2,13 +2,12 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_bloc.dart';
|
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
import 'package:hub/flutter_flow/custom_functions.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/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
const LocalProfileComponentWidget({super.key});
|
const LocalProfileComponentWidget({super.key});
|
||||||
|
@ -59,8 +58,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().s(KeychainStorageKey.clientUUID.value, '');
|
||||||
await LocalizationService.processLocals(context).whenComplete(
|
await LocalsRepositoryImpl().processLocals(context).whenComplete(() async => context.read<LocalProfileBloc>().add(LocalProfileEvent()));
|
||||||
() async => context.read<LocalProfileBloc>().add(LocalProfileEvent()));
|
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
|
@ -73,9 +71,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
imageUrl: valueOrDefault(
|
imageUrl: valueOrDefault('https://freaccess.com.br/freaccess/Images/Clients/${state.cliUUID}.png', 'assets/images/home.png'),
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${state.cliUUID}.png',
|
|
||||||
'assets/images/home.png'),
|
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -117,10 +113,7 @@ class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidge
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)),
|
||||||
.divide(const SizedBox(width: 20.0))
|
|
||||||
.addToStart(const SizedBox(width: 20.0))
|
|
||||||
.addToEnd(const SizedBox(width: 20.0)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data_sources/index.dart';
|
||||||
|
export 'repositories/index.dart';
|
||||||
|
export 'models/index.dart';
|
|
@ -0,0 +1,5 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
|
|
||||||
|
abstract class BaseEntry implements BaseModule {}
|
|
@ -0,0 +1 @@
|
||||||
|
export 'base_entry.dart';
|
|
@ -0,0 +1,18 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/modules/domain/entities/license.dart';
|
||||||
|
|
||||||
|
class MenuEntry {
|
||||||
|
final String value;
|
||||||
|
final String name;
|
||||||
|
final IconData icon;
|
||||||
|
final String route;
|
||||||
|
final ModuleStatus status;
|
||||||
|
|
||||||
|
MenuEntry({
|
||||||
|
required this.value,
|
||||||
|
required this.name,
|
||||||
|
required this.icon,
|
||||||
|
required this.route,
|
||||||
|
required this.status,
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'entities/index.dart';
|
||||||
|
export 'respositories/index.dart';
|
||||||
|
export 'usecases/index.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'data/index.dart';
|
||||||
|
export 'domain/index.dart';
|
||||||
|
export 'presentation/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'menu_view_bloc.dart';
|
|
@ -0,0 +1,9 @@
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
class MenuEvent {}
|
||||||
|
|
||||||
|
class MenuState {}
|
||||||
|
|
||||||
|
class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
|
MenuBloc() : super(MenuState());
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
class MenuItemEvent {}
|
||||||
|
|
||||||
|
class MenuItemState {}
|
||||||
|
|
||||||
|
class MenuItemBloc extends Bloc<MenuItemEvent, MenuItemState> {
|
||||||
|
MenuItemBloc() : super(MenuItemState());
|
||||||
|
}
|
|
@ -3,43 +3,44 @@ import 'dart:developer';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/backend/schema/enums/enums.dart';
|
||||||
import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart';
|
|
||||||
import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
import 'package:hub/flutter_flow/custom_functions.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
||||||
import 'package:hub/shared/helpers/license/license_helper.dart';
|
|
||||||
|
|
||||||
class MenuEvent {}
|
class MenuViewEvent {}
|
||||||
|
|
||||||
class MenuState {
|
class MenuViewState {
|
||||||
final List<MenuEntry?> menuEntries;
|
final List<MenuEntry?> menuEntries;
|
||||||
final bool isGrid;
|
final bool isGrid;
|
||||||
|
|
||||||
MenuState({this.menuEntries = const [], this.isGrid = false});
|
MenuViewState({this.menuEntries = const [], this.isGrid = false});
|
||||||
|
|
||||||
MenuState copyWith({List<MenuEntry?>? menuEntries, bool? isGrid}) {
|
MenuViewState copyWith({List<MenuEntry?>? menuEntries, bool? isGrid}) {
|
||||||
return MenuState(
|
return MenuViewState(
|
||||||
menuEntries: menuEntries ?? this.menuEntries,
|
menuEntries: menuEntries ?? this.menuEntries,
|
||||||
isGrid: isGrid ?? this.isGrid,
|
isGrid: isGrid ?? this.isGrid,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
class MenuViewBloc extends Bloc<MenuViewEvent, MenuViewState> {
|
||||||
final MenuView style;
|
final MenuView style;
|
||||||
final MenuItem item;
|
final MenuItem item;
|
||||||
final bool expandable;
|
final bool expandable;
|
||||||
final List<Module> menuOptions;
|
final List<BaseEntry> menuOptions;
|
||||||
|
|
||||||
MenuBloc({required this.style, required this.item, required this.expandable, required this.menuOptions}) : super(MenuState()) {
|
MenuViewBloc({required this.style, required this.item, required this.expandable, required this.menuOptions}) : super(MenuViewState()) {
|
||||||
on<MenuEvent>((event, emit) async {
|
on<MenuViewEvent>((event, emit) async {
|
||||||
|
await LicenseRemoteDataSourceImpl().waitForSaveCompletion();
|
||||||
final entries = await generateMenuEntries();
|
final entries = await generateMenuEntries();
|
||||||
emit(state.copyWith(menuEntries: entries));
|
emit(state.copyWith(menuEntries: entries));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<MenuEntry?> addMenuEntry(List<MenuEntry?> entries, IconData icon, String text, Function() action) async {
|
Future<MenuEntry?> addMenuEntry(List<MenuEntry?> entries, IconData icon, String text, Function() action) async {
|
||||||
entries.add(
|
entries.add(
|
||||||
item == MenuItem.button
|
item == MenuItem.button
|
||||||
|
@ -57,10 +58,10 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
List<MenuEntry?> entries = [];
|
List<MenuEntry?> entries = [];
|
||||||
try {
|
try {
|
||||||
for (var opt in menuOptions) {
|
for (var opt in menuOptions) {
|
||||||
String? licenseValue = await LicenseHelper().g(opt.value);
|
String? licenseValue = await LicenseRepositoryImpl().g(opt.value);
|
||||||
if (licenseValue != null) {
|
if (licenseValue != null) {
|
||||||
Map<String, String> licenseMap = await stringToMap(licenseValue);
|
Map<String, String> licenseMap = await stringToMap(licenseValue);
|
||||||
if (opt == Module.aboutProperty) log('AboutProperty: $licenseMap');
|
if (opt.value == Modules.aboutProperty.value) log('AboutProperty: $licenseMap');
|
||||||
log('Module: ${opt.value} - License: ${licenseMap['display']}');
|
log('Module: ${opt.value} - License: ${licenseMap['display']}');
|
||||||
final String display = licenseMap['display'] ?? 'INVISIVEL';
|
final String display = licenseMap['display'] ?? 'INVISIVEL';
|
||||||
final String startDate = licenseMap['startDate'] ?? '';
|
final String startDate = licenseMap['startDate'] ?? '';
|
||||||
|
@ -80,7 +81,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> processDisplay(String display, Module opt, List<MenuEntry?> entries) async {
|
Future<void> processDisplay(String display, BaseEntry opt, List<MenuEntry?> entries) async {
|
||||||
try {
|
try {
|
||||||
switch (display) {
|
switch (display) {
|
||||||
case 'VISIVEL':
|
case 'VISIVEL':
|
||||||
|
@ -90,7 +91,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
break;
|
break;
|
||||||
case 'DESABILITADO':
|
case 'DESABILITADO':
|
||||||
await addMenuEntry(entries, opt.icon, opt.name, () async {
|
await addMenuEntry(entries, opt.icon, opt.name, () async {
|
||||||
await DialogUnavailable.unavailableFeature(key.currentContext!);
|
await DialogUnavailable.unavailableFeature(navigatorKey.currentContext!);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'INVISIVEL':
|
case 'INVISIVEL':
|
||||||
|
@ -102,7 +103,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> processStartDate(String startDate, Module opt) async {
|
Future<bool> processStartDate(String startDate, BaseEntry opt) async {
|
||||||
try {
|
try {
|
||||||
if (startDate.isEmpty) return true;
|
if (startDate.isEmpty) return true;
|
||||||
final DateTime? start = DateTime.tryParse(startDate);
|
final DateTime? start = DateTime.tryParse(startDate);
|
||||||
|
@ -115,7 +116,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> processExpirationDate(String expirationDate, Module opt) async {
|
Future<bool> processExpirationDate(String expirationDate, BaseEntry opt) async {
|
||||||
try {
|
try {
|
||||||
if (expirationDate.isEmpty) return false;
|
if (expirationDate.isEmpty) return false;
|
||||||
final DateTime? expiration = DateTime.tryParse(expirationDate);
|
final DateTime? expiration = DateTime.tryParse(expirationDate);
|
||||||
|
@ -130,7 +131,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
|
|
||||||
Future nav(String link) async {
|
Future nav(String link) async {
|
||||||
log('Opening: $link');
|
log('Opening: $link');
|
||||||
key.currentContext!.push(link, extra: <String, dynamic>{
|
navigatorKey.currentContext!.push(link, extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: false,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
|
@ -0,0 +1,2 @@
|
||||||
|
export 'blocs/index.dart';
|
||||||
|
export 'widgets/index.dart';
|
|
@ -0,0 +1,4 @@
|
||||||
|
export 'menu_item/index.dart';
|
||||||
|
export 'menu_view/index.dart';
|
||||||
|
export 'menu_factory/index.dart';
|
||||||
|
export 'menu_entry/index.dart';
|
|
@ -0,0 +1,223 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
enum DrawerMenuEntries implements BaseEntry {
|
||||||
|
providerSchedule,
|
||||||
|
deliverySchedule,
|
||||||
|
fastPass,
|
||||||
|
completeSchedule,
|
||||||
|
orders,
|
||||||
|
reservations,
|
||||||
|
visitors,
|
||||||
|
qrCode,
|
||||||
|
pets,
|
||||||
|
access,
|
||||||
|
liberations,
|
||||||
|
messages,
|
||||||
|
aboutProperty,
|
||||||
|
peopleOnTheProperty,
|
||||||
|
settings,
|
||||||
|
logout;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get value {
|
||||||
|
switch (this) {
|
||||||
|
case DrawerMenuEntries.messages:
|
||||||
|
return 'FRE-HUB-MESSAGES';
|
||||||
|
case DrawerMenuEntries.liberations:
|
||||||
|
return 'FRE-HUB-LIBERATIONS';
|
||||||
|
case DrawerMenuEntries.reservations:
|
||||||
|
return 'FRE-HUB-RESERVATIONS';
|
||||||
|
case DrawerMenuEntries.access:
|
||||||
|
return 'FRE-HUB-ACCESS';
|
||||||
|
case DrawerMenuEntries.pets:
|
||||||
|
return 'FRE-HUB-PETS';
|
||||||
|
case DrawerMenuEntries.orders:
|
||||||
|
return 'FRE-HUB-ORDERS';
|
||||||
|
case DrawerMenuEntries.completeSchedule:
|
||||||
|
return 'FRE-HUB-COMPLETE-SCHEDULE';
|
||||||
|
case DrawerMenuEntries.providerSchedule:
|
||||||
|
return 'FRE-HUB-AGE-PROV-PRESTADOR';
|
||||||
|
case DrawerMenuEntries.deliverySchedule:
|
||||||
|
return 'FRE-HUB-AGE-PROV-DELIVERY';
|
||||||
|
case DrawerMenuEntries.aboutProperty:
|
||||||
|
return 'FRE-HUB-PROPERTY';
|
||||||
|
case DrawerMenuEntries.fastPass:
|
||||||
|
return 'FRE-HUB-FASTPASS';
|
||||||
|
case DrawerMenuEntries.visitors:
|
||||||
|
return 'FRE-HUB-VISITORS';
|
||||||
|
case DrawerMenuEntries.qrCode:
|
||||||
|
return 'FRE-HUB-QRCODE';
|
||||||
|
case DrawerMenuEntries.peopleOnTheProperty:
|
||||||
|
return 'FRE-HUB-PEOPLE';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get name {
|
||||||
|
switch (this) {
|
||||||
|
case DrawerMenuEntries.messages:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Mensagens',
|
||||||
|
enText: 'Messages History',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.liberations:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Liberações',
|
||||||
|
enText: 'Liberations History',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.reservations:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Reservas',
|
||||||
|
enText: 'Reservations',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.access:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Acessos',
|
||||||
|
enText: 'Access History',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.pets:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Pets',
|
||||||
|
enText: 'Pets',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.peopleOnTheProperty:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Pessoas na Propriedade',
|
||||||
|
enText: 'People on the Property',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.orders:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Minhas Encomendas',
|
||||||
|
enText: 'My Orders',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.completeSchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agenda Completa',
|
||||||
|
enText: 'Complete Schedule',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.providerSchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agendar Prestadores',
|
||||||
|
enText: 'Schedule Providers',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.deliverySchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agendar Delivery',
|
||||||
|
enText: 'Schedule Delivery',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.fastPass:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Fast Pass',
|
||||||
|
enText: 'Fast Pass',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.qrCode:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'QRCode de Acesso',
|
||||||
|
enText: 'Access QRCode',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.visitors:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Cadastrar Visitantes',
|
||||||
|
enText: 'Register Visitors',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.aboutProperty:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Sobre a Propriedade',
|
||||||
|
enText: 'About the Property',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.settings:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Configurações',
|
||||||
|
enText: 'Settings',
|
||||||
|
);
|
||||||
|
case DrawerMenuEntries.logout:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Sair',
|
||||||
|
enText: 'Logout',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
IconData get icon {
|
||||||
|
switch (this) {
|
||||||
|
case DrawerMenuEntries.messages:
|
||||||
|
return Icons.chat_outlined;
|
||||||
|
case DrawerMenuEntries.liberations:
|
||||||
|
return Icons.how_to_reg_outlined;
|
||||||
|
case DrawerMenuEntries.reservations:
|
||||||
|
return Icons.event_available;
|
||||||
|
case DrawerMenuEntries.access:
|
||||||
|
return Icons.transfer_within_a_station_outlined;
|
||||||
|
case DrawerMenuEntries.pets:
|
||||||
|
return Icons.pets;
|
||||||
|
case DrawerMenuEntries.peopleOnTheProperty:
|
||||||
|
return Icons.groups;
|
||||||
|
case DrawerMenuEntries.orders:
|
||||||
|
return Icons.inventory_2_outlined;
|
||||||
|
case DrawerMenuEntries.completeSchedule:
|
||||||
|
return Icons.event;
|
||||||
|
case DrawerMenuEntries.providerSchedule:
|
||||||
|
return Icons.engineering_outlined;
|
||||||
|
case DrawerMenuEntries.deliverySchedule:
|
||||||
|
return Icons.sports_motorsports_outlined;
|
||||||
|
case DrawerMenuEntries.fastPass:
|
||||||
|
return Icons.attach_email_outlined;
|
||||||
|
case DrawerMenuEntries.qrCode:
|
||||||
|
return Icons.qr_code;
|
||||||
|
case DrawerMenuEntries.visitors:
|
||||||
|
return Icons.person_add_alt_1_outlined;
|
||||||
|
case DrawerMenuEntries.aboutProperty:
|
||||||
|
return Icons.home;
|
||||||
|
case DrawerMenuEntries.settings:
|
||||||
|
return Icons.settings;
|
||||||
|
case DrawerMenuEntries.logout:
|
||||||
|
return Icons.exit_to_app;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get route {
|
||||||
|
switch (this) {
|
||||||
|
case DrawerMenuEntries.messages:
|
||||||
|
return '/messageHistoryPage';
|
||||||
|
case DrawerMenuEntries.liberations:
|
||||||
|
return '/liberationHistory';
|
||||||
|
case DrawerMenuEntries.reservations:
|
||||||
|
return '/reservation';
|
||||||
|
case DrawerMenuEntries.access:
|
||||||
|
return '/acessHistoryPage';
|
||||||
|
case DrawerMenuEntries.pets:
|
||||||
|
return '/petsPage';
|
||||||
|
case DrawerMenuEntries.peopleOnTheProperty:
|
||||||
|
return '/peopleOnThePropertyPage';
|
||||||
|
case DrawerMenuEntries.orders:
|
||||||
|
return '/packageOrder';
|
||||||
|
case DrawerMenuEntries.completeSchedule:
|
||||||
|
return '/scheduleCompleteVisitPage';
|
||||||
|
case DrawerMenuEntries.providerSchedule:
|
||||||
|
return '/provisionalSchedule';
|
||||||
|
case DrawerMenuEntries.aboutProperty:
|
||||||
|
return '/aboutProperty';
|
||||||
|
case DrawerMenuEntries.deliverySchedule:
|
||||||
|
return '/deliverySchedule';
|
||||||
|
case DrawerMenuEntries.fastPass:
|
||||||
|
return '/fastPassPage';
|
||||||
|
case DrawerMenuEntries.qrCode:
|
||||||
|
return '/qrCodePage';
|
||||||
|
case DrawerMenuEntries.visitors:
|
||||||
|
return '/registerVisitorPage';
|
||||||
|
case DrawerMenuEntries.settings:
|
||||||
|
return '/preferencesSettings';
|
||||||
|
case DrawerMenuEntries.logout:
|
||||||
|
return '/WelcomePage';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,213 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
enum HomeMenuEntries implements BaseEntry {
|
||||||
|
providerSchedule,
|
||||||
|
deliverySchedule,
|
||||||
|
fastPass,
|
||||||
|
completeSchedule,
|
||||||
|
orders,
|
||||||
|
reservations,
|
||||||
|
visitors,
|
||||||
|
qrCode,
|
||||||
|
pets,
|
||||||
|
access,
|
||||||
|
liberations,
|
||||||
|
messages,
|
||||||
|
aboutProperty,
|
||||||
|
peopleOnTheProperty,
|
||||||
|
settings;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get value {
|
||||||
|
switch (this) {
|
||||||
|
case HomeMenuEntries.messages:
|
||||||
|
return 'FRE-HUB-MESSAGES';
|
||||||
|
case HomeMenuEntries.liberations:
|
||||||
|
return 'FRE-HUB-LIBERATIONS';
|
||||||
|
case HomeMenuEntries.reservations:
|
||||||
|
return 'FRE-HUB-RESERVATIONS';
|
||||||
|
case HomeMenuEntries.access:
|
||||||
|
return 'FRE-HUB-ACCESS';
|
||||||
|
case HomeMenuEntries.pets:
|
||||||
|
return 'FRE-HUB-PETS';
|
||||||
|
case HomeMenuEntries.orders:
|
||||||
|
return 'FRE-HUB-ORDERS';
|
||||||
|
case HomeMenuEntries.completeSchedule:
|
||||||
|
return 'FRE-HUB-COMPLETE-SCHEDULE';
|
||||||
|
case HomeMenuEntries.providerSchedule:
|
||||||
|
return 'FRE-HUB-AGE-PROV-PRESTADOR';
|
||||||
|
case HomeMenuEntries.deliverySchedule:
|
||||||
|
return 'FRE-HUB-AGE-PROV-DELIVERY';
|
||||||
|
case HomeMenuEntries.aboutProperty:
|
||||||
|
return 'FRE-HUB-PROPERTY';
|
||||||
|
case HomeMenuEntries.fastPass:
|
||||||
|
return 'FRE-HUB-FASTPASS';
|
||||||
|
case HomeMenuEntries.visitors:
|
||||||
|
return 'FRE-HUB-VISITORS';
|
||||||
|
case HomeMenuEntries.qrCode:
|
||||||
|
return 'FRE-HUB-QRCODE';
|
||||||
|
case HomeMenuEntries.peopleOnTheProperty:
|
||||||
|
return 'FRE-HUB-PEOPLE';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get name {
|
||||||
|
switch (this) {
|
||||||
|
case HomeMenuEntries.messages:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Mensagens',
|
||||||
|
enText: 'Messages History',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.liberations:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Liberações',
|
||||||
|
enText: 'Liberations History',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.reservations:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Reservas',
|
||||||
|
enText: 'Reservations',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.access:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Consultar Acessos',
|
||||||
|
enText: 'Access History',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.pets:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Pets',
|
||||||
|
enText: 'Pets',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.peopleOnTheProperty:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Pessoas na Propriedade',
|
||||||
|
enText: 'People on the Property',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.orders:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Minhas Encomendas',
|
||||||
|
enText: 'My Orders',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.completeSchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agenda Completa',
|
||||||
|
enText: 'Complete Schedule',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.providerSchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agendar Prestadores',
|
||||||
|
enText: 'Schedule Providers',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.deliverySchedule:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Agendar Delivery',
|
||||||
|
enText: 'Schedule Delivery',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.fastPass:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Fast Pass',
|
||||||
|
enText: 'Fast Pass',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.qrCode:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'QRCode de Acesso',
|
||||||
|
enText: 'Access QRCode',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.visitors:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Cadastrar Visitantes',
|
||||||
|
enText: 'Register Visitors',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.aboutProperty:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Sobre a Propriedade',
|
||||||
|
enText: 'About the Property',
|
||||||
|
);
|
||||||
|
case HomeMenuEntries.settings:
|
||||||
|
return FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||||
|
ptText: 'Configurações',
|
||||||
|
enText: 'Settings',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
IconData get icon {
|
||||||
|
switch (this) {
|
||||||
|
case HomeMenuEntries.messages:
|
||||||
|
return Icons.chat_outlined;
|
||||||
|
case HomeMenuEntries.liberations:
|
||||||
|
return Icons.how_to_reg_outlined;
|
||||||
|
case HomeMenuEntries.reservations:
|
||||||
|
return Icons.event_available;
|
||||||
|
case HomeMenuEntries.access:
|
||||||
|
return Icons.transfer_within_a_station_outlined;
|
||||||
|
case HomeMenuEntries.pets:
|
||||||
|
return Icons.pets;
|
||||||
|
case HomeMenuEntries.peopleOnTheProperty:
|
||||||
|
return Icons.groups;
|
||||||
|
case HomeMenuEntries.orders:
|
||||||
|
return Icons.inventory_2_outlined;
|
||||||
|
case HomeMenuEntries.completeSchedule:
|
||||||
|
return Icons.event;
|
||||||
|
case HomeMenuEntries.providerSchedule:
|
||||||
|
return Icons.engineering_outlined;
|
||||||
|
case HomeMenuEntries.deliverySchedule:
|
||||||
|
return Icons.sports_motorsports_outlined;
|
||||||
|
case HomeMenuEntries.fastPass:
|
||||||
|
return Icons.attach_email_outlined;
|
||||||
|
case HomeMenuEntries.qrCode:
|
||||||
|
return Icons.qr_code;
|
||||||
|
case HomeMenuEntries.visitors:
|
||||||
|
return Icons.person_add_alt_1_outlined;
|
||||||
|
case HomeMenuEntries.aboutProperty:
|
||||||
|
return Icons.home;
|
||||||
|
case HomeMenuEntries.settings:
|
||||||
|
return Icons.settings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get route {
|
||||||
|
switch (this) {
|
||||||
|
case HomeMenuEntries.messages:
|
||||||
|
return '/messageHistoryPage';
|
||||||
|
case HomeMenuEntries.liberations:
|
||||||
|
return '/liberationHistory';
|
||||||
|
case HomeMenuEntries.reservations:
|
||||||
|
return '/reservation';
|
||||||
|
case HomeMenuEntries.access:
|
||||||
|
return '/acessHistoryPage';
|
||||||
|
case HomeMenuEntries.pets:
|
||||||
|
return '/petsPage';
|
||||||
|
case HomeMenuEntries.peopleOnTheProperty:
|
||||||
|
return '/peopleOnThePropertyPage';
|
||||||
|
case HomeMenuEntries.orders:
|
||||||
|
return '/packageOrder';
|
||||||
|
case HomeMenuEntries.completeSchedule:
|
||||||
|
return '/scheduleCompleteVisitPage';
|
||||||
|
case HomeMenuEntries.providerSchedule:
|
||||||
|
return '/provisionalSchedule';
|
||||||
|
case HomeMenuEntries.aboutProperty:
|
||||||
|
return '/aboutProperty';
|
||||||
|
case HomeMenuEntries.deliverySchedule:
|
||||||
|
return '/deliverySchedule';
|
||||||
|
case HomeMenuEntries.fastPass:
|
||||||
|
return '/fastPassPage';
|
||||||
|
case HomeMenuEntries.qrCode:
|
||||||
|
return '/qrCodePage';
|
||||||
|
case HomeMenuEntries.visitors:
|
||||||
|
return '/registerVisitorPage';
|
||||||
|
case HomeMenuEntries.settings:
|
||||||
|
return '/preferencesSettings';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
export 'drawer_menu_entry.dart';
|
||||||
|
export 'home_menu_entry.dart';
|
||||||
|
export 'property_menu_entry.dart';
|
||||||
|
export 'menu_entry_factory.dart';
|
|
@ -0,0 +1,38 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
enum MenuEntries {
|
||||||
|
home,
|
||||||
|
drawer,
|
||||||
|
AboutProperty;
|
||||||
|
|
||||||
|
List<BaseEntry> get getValues {
|
||||||
|
switch (this) {
|
||||||
|
case MenuEntries.home:
|
||||||
|
return HomeMenuEntries.values.toList();
|
||||||
|
case MenuEntries.drawer:
|
||||||
|
return DrawerMenuEntries.values.toList();
|
||||||
|
case MenuEntries.AboutProperty:
|
||||||
|
return AboutPropertyMenuEntries.values.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MenuEntryFactory {
|
||||||
|
static List<BaseEntry> createMenuEntry(BaseEntry type) {
|
||||||
|
switch (type) {
|
||||||
|
case HomeMenuEntries _:
|
||||||
|
return HomeMenuEntries.values.toList();
|
||||||
|
case DrawerMenuEntries _:
|
||||||
|
return DrawerMenuEntries.values.toList();
|
||||||
|
case AboutPropertyMenuEntries _:
|
||||||
|
return AboutPropertyMenuEntries.values.toList();
|
||||||
|
default:
|
||||||
|
throw ArgumentError('Invalid menu entry type');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<BaseEntry> buildMenuEntry(BaseEntry type) {
|
||||||
|
return createMenuEntry(type);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
enum AboutPropertyMenuEntries implements BaseEntry {
|
||||||
|
residents,
|
||||||
|
vehicles,
|
||||||
|
openedVisits,
|
||||||
|
petsHistory;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get value {
|
||||||
|
switch (this) {
|
||||||
|
case AboutPropertyMenuEntries.openedVisits:
|
||||||
|
return 'FRE-HUB-OPENED-VISITS';
|
||||||
|
case AboutPropertyMenuEntries.vehicles:
|
||||||
|
return 'FRE-HUB-VEHICLES';
|
||||||
|
case AboutPropertyMenuEntries.residents:
|
||||||
|
return 'FRE-HUB-RESIDENTS';
|
||||||
|
case AboutPropertyMenuEntries.petsHistory:
|
||||||
|
return 'FRE-HUB-PETS-HISTORY';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
IconData get icon {
|
||||||
|
switch (this) {
|
||||||
|
case AboutPropertyMenuEntries.residents:
|
||||||
|
return Icons.people;
|
||||||
|
case AboutPropertyMenuEntries.vehicles:
|
||||||
|
return Icons.directions_car;
|
||||||
|
case AboutPropertyMenuEntries.openedVisits:
|
||||||
|
return Icons.open_in_new;
|
||||||
|
case AboutPropertyMenuEntries.petsHistory:
|
||||||
|
return Icons.pets;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get name {
|
||||||
|
switch (this) {
|
||||||
|
case AboutPropertyMenuEntries.residents:
|
||||||
|
return 'Residents';
|
||||||
|
case AboutPropertyMenuEntries.vehicles:
|
||||||
|
return 'Vehicles';
|
||||||
|
case AboutPropertyMenuEntries.openedVisits:
|
||||||
|
return 'Opened Visits';
|
||||||
|
case AboutPropertyMenuEntries.petsHistory:
|
||||||
|
return 'Pets History';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get route {
|
||||||
|
switch (this) {
|
||||||
|
case AboutPropertyMenuEntries.residents:
|
||||||
|
return '/residentsOnThePropertyPage';
|
||||||
|
case AboutPropertyMenuEntries.vehicles:
|
||||||
|
return '/vehiclesOnThePropertyPage';
|
||||||
|
case AboutPropertyMenuEntries.openedVisits:
|
||||||
|
return '/openedVisitsPage';
|
||||||
|
case AboutPropertyMenuEntries.petsHistory:
|
||||||
|
return '/petsOnThePropertyPage';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export 'menu_factory.dart';
|
|
@ -0,0 +1,25 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
class MenuFactory extends StatelessWidget {
|
||||||
|
final MenuView menuView;
|
||||||
|
final MenuEntries menuEntry;
|
||||||
|
final MenuItem menuItem;
|
||||||
|
|
||||||
|
const MenuFactory({
|
||||||
|
super.key,
|
||||||
|
required this.menuView,
|
||||||
|
required this.menuEntry,
|
||||||
|
required this.menuItem,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MenuViewFactory(
|
||||||
|
view: menuView,
|
||||||
|
item: menuItem,
|
||||||
|
expandable: false,
|
||||||
|
entry: menuEntry,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
export 'menu_item.dart';
|
||||||
|
export 'menu_item_button.dart';
|
||||||
|
export 'menu_item_card.dart';
|
||||||
|
export 'menu_item_factory.dart';
|
|
@ -0,0 +1,42 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
enum MenuItem {
|
||||||
|
button,
|
||||||
|
card,
|
||||||
|
tile;
|
||||||
|
|
||||||
|
MenuEntry getInstance(final Function() action, final String title, final IconData icon) {
|
||||||
|
switch (this) {
|
||||||
|
case MenuItem.button:
|
||||||
|
return MenuButtonWidget(action: action, title: title, icon: icon);
|
||||||
|
case MenuItem.card:
|
||||||
|
return MenuCardItem(action: action, title: title, icon: icon);
|
||||||
|
case MenuItem.tile:
|
||||||
|
return MenuCardItem(action: action, title: title, icon: icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class MenuEntry extends StatefulWidget {
|
||||||
|
const MenuEntry({
|
||||||
|
super.key,
|
||||||
|
required this.action,
|
||||||
|
required this.title,
|
||||||
|
required this.icon,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Function() action;
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
|
||||||
|
factory MenuEntry.create(
|
||||||
|
MenuItem type, {
|
||||||
|
Key? key,
|
||||||
|
required Function() action,
|
||||||
|
required String title,
|
||||||
|
required IconData icon,
|
||||||
|
}) {
|
||||||
|
return type.getInstance(action, title, icon);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
|
import 'menu_item.dart';
|
||||||
|
|
||||||
class MenuButtonWidget extends MenuEntry {
|
class MenuButtonWidget extends MenuEntry {
|
||||||
const MenuButtonWidget({
|
const MenuButtonWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -23,7 +24,6 @@ class MenuButtonWidget extends MenuEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
get action => action;
|
|
||||||
bool _isProcessing = false;
|
bool _isProcessing = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -44,7 +44,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = true;
|
_isProcessing = true;
|
||||||
});
|
});
|
||||||
await widget.action.call();
|
widget.action.call();
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = false;
|
_isProcessing = false;
|
||||||
});
|
});
|
||||||
|
@ -60,10 +60,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
blurRadius: 4.0,
|
blurRadius: 4.0,
|
||||||
color: FlutterFlowTheme.of(context).customColor5,
|
color: FlutterFlowTheme.of(context).customColor5,
|
||||||
offset: const Offset(
|
offset: const Offset(0.0, 2.0),
|
||||||
0.0,
|
|
||||||
2.0,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
borderRadius: BorderRadius.circular(24.0),
|
borderRadius: BorderRadius.circular(24.0),
|
||||||
|
@ -94,7 +91,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 10.0),
|
padding: const EdgeInsets.only(left: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.title ?? '',
|
widget.title,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -102,7 +99,6 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: limitedFontSize,
|
fontSize: limitedFontSize,
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
),
|
),
|
|
@ -1,8 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
|
import 'menu_item.dart';
|
||||||
|
|
||||||
class MenuCardItem extends MenuEntry {
|
class MenuCardItem extends MenuEntry {
|
||||||
const MenuCardItem({
|
const MenuCardItem({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -23,7 +24,6 @@ class MenuCardItem extends MenuEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuCardItemState extends State<MenuCardItem> {
|
class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
get action => action;
|
|
||||||
bool _isProcessing = false;
|
bool _isProcessing = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -39,7 +39,7 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = true;
|
_isProcessing = true;
|
||||||
});
|
});
|
||||||
await widget.action.call();
|
widget.action.call();
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = false;
|
_isProcessing = false;
|
||||||
});
|
});
|
||||||
|
@ -65,7 +65,6 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
widget.icon,
|
widget.icon,
|
||||||
fill: null,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
|
@ -74,13 +73,11 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.title ?? '',
|
widget.title,
|
||||||
// overflow: TextOverflow.ellipsis,
|
|
||||||
style: FlutterFlowTheme.of(context).titleLarge.override(
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
),
|
),
|
|
@ -0,0 +1,24 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||||
|
|
||||||
|
class MenuItemFactory {
|
||||||
|
static MenuEntry createMenuItem(
|
||||||
|
MenuItem type, {
|
||||||
|
Key? key,
|
||||||
|
required Function() action,
|
||||||
|
required String title,
|
||||||
|
required IconData icon,
|
||||||
|
}) {
|
||||||
|
return MenuEntry.create(type, key: key, action: action, title: title, icon: icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuEntry buildMenuItem(
|
||||||
|
MenuItem type, {
|
||||||
|
Key? key,
|
||||||
|
required Function() action,
|
||||||
|
required String title,
|
||||||
|
required IconData icon,
|
||||||
|
}) {
|
||||||
|
return createMenuItem(type, key: key, action: action, title: title, icon: icon);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'menu_list_view.dart';
|
||||||
|
export 'menu_staggered_view.dart';
|
||||||
|
export 'menu_view_factory.dart';
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue