WIP
This commit is contained in:
parent
84f1fc72cd
commit
74d351de72
|
@ -480,6 +480,7 @@ class AppState extends ChangeNotifier {
|
||||||
|
|
||||||
void deleteAll() {
|
void deleteAll() {
|
||||||
secureStorage.deleteAll();
|
secureStorage.deleteAll();
|
||||||
|
AppState().isLogged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,8 @@ enum MenuView {
|
||||||
|
|
||||||
enum MenuItem {
|
enum MenuItem {
|
||||||
button,
|
button,
|
||||||
card
|
card,
|
||||||
|
tile,
|
||||||
}
|
}
|
||||||
|
|
||||||
extension FFEnumExtensions<T extends Enum> on T {
|
extension FFEnumExtensions<T extends Enum> on T {
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
|
part 'connectivity_event.dart';
|
||||||
|
part 'connectivity_state.dart';
|
||||||
|
|
||||||
|
class ConnectivityBloc extends Bloc<ConnectivityEvent, ConnectivityState> {
|
||||||
|
final Connectivity _connectivity;
|
||||||
|
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
|
||||||
|
|
||||||
|
ConnectivityBloc(this._connectivity) : super(ConnectivityInitial()) {
|
||||||
|
on<ConnectivityChanged>(_onConnectivityChanged);
|
||||||
|
_connectivitySubscription = _connectivity.onConnectivityChanged.listen(
|
||||||
|
(List<ConnectivityResult> result) {
|
||||||
|
add(ConnectivityChanged(result.first));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onConnectivityChanged(
|
||||||
|
ConnectivityChanged event, Emitter<ConnectivityState> emit) {
|
||||||
|
if (event.result == ConnectivityResult.none) {
|
||||||
|
emit(ConnectivityFailure());
|
||||||
|
} else {
|
||||||
|
emit(ConnectivitySuccess());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> close() {
|
||||||
|
_connectivitySubscription.cancel();
|
||||||
|
return super.close();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
part of 'connectivity_bloc.dart';
|
||||||
|
|
||||||
|
abstract class ConnectivityEvent extends Equatable {
|
||||||
|
const ConnectivityEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConnectivityChanged extends ConnectivityEvent {
|
||||||
|
final ConnectivityResult result;
|
||||||
|
|
||||||
|
const ConnectivityChanged(this.result);
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [result];
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
part of 'connectivity_bloc.dart';
|
||||||
|
|
||||||
|
abstract class ConnectivityState extends Equatable {
|
||||||
|
const ConnectivityState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConnectivityInitial extends ConnectivityState {}
|
||||||
|
|
||||||
|
class ConnectivitySuccess extends ConnectivityState {}
|
||||||
|
|
||||||
|
class ConnectivityFailure extends ConnectivityState {}
|
|
@ -4,9 +4,6 @@ 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 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MenuButtonWidget extends MenuEntry {
|
class MenuButtonWidget extends MenuEntry {
|
||||||
const MenuButtonWidget({
|
const MenuButtonWidget({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -21,7 +18,6 @@ class MenuButtonWidget extends MenuEntry {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
|
@ -41,13 +37,11 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
blurRadius: 4.0,
|
blurRadius: 4.0,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor5,
|
||||||
FlutterFlowTheme.of(context).customColor5,
|
|
||||||
offset: const Offset(
|
offset: const Offset(
|
||||||
0.0,
|
0.0,
|
||||||
2.0,
|
2.0,
|
||||||
|
@ -69,36 +63,29 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
.fromSTEB(8.0, 0.0, 0.0, 0.0),
|
8.0, 0.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30.0,
|
width: 30.0,
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
widget.icon,
|
widget.icon,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.accent1,
|
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -109,30 +96,23 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.title ?? '',
|
widget.title ?? '',
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
.titleLarge
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts.asMap()
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
.containsKey('Nunito'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -4,9 +4,6 @@ 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 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MenuCardItem extends MenuEntry {
|
class MenuCardItem extends MenuEntry {
|
||||||
const MenuCardItem({
|
const MenuCardItem({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -21,7 +18,6 @@ class MenuCardItem extends MenuEntry {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MenuCardItemState createState() => _MenuCardItemState();
|
_MenuCardItemState createState() => _MenuCardItemState();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuCardItemState extends State<MenuCardItem> {
|
class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
|
@ -42,61 +38,46 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
child:
|
child: Align(
|
||||||
Align(
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
.fromSTEB(8.0, 0.0, 10.0, 0.0),
|
8.0, 0.0, 10.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30.0,
|
width: 30.0,
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
widget.icon,
|
widget.icon,
|
||||||
fill: null,
|
fill: null,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.accent1,
|
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.title ?? '',
|
widget.title ?? '',
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
.titleLarge
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts.asMap()
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
.containsKey('Nunito'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
abstract class MenuEntry extends StatefulWidget {
|
abstract class MenuEntry extends StatefulWidget {
|
||||||
|
@ -13,7 +11,4 @@ abstract class MenuEntry extends StatefulWidget {
|
||||||
final Function()? action;
|
final Function()? action;
|
||||||
final String? title;
|
final String? title;
|
||||||
final IconData? icon;
|
final IconData? icon;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -53,8 +53,9 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final options = widget.item == MenuItem.button
|
final options = () {
|
||||||
? <MenuEntry>[
|
if (widget.item == MenuItem.button) {
|
||||||
|
return <MenuEntry>[
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.kvector1,
|
icon: FFIcons.kvector1,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
@ -121,8 +122,10 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Preferências \nde Configurações',
|
ptText: 'Preferências \nde Configurações',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
];
|
||||||
: <MenuEntry>[
|
}
|
||||||
|
if (widget.item == MenuItem.card) {
|
||||||
|
return <MenuEntry>[
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: FFIcons.kvector1,
|
icon: FFIcons.kvector1,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
@ -190,6 +193,78 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
// if (MenuItem.tile)
|
||||||
|
return <MenuEntry>[
|
||||||
|
MenuCardItem(
|
||||||
|
icon: FFIcons.kvector1,
|
||||||
|
action: () async {
|
||||||
|
await _model.scheduleVisitOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Schedule\nVisit',
|
||||||
|
ptText: 'Agendar\nVisita',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: FFIcons.khome,
|
||||||
|
action: () async {
|
||||||
|
await _model.registerVisitorOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Register\nVisitor',
|
||||||
|
ptText: 'Cadastro\nde Visitante',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
|
await _model.accessQRCodeOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'QRCode\nAccess',
|
||||||
|
ptText: 'QRCode\nde Acesso',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.people,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Poeple on\nthe Property',
|
||||||
|
ptText: 'Pessoas\nna Propriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.history_sharp,
|
||||||
|
action: () async {
|
||||||
|
await _model.liberationHistoryOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Consult\nHistories',
|
||||||
|
ptText: 'Consultar\nHistoricos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.settings,
|
||||||
|
action: () async {
|
||||||
|
await _model.preferencesSettings(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Preferences\nSettings',
|
||||||
|
ptText: 'Preferências\nde Configuração',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}();
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
|
@ -231,7 +306,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
if (widget.style == MenuView.list &&
|
if (widget.style == MenuView.list &&
|
||||||
widget.expandable == false &&
|
widget.expandable == false &&
|
||||||
widget.item == MenuItem.card) {
|
widget.item == MenuItem.tile) {
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
model: _model.menuListViewComponentModel,
|
model: _model.menuListViewComponentModel,
|
||||||
updateCallback: () => setState(() {}),
|
updateCallback: () => setState(() {}),
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
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/menu_button_item/menu_button_item_widget.dart';
|
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
import '/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
@ -12,12 +11,10 @@ export 'menu_list_view_component_model.dart';
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
class MenuListViewComponentWidget extends StatefulWidget {
|
class MenuListViewComponentWidget extends StatefulWidget {
|
||||||
const MenuListViewComponentWidget({
|
const MenuListViewComponentWidget({
|
||||||
super.key,
|
super.key,
|
||||||
required this.changeMenuStyle,
|
required this.changeMenuStyle,
|
||||||
|
|
||||||
required this.expandable,
|
required this.expandable,
|
||||||
required this.item,
|
required this.item,
|
||||||
required this.options,
|
required this.options,
|
||||||
|
@ -70,14 +67,13 @@ class _MenuListViewComponentWidgetState
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
buildMenuItem(context),
|
buildMenuItem(context),
|
||||||
if (widget.expandable)
|
if (widget.expandable) buildExpandableButton(context),
|
||||||
buildExpandableButton(context),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildMenuItem(BuildContext context) {
|
Widget buildMenuItem(BuildContext context) {
|
||||||
switch(widget.item) {
|
switch (widget.item) {
|
||||||
case MenuItem.button:
|
case MenuItem.button:
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
|
@ -93,9 +89,7 @@ class _MenuListViewComponentWidgetState
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 115,
|
height: 115, width: 115, child: widget.options[index]),
|
||||||
width: 115,
|
|
||||||
child: widget.options[index]),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -115,15 +109,35 @@ class _MenuListViewComponentWidgetState
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 115,
|
height: 115, width: 115, child: widget.options[index]),
|
||||||
width: 115,
|
|
||||||
child: widget.options[index]),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
case MenuItem.tile:
|
||||||
|
return SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.7,
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
itemCount: widget.options.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.1,
|
||||||
|
child: widget.options[index],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return const Divider(thickness: 0.2);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row buildExpandableButton(BuildContext context) {
|
Row buildExpandableButton(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
|
@ -165,4 +179,3 @@ class _MenuListViewComponentWidgetState
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,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/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
|
||||||
|
|
||||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
||||||
const MenuStaggeredViewComponentWidget({
|
const MenuStaggeredViewComponentWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -93,9 +92,7 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 100,
|
height: 100, width: 100, child: widget.options[index]);
|
||||||
width: 100,
|
|
||||||
child: widget.options[index]);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
|
||||||
|
|
||||||
import 'form_field_controller.dart';
|
import 'form_field_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class FlutterFlowDropDown<T> extends StatefulWidget {
|
class FlutterFlowDropDown<T> extends StatefulWidget {
|
||||||
const FlutterFlowDropDown({
|
const FlutterFlowDropDown({
|
||||||
|
|
|
@ -4,14 +4,12 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.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/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart';
|
import 'package:hub/pages/no_connection_page/no_connection_page.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../../main.dart';
|
|
||||||
import '/backend/schema/structs/index.dart';
|
import '/backend/schema/structs/index.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/index.dart';
|
import '/index.dart';
|
||||||
import '../../pages/visit_history_page/visit_history_page_widget.dart';
|
|
||||||
|
|
||||||
export 'package:go_router/go_router.dart';
|
export 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
@ -79,6 +77,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
builder: (context, params) =>
|
builder: (context, params) =>
|
||||||
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
|
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
|
||||||
),
|
),
|
||||||
|
FFRoute(
|
||||||
|
name: 'no-connection',
|
||||||
|
path: '/no-connection',
|
||||||
|
builder: (context, params) => const NoConnectionScreen(),
|
||||||
|
),
|
||||||
// FFRoute(
|
// FFRoute(
|
||||||
// name: 'visitHistoryPage',
|
// name: 'visitHistoryPage',
|
||||||
// path: '/visitHistoryPage',
|
// path: '/visitHistoryPage',
|
||||||
|
|
|
@ -1,19 +1,22 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_web_plugins/url_strategy.dart';
|
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||||
import 'package:hub/backend/notifications/notification_service.dart';
|
import 'package:hub/backend/notifications/notification_service.dart';
|
||||||
|
import 'package:hub/blocs/connectivity_bloc/connectivity_bloc.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
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/pages/no_connection_page/no_connection_page.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:responsive_framework/responsive_framework.dart';
|
import 'package:responsive_framework/responsive_framework.dart';
|
||||||
|
|
||||||
|
@ -47,7 +50,17 @@ Future<void> initializeApp() async {
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
await initializeApp();
|
await initializeApp();
|
||||||
runApp(const App());
|
runApp(
|
||||||
|
MultiProvider(
|
||||||
|
providers: [
|
||||||
|
ChangeNotifierProvider(create: (_) => AppState()),
|
||||||
|
BlocProvider(
|
||||||
|
create: (context) => ConnectivityBloc(Connectivity()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
child: const App(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class App extends StatefulWidget {
|
class App extends StatefulWidget {
|
||||||
|
@ -91,10 +104,15 @@ class _AppState extends State<App> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MultiProvider(
|
return BlocListener<ConnectivityBloc, ConnectivityState>(
|
||||||
providers: [
|
listener: (context, state) {
|
||||||
ChangeNotifierProvider(create: (_) => AppState()),
|
if (state is ConnectivityFailure) {
|
||||||
],
|
Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const NoConnectionScreen()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
child: MaterialApp.router(
|
child: MaterialApp.router(
|
||||||
title: 'FREHub',
|
title: 'FREHub',
|
||||||
builder: (context, widget) => ResponsiveBreakpoints.builder(
|
builder: (context, widget) => ResponsiveBreakpoints.builder(
|
||||||
|
|
|
@ -11,9 +11,8 @@ import 'package:hub/flutter_flow/custom_functions.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/flutter_flow/flutter_flow_widgets.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:hub/pages/home_page/home_page_model.dart';
|
import 'package:hub/pages/home_page/home_page_model.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class HomePageWidget extends StatefulWidget {
|
class HomePageWidget extends StatefulWidget {
|
||||||
|
@ -28,14 +27,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
bool localStatus = false;
|
bool localStatus = false;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
Future<void> checkLocalStatus() async {
|
|
||||||
localStatus = await checkLocals(
|
|
||||||
context: context,
|
|
||||||
model: _model,
|
|
||||||
safeSetState: safeSetState,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
@ -55,27 +46,23 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
atividade: 'getDados')
|
atividade: 'getDados')
|
||||||
.then((value) async {
|
.then((value) async {
|
||||||
// value = await value;
|
// value = await value;
|
||||||
|
if (value.statusCode == 200 && value.jsonBody['error'] == false) {
|
||||||
AppState().whatsapp = value.jsonBody['whatsapp'];
|
AppState().whatsapp = value.jsonBody['whatsapp'];
|
||||||
AppState().provisional = value.jsonBody['provisional'];
|
AppState().provisional = value.jsonBody['provisional'];
|
||||||
|
} else {
|
||||||
|
DialogUtil.errorDefault(context);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}();
|
}();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
@override
|
localStatus = await checkLocals(
|
||||||
void initState() {
|
context: context,
|
||||||
// PhpGroup.getLocalsCall
|
model: _model,
|
||||||
// .call(
|
safeSetState: safeSetState,
|
||||||
// devUUID: AppState().devUUID,
|
);
|
||||||
// userUUID: AppState().userUUID,
|
|
||||||
// )
|
|
||||||
// .then((value) => log('getLocalsCall: $value'));
|
|
||||||
|
|
||||||
super.initState();
|
if (AppState().cliUUID.isEmpty) {
|
||||||
checkLocalStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
|
||||||
if (AppState().cliUUID == null || AppState().cliUUID.isEmpty) {
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: false,
|
isScrollControlled: false,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
@ -177,6 +164,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
item: MenuItem.button,
|
item: MenuItem.button,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Align(
|
// Align(
|
||||||
// alignment: const AlignmentDirectional(0.0, 0.0),
|
// alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
// child: Provider<MessageWellNotifier>(
|
// child: Provider<MessageWellNotifier>(
|
||||||
|
@ -189,6 +177,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
//footer
|
//footer
|
||||||
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
@ -551,55 +540,13 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
child: wrapWithModel(
|
child: wrapWithModel(
|
||||||
model: _model.menuComponentModel,
|
model: _model.menuComponentModel,
|
||||||
updateCallback: () => setState(() {}),
|
updateCallback: () => setState(() {}),
|
||||||
child: MenuComponentWidget(
|
child: const MenuComponentWidget(
|
||||||
expandable: false,
|
expandable: false,
|
||||||
style: MenuView.list,
|
style: MenuView.list,
|
||||||
item: MenuItem.card,
|
item: MenuItem.tile,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
FFButtonWidget(
|
|
||||||
onPressed: () async {
|
|
||||||
AppState().deleteAll();
|
|
||||||
setState(() {});
|
|
||||||
|
|
||||||
context.goNamed(
|
|
||||||
'welcomePage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: true,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
text: FFLocalizations.of(context).getText(
|
|
||||||
'xx0db4wi' /* Sair */,
|
|
||||||
),
|
|
||||||
options: FFButtonOptions(
|
|
||||||
height: 40.0,
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
iconPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: const Color(0x00D70000),
|
|
||||||
textStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
|
||||||
elevation: 0.0,
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
width: 0.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(50.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].addToEnd(const SizedBox(height: 64.0)),
|
].addToEnd(const SizedBox(height: 64.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class NoConnectionScreen extends StatelessWidget {
|
||||||
|
const NoConnectionScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Sem Conexão'),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.signal_wifi_off, size: 80),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
const Text(
|
||||||
|
'Você está offline. Verifique sua conexão com a internet.'),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// Tente reconectar
|
||||||
|
},
|
||||||
|
child: const Text('Tentar Novamente'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,8 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
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_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/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
@ -734,6 +731,30 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void logout(BuildContext context) async {
|
||||||
|
showAlertDialog(
|
||||||
|
context,
|
||||||
|
'Logout',
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Are you sure you want to logout?',
|
||||||
|
ptText: 'Tem certeza',
|
||||||
|
), () async {
|
||||||
|
AppState().deleteAll();
|
||||||
|
// setState(() {});
|
||||||
|
|
||||||
|
context.goNamed(
|
||||||
|
'welcomePage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
unfocusNode.dispose();
|
unfocusNode.dispose();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
@ -73,7 +72,7 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
// childAspectRatio: 1.0,
|
// childAspectRatio: 1.0,
|
||||||
// mainAxisExtent: 100.0,
|
// mainAxisExtent: 100.0,
|
||||||
// ),
|
// ),
|
||||||
itemCount: 7, // Assuming 4 items for simplicity
|
itemCount: 8, // Assuming 4 items for simplicity
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
@ -147,7 +146,7 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
case 5:
|
case 5:
|
||||||
icon = Icons.landscape;
|
icon = Icons.landscape;
|
||||||
onPressed = () => model.localUnlink(context);
|
onPressed = () => model.localUnlink(context);
|
||||||
isEnabled = true;
|
isEnabled = false;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Desative para se desvincular do local selecionado',
|
ptText: 'Desative para se desvincular do local selecionado',
|
||||||
enText: 'Enable to unlink from the selected location',
|
enText: 'Enable to unlink from the selected location',
|
||||||
|
@ -156,13 +155,23 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
case 6:
|
case 6:
|
||||||
icon = Icons.delete;
|
icon = Icons.delete;
|
||||||
onPressed = () => model.deleteAccount(context);
|
onPressed = () => model.deleteAccount(context);
|
||||||
isEnabled = true;
|
isEnabled = false;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText:
|
||||||
'Delete sua conta e todos os dados associados permanentemente.',
|
'Delete sua conta e todos os dados associados permanentemente.',
|
||||||
enText: 'Delete your account and all associated data permanently.',
|
enText: 'Delete your account and all associated data permanently.',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
icon = Icons.logout;
|
||||||
|
onPressed = () => model.logout(context);
|
||||||
|
isEnabled = false;
|
||||||
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Sair da conta atual e voltar para a tela de login.',
|
||||||
|
enText:
|
||||||
|
'Log out of the current account and return to the login screen.',
|
||||||
|
);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw Exception('Invalid index: $index');
|
throw Exception('Invalid index: $index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.3"
|
||||||
bloc:
|
bloc:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: bloc
|
name: bloc
|
||||||
sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
|
sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
|
||||||
|
|
|
@ -79,6 +79,7 @@ dependencies:
|
||||||
timeago: 3.6.1
|
timeago: 3.6.1
|
||||||
url_launcher: 6.3.0
|
url_launcher: 6.3.0
|
||||||
url_launcher_android: 6.3.3
|
url_launcher_android: 6.3.3
|
||||||
|
bloc: ^8.1.4
|
||||||
url_launcher_ios: 6.3.0
|
url_launcher_ios: 6.3.0
|
||||||
url_launcher_platform_interface: 2.3.2
|
url_launcher_platform_interface: 2.3.2
|
||||||
video_player: 2.8.7
|
video_player: 2.8.7
|
||||||
|
|
Loading…
Reference in New Issue