Merge branch 'main' into reception/fd-706
This commit is contained in:
commit
3294787d33
Binary file not shown.
After Width: | Height: | Size: 621 B |
|
@ -379,4 +379,4 @@ SPEC CHECKSUMS:
|
||||||
|
|
||||||
PODFILE CHECKSUM: 3bb356a4513d56583f2f2461d3d8eefb4cd4c3a4
|
PODFILE CHECKSUM: 3bb356a4513d56583f2f2461d3d8eefb4cd4c3a4
|
||||||
|
|
||||||
COCOAPODS: 1.14.3
|
COCOAPODS: 1.15.2
|
||||||
|
|
|
@ -390,12 +390,10 @@ Future<bool> checkLocals({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required FlutterFlowModel model,
|
required FlutterFlowModel model,
|
||||||
}) async {
|
}) async {
|
||||||
// A chamada para a API permanece a mesma, assumindo que é necessária sempre.
|
bool itemFound = false;
|
||||||
final response = await PhpGroup.getLocalsCall.call(
|
var modalResult;
|
||||||
devUUID: AppState().devUUID,
|
|
||||||
userUUID: AppState().userUUID,
|
|
||||||
);
|
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// Verificação rápida de erro para evitar processamento desnecessário.
|
// Verificação rápida de erro para evitar processamento desnecessário.
|
||||||
if (response.jsonBody['error']) {
|
if (response.jsonBody['error']) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -425,6 +423,53 @@ Future<bool> checkLocals({
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
do {
|
||||||
|
// A chamada para a API permanece a mesma, assumindo que é necessária sempre.
|
||||||
|
final response = await PhpGroup.getLocalsCall.call(
|
||||||
|
devUUID: AppState().devUUID,
|
||||||
|
userUUID: AppState().userUUID,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Verificação rápida de erro para evitar processamento desnecessário.
|
||||||
|
if (response.jsonBody['error']) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uso eficiente de coleções para verificar a condição desejada.
|
||||||
|
final String uuid = cliUUID ?? AppState().cliUUID;
|
||||||
|
itemFound = response.jsonBody['locais'].any(
|
||||||
|
(local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A",
|
||||||
|
);
|
||||||
|
|
||||||
|
// Log e retorno condicional baseado no resultado da busca.
|
||||||
|
if (itemFound) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
// A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada.
|
||||||
|
modalResult = await showModalBottomSheet(
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
enableDrag: false,
|
||||||
|
isDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (context) => GestureDetector(
|
||||||
|
onTap: () => model.unfocusNode.canRequestFocus
|
||||||
|
? FocusScope.of(context).requestFocus(model.unfocusNode)
|
||||||
|
: FocusScope.of(context).unfocus(),
|
||||||
|
child: Padding(
|
||||||
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
child: const BottomArrowLinkedLocalsComponentWidget(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
safeSetState(
|
||||||
|
() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários.
|
||||||
|
}
|
||||||
|
} while (modalResult != true);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
>>>>>>> main
|
||||||
}
|
}
|
||||||
|
|
||||||
Future answersRequest(BuildContext context, String? ref, String? task,
|
Future answersRequest(BuildContext context, String? ref, String? task,
|
||||||
|
|
|
@ -153,6 +153,12 @@ class AppState extends ChangeNotifier {
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_context = await secureStorage.getObject('ff_context') ?? _context;
|
_context = await secureStorage.getObject('ff_context') ?? _context;
|
||||||
});
|
});
|
||||||
|
await _safeInitAsync(() async {
|
||||||
|
_provisional = await secureStorage.getBool('provisional') ?? _provisional;
|
||||||
|
});
|
||||||
|
await _safeInitAsync(() async {
|
||||||
|
_whatsapp = await secureStorage.getBool('whatsapp') ?? _whatsapp;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(VoidCallback callback) {
|
void update(VoidCallback callback) {
|
||||||
|
@ -162,6 +168,28 @@ class AppState extends ChangeNotifier {
|
||||||
|
|
||||||
late FlutterSecureStorage secureStorage;
|
late FlutterSecureStorage secureStorage;
|
||||||
|
|
||||||
|
bool _whatsapp = false;
|
||||||
|
bool get whatsapp => _whatsapp;
|
||||||
|
set whatsapp(bool value) {
|
||||||
|
_whatsapp = value;
|
||||||
|
secureStorage.setBool('whatsapp', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteWhatsapp() {
|
||||||
|
secureStorage.delete(key: 'whatsapp');
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _provisional = false;
|
||||||
|
bool get provisional => _provisional;
|
||||||
|
set provisional(bool value) {
|
||||||
|
_provisional = value;
|
||||||
|
secureStorage.setBool('provisional', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteProvisional() {
|
||||||
|
secureStorage.delete(key: 'provisional');
|
||||||
|
}
|
||||||
|
|
||||||
BuildContext? _context;
|
BuildContext? _context;
|
||||||
BuildContext? get context => _context;
|
BuildContext? get context => _context;
|
||||||
set context(BuildContext? value) {
|
set context(BuildContext? value) {
|
||||||
|
@ -458,7 +486,35 @@ class AppState extends ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteAll() {
|
void deleteAll() {
|
||||||
|
AppState().deleteAccessPass();
|
||||||
|
AppState().deleteCliUUID();
|
||||||
|
AppState().deleteCreatedAt();
|
||||||
|
AppState().deleteDevUUID();
|
||||||
|
AppState().deleteDevice();
|
||||||
|
AppState().deleteEmail();
|
||||||
|
AppState().deleteFingerprint();
|
||||||
|
AppState().deleteFingerprintPass();
|
||||||
|
AppState().deleteIsLogged();
|
||||||
|
AppState().deleteLocal();
|
||||||
|
AppState().deleteName();
|
||||||
|
AppState().deleteOwnerUUID();
|
||||||
|
AppState().deletePass();
|
||||||
|
AppState().deletePasswd();
|
||||||
|
AppState().deletePerson();
|
||||||
|
AppState().deletePanic();
|
||||||
|
AppState().deletePanicPass();
|
||||||
|
AppState().deleteProvisional();
|
||||||
|
AppState().deleteStatus();
|
||||||
|
AppState().deleteToken();
|
||||||
|
AppState().deleteTokenAPNS();
|
||||||
|
AppState().deleteUpdatedAt();
|
||||||
|
AppState().deleteUserUUID();
|
||||||
|
AppState().deleteWhatsapp();
|
||||||
|
AppState().deleteContext();
|
||||||
|
AppState().deleteRemoteId();
|
||||||
|
AppState().deleteSerialNumber();
|
||||||
secureStorage.deleteAll();
|
secureStorage.deleteAll();
|
||||||
|
AppState().isLogged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -510,8 +510,6 @@ class ApiManager {
|
||||||
result = ApiCallResponse(null, {}, -1, exception: e);
|
result = ApiCallResponse(null, {}, -1, exception: e);
|
||||||
}
|
}
|
||||||
|
|
||||||
log('Params: $params');
|
|
||||||
log('JsonBody: ${result.jsonBody}');
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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> {
|
||||||
|
@ -30,119 +26,103 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await widget.action?.call();
|
await widget.action?.call();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
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: FlutterFlowTheme.of(context).customColor5,
|
||||||
color:
|
offset: const Offset(
|
||||||
FlutterFlowTheme.of(context).customColor5,
|
0.0,
|
||||||
offset: const Offset(
|
2.0,
|
||||||
0.0,
|
),
|
||||||
2.0,
|
)
|
||||||
),
|
],
|
||||||
)
|
borderRadius: BorderRadius.circular(24.0),
|
||||||
],
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(24.0),
|
border: Border.all(
|
||||||
shape: BoxShape.rectangle,
|
color: FlutterFlowTheme.of(context).alternate,
|
||||||
border: Border.all(
|
width: 0.5,
|
||||||
color: FlutterFlowTheme.of(context).alternate,
|
),
|
||||||
width: 0.5,
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
8.0, 0.0, 0.0, 0.0),
|
||||||
|
child: Container(
|
||||||
|
width: 30.0,
|
||||||
|
height: 30.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground,
|
||||||
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Icon(
|
||||||
padding: const EdgeInsets.all(4.0),
|
widget.icon,
|
||||||
child: Column(
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
mainAxisSize: MainAxisSize.min,
|
size: 24.0,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(8.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
width: 30.0,
|
|
||||||
height: 30.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Icon(
|
|
||||||
widget.icon,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.accent1,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
widget.title ?? '',
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.titleLarge
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
|
||||||
GoogleFonts.asMap()
|
|
||||||
.containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(height: 0.0)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Text(
|
||||||
|
widget.title ?? '',
|
||||||
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
useGoogleFonts:
|
||||||
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(height: 0.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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> {
|
||||||
|
@ -30,81 +26,66 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await widget.action?.call();
|
await widget.action?.call();
|
||||||
},
|
},
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
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:
|
child: Row(
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
mainAxisSize: MainAxisSize.max,
|
||||||
child: Row(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
Align(
|
||||||
children: [
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
Align(
|
child: Padding(
|
||||||
alignment: const AlignmentDirectional(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
-1.0, 0.0),
|
8.0, 0.0, 10.0, 0.0),
|
||||||
child: Padding(
|
child: Container(
|
||||||
padding: const EdgeInsetsDirectional
|
width: 30.0,
|
||||||
.fromSTEB(8.0, 0.0, 10.0, 0.0),
|
height: 30.0,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
width: 30.0,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
height: 30.0,
|
shape: BoxShape.circle,
|
||||||
decoration: BoxDecoration(
|
),
|
||||||
color:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
FlutterFlowTheme.of(context)
|
child: Icon(
|
||||||
.primaryBackground,
|
widget.icon,
|
||||||
shape: BoxShape.circle,
|
fill: null,
|
||||||
),
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
alignment:
|
size: 24.0,
|
||||||
const AlignmentDirectional(
|
),
|
||||||
0.0, 0.0),
|
),
|
||||||
child: Icon(
|
),
|
||||||
widget.icon,
|
),
|
||||||
fill: null,
|
Align(
|
||||||
color:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
FlutterFlowTheme.of(context)
|
child: Text(
|
||||||
.accent1,
|
widget.title ?? '',
|
||||||
size: 24.0,
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
),
|
fontFamily: 'Nunito',
|
||||||
),
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
fontSize: 14.0,
|
||||||
),
|
letterSpacing: 0.0,
|
||||||
Align(
|
fontWeight: FontWeight.w500,
|
||||||
alignment: const AlignmentDirectional(
|
useGoogleFonts:
|
||||||
0.0, 0.0),
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
child: Text(
|
|
||||||
widget.title ?? '',
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.titleLarge
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
|
||||||
GoogleFonts.asMap()
|
|
||||||
.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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart';
|
|
||||||
|
|
||||||
import '../../../flutter_flow/flutter_flow_model.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class ArrowLinkedLocalsComponentModel
|
|
||||||
extends FlutterFlowModel<ArrowLinkedLocalsComponentWidget> {
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class ArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
|
||||||
const ArrowLinkedLocalsComponentWidget({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ArrowLinkedLocalsComponentWidget> createState() =>
|
|
||||||
_ArrowLinkedLocalsComponentWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ArrowLinkedLocalsComponentWidgetState
|
|
||||||
extends State<ArrowLinkedLocalsComponentWidget> {
|
|
||||||
late ArrowLinkedLocalsComponentModel _model;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
_model.onUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_model = createModel(context, () => ArrowLinkedLocalsComponentModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.maybeDispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +1,14 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
||||||
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
|
@ -13,14 +19,20 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BottomArrowLinkedLocalsComponentWidget> createState() =>
|
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState();
|
||||||
_BottomArrowLinkedLocalsComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BottomArrowLinkedLocalsComponentWidgetState
|
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||||
extends State<BottomArrowLinkedLocalsComponentWidget> {
|
|
||||||
late BottomArrowLinkedLocalsComponentModel _model;
|
late BottomArrowLinkedLocalsComponentModel _model;
|
||||||
|
|
||||||
|
|
||||||
|
bool _loading = false;
|
||||||
|
bool _hasData = false;
|
||||||
|
|
||||||
|
late Future<void> _localsFuture;
|
||||||
|
List<dynamic> _localsWrap = [];
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
|
@ -30,8 +42,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model =
|
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||||
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
_localsFuture = _fetchLocals();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -41,247 +53,224 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _showNoMoreDataSnackBar(BuildContext context) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Não há mais dados.", enText: "No more data."),
|
||||||
|
),
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ApiCallResponse?> _fetchLocals() async {
|
||||||
|
try {
|
||||||
|
setState(() => _loading = true);
|
||||||
|
var response = await PhpGroup.getLocalsCall.call(
|
||||||
|
devUUID: AppState().devUUID,
|
||||||
|
userUUID: AppState().userUUID,
|
||||||
|
);
|
||||||
|
|
||||||
|
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||||
|
|
||||||
|
if (locals != null && locals.isNotEmpty) {
|
||||||
|
setState(() {
|
||||||
|
_localsWrap.addAll(locals);
|
||||||
|
_hasData = true;
|
||||||
|
_loading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
_showNoMoreDataSnackBar(context);
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
_hasData = false;
|
||||||
|
_loading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return null;
|
||||||
|
} catch (e, s) {
|
||||||
|
setState(() {
|
||||||
|
_hasData = false;
|
||||||
|
_loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
|
try {
|
||||||
|
var response = await PhpGroup.resopndeVinculo.call(
|
||||||
|
devUUID: AppState().devUUID,
|
||||||
|
userUUID: AppState().userUUID,
|
||||||
|
cliID: cliID,
|
||||||
|
tarefa: status
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.jsonBody['error'] == false) {
|
||||||
|
return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vinculo Ativado com Sucesso", enText: "Link Activated Successfully") };
|
||||||
|
} else {
|
||||||
|
return response.jsonBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e, s) {
|
||||||
|
DialogUtil.errorDefault(context);
|
||||||
|
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vinculo', e, s);
|
||||||
|
return {'error': true, 'error_msg': FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
||||||
|
enText: "Failed to perform operation, please try again later."
|
||||||
|
)};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _imagePath(dynamic local) {
|
||||||
|
return 'https://freaccess.com.br/freaccess/Images/Clients/${local['CLI_ID']}.png';
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> _labelsHashMap(dynamic local) {
|
||||||
|
return Map<String, String>.from({
|
||||||
|
'${local['CLI_PREFIXO']}:': local['CLI_NOME'],
|
||||||
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Color> _statusHashMap(dynamic local) {
|
||||||
|
return Map<String, Color>.from({
|
||||||
|
if (local['CLU_STATUS'] == 'A')
|
||||||
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success
|
||||||
|
else if (local['CLU_STATUS'] == 'B')
|
||||||
|
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
||||||
|
else
|
||||||
|
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _item(BuildContext context, dynamic local) {
|
||||||
|
return CardItemTemplateComponentWidget(
|
||||||
|
imagePath: _imagePath(local),
|
||||||
|
labelsHashMap: _labelsHashMap(local),
|
||||||
|
statusHashMap: [_statusHashMap(local)],
|
||||||
|
onTapCardItemAction: () async {
|
||||||
|
|
||||||
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
|
AppState().cliUUID = local['CLI_ID'];
|
||||||
|
AppState().local = local['CLI_NOME'];
|
||||||
|
AppState().ownerUUID = local['CLU_OWNER_ID'];
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else if (local['CLU_STATUS'] == 'B') {
|
||||||
|
String message = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
||||||
|
enText: 'Location Blocked for Access, Contact Administration'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (local['CLU_BLK_MESSAGE'] != null && local['CLU_BLK_MESSAGE'] != '') {
|
||||||
|
message = local['CLU_BLK_MESSAGE'];
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogUtil.warning(context, message);
|
||||||
|
_localsWrap = [];
|
||||||
|
_localsFuture = _fetchLocals();
|
||||||
|
} else {
|
||||||
|
String localName = local['CLI_NOME'];
|
||||||
|
showAlertDialog(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativar VInculo', enText: 'Activate Link'),
|
||||||
|
FFLocalizations.of(context).getVariableText(ptText: 'Deseja Aceitar o Vinculo a $localName?', enText: 'Do you wish to accept the link to $localName?'),
|
||||||
|
() async {
|
||||||
|
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||||
|
Navigator.pop(context);
|
||||||
|
if (response['error'] == true) {
|
||||||
|
DialogUtil.error(context, response['error_msg']);
|
||||||
|
} else {
|
||||||
|
DialogUtil.success(context, response['error_msg']);
|
||||||
|
_localsWrap = [];
|
||||||
|
_localsFuture = _fetchLocals();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _listItems(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
padding: const EdgeInsets.only(top: 15),
|
||||||
|
child: FutureBuilder<void>(
|
||||||
|
future: _localsFuture,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
return ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
itemCount: _localsWrap.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
final item = _localsWrap[index];
|
||||||
|
return _item(context, item);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<AppState>();
|
context.watch<AppState>();
|
||||||
|
|
||||||
|
double height = MediaQuery.sizeOf(context).height;
|
||||||
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0, 1),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 150.0,
|
height: height - (height * 0.5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(0.0),
|
topLeft: Radius.circular(25),
|
||||||
bottomRight: Radius.circular(0.0),
|
topRight: Radius.circular(25)
|
||||||
topLeft: Radius.circular(25.0),
|
)
|
||||||
topRight: Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
if (_hasData == false && _loading == false && _localsWrap.isEmpty)
|
||||||
child: Column(
|
Expanded(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.max,
|
||||||
Container(
|
children: [
|
||||||
height: 150.0,
|
Center(
|
||||||
decoration: const BoxDecoration(
|
child: Text(FFLocalizations.of(context).getVariableText(
|
||||||
borderRadius: BorderRadius.only(
|
ptText: "Nenhum Local Encontrado.",
|
||||||
bottomLeft: Radius.circular(0.0),
|
enText: "No local found")),
|
||||||
bottomRight: Radius.circular(0.0),
|
)
|
||||||
topLeft: Radius.circular(0.0),
|
],
|
||||||
topRight: Radius.circular(0.0),
|
),
|
||||||
),
|
)
|
||||||
),
|
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty)
|
||||||
child: Row(
|
Expanded(child: _listItems(context)),
|
||||||
mainAxisSize: MainAxisSize.max,
|
if (_loading == true)
|
||||||
children: [
|
Container(
|
||||||
Container(
|
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||||
width: 100.0,
|
child: Center(
|
||||||
height: 100.0,
|
child: CircularProgressIndicator(
|
||||||
decoration: BoxDecoration(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
color: FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context).primary,
|
||||||
.secondaryBackground,
|
|
||||||
),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
fillColor: FlutterFlowTheme.of(context).accent1,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.add,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () {},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: FutureBuilder<ApiCallResponse>(
|
|
||||||
future: PhpGroup.getLocalsCall.call(
|
|
||||||
devUUID: AppState().devUUID,
|
|
||||||
userUUID: AppState().userUUID,
|
|
||||||
),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
// Customize what your widget looks like when it's loading.
|
|
||||||
if (!snapshot.hasData) {
|
|
||||||
return Center(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 50.0,
|
|
||||||
height: 50.0,
|
|
||||||
child: SpinKitCircle(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 50.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
final gridViewGetLocalsResponse = snapshot.data!;
|
|
||||||
|
|
||||||
return Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final eachLocals = PhpGroup.getLocalsCall
|
|
||||||
.locais(
|
|
||||||
gridViewGetLocalsResponse.jsonBody,
|
|
||||||
)
|
|
||||||
?.map((e) => e)
|
|
||||||
.toList()
|
|
||||||
.toList() ??
|
|
||||||
[];
|
|
||||||
|
|
||||||
return GridView.builder(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
gridDelegate:
|
|
||||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 1,
|
|
||||||
crossAxisSpacing: 10.0,
|
|
||||||
mainAxisSpacing: 0.0,
|
|
||||||
childAspectRatio: 1.0,
|
|
||||||
),
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
itemCount: eachLocals.length,
|
|
||||||
itemBuilder: (context, eachLocalsIndex) {
|
|
||||||
final eachLocalsItem =
|
|
||||||
eachLocals[eachLocalsIndex];
|
|
||||||
return InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
AppState().cliUUID = getJsonField(
|
|
||||||
eachLocalsItem,
|
|
||||||
r'''$.CLI_ID''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
|
||||||
AppState().local = getJsonField(
|
|
||||||
eachLocalsItem,
|
|
||||||
r'''$.CLI_NOME''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
|
||||||
AppState().ownerUUID = getJsonField(
|
|
||||||
eachLocalsItem,
|
|
||||||
r'''$.CLU_OWNER_ID''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
width: 50.0,
|
|
||||||
height: double.infinity,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
alignment: const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.only(
|
|
||||||
bottomLeft:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
bottomRight:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
topLeft:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
topRight:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
border: Border.all(
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.secondaryText,
|
|
||||||
width: 3.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.only(
|
|
||||||
bottomLeft:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
bottomRight:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
topLeft:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
topRight:
|
|
||||||
Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
child: Image.network(
|
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
|
||||||
eachLocalsItem,
|
|
||||||
r'''$.CLI_ID''',
|
|
||||||
).toString()}.png',
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
fit: BoxFit.fill,
|
|
||||||
alignment: const Alignment(
|
|
||||||
0.0, 0.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 10.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
getJsonField(
|
|
||||||
eachLocalsItem,
|
|
||||||
r'''$.CLI_NOME''',
|
|
||||||
).toString(),
|
|
||||||
style: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].addToStart(const SizedBox(width: 20.0)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
)
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
|
||||||
import '/flutter_flow/custom_functions.dart' as functions;
|
|
||||||
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:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||||
|
import '/flutter_flow/custom_functions.dart' as functions;
|
||||||
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'local_profile_component_model.dart';
|
import 'local_profile_component_model.dart';
|
||||||
|
|
||||||
export 'local_profile_component_model.dart';
|
export 'local_profile_component_model.dart';
|
||||||
|
|
||||||
////
|
////
|
||||||
|
@ -78,6 +81,8 @@ class _LocalProfileComponentWidgetState
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: const Color(0x00FFFFFF),
|
backgroundColor: const Color(0x00FFFFFF),
|
||||||
context: context,
|
context: context,
|
||||||
|
enableDrag: false,
|
||||||
|
isDismissible: false,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
@ -91,46 +96,38 @@ class _LocalProfileComponentWidgetState
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
|
imageUrl: valueOrDefault(
|
||||||
|
'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
|
||||||
|
'assets/images/error_image.svg'),
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
alignment: const Alignment(0.0, 0.0),
|
alignment: const Alignment(0.0, 0.0),
|
||||||
errorBuilder: (context, error, stackTrace) =>
|
placeholder: (context, url) =>
|
||||||
Image.network(
|
Image.asset('assets/images/error_image.svg'),
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
errorListener: (_) =>
|
||||||
width: 80.0,
|
Image.asset('assets/images/error_image.svg'),
|
||||||
height: 80.0,
|
errorWidget: (_, __, ___) =>
|
||||||
fit: BoxFit.cover,
|
Image.asset('assets/images/error_image.svg'),
|
||||||
alignment: const Alignment(0.0, 0.0),
|
),
|
||||||
errorBuilder: (context, error, stackTrace) =>
|
)),
|
||||||
Image.asset('assets/images/error_image.svg'),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Text(
|
||||||
mainAxisSize: MainAxisSize.max,
|
valueOrDefault<String>(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
functions.convertToUppercase(AppState().local),
|
||||||
children: [
|
'NOME DO LOCAL',
|
||||||
Text(
|
),
|
||||||
valueOrDefault<String>(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
functions.convertToUppercase(AppState().local),
|
fontFamily: 'Nunito',
|
||||||
'NOME DO LOCAL',
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
useGoogleFonts:
|
||||||
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
|
||||||
GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.divide(const SizedBox(width: 20.0))
|
.divide(const SizedBox(width: 20.0))
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
@ -7,8 +9,6 @@ import '/components/organism_components/menu_list_view_component/menu_list_view_
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'menu_component_widget.dart' show MenuComponentWidget;
|
import 'menu_component_widget.dart' show MenuComponentWidget;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
/// Local state fields for this component.
|
/// Local state fields for this component.
|
||||||
|
|
||||||
|
@ -42,36 +42,46 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future scheduleVisitOptAction(BuildContext context) async {
|
Future scheduleVisitOptAction(BuildContext context) async {
|
||||||
|
final isWpp = AppState().whatsapp;
|
||||||
|
final isProvisional = AppState().provisional;
|
||||||
|
log("isWpp ${isWpp ? 1 : 0}");
|
||||||
|
|
||||||
|
final routesListStr = <String>[
|
||||||
|
'scheduleCompleteVisitPage',
|
||||||
|
if (isProvisional) 'scheduleProvisionalVisitPage',
|
||||||
|
if (isWpp) 'fastPassPage',
|
||||||
|
];
|
||||||
|
final iconsListIcon = <IconData>[
|
||||||
|
Icons.date_range_rounded,
|
||||||
|
if (isProvisional) Icons.date_range_rounded,
|
||||||
|
if (isWpp) Icons.date_range_rounded,
|
||||||
|
];
|
||||||
|
final nameListStr = <String>[
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Visita\nCompleta',
|
||||||
|
enText: 'Complete\nSchedule',
|
||||||
|
),
|
||||||
|
if (isProvisional)
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Visita\nProvisória',
|
||||||
|
enText: 'Provisional\nSchedule',
|
||||||
|
),
|
||||||
|
if (isWpp)
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Visita\nRápida',
|
||||||
|
enText: 'Fast\nSchedule',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: OptionSelectionModalWidget(
|
child: OptionSelectionModalWidget(
|
||||||
routesListStr: <String>[
|
routesListStr: routesListStr,
|
||||||
'scheduleCompleteVisitPage',
|
iconsListIcon: iconsListIcon,
|
||||||
'scheduleProvisionalVisitPage',
|
nameListStr: nameListStr,
|
||||||
'fastPassPage',
|
|
||||||
],
|
|
||||||
iconsListIcon: <IconData>[
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
Icons.date_range_rounded,
|
|
||||||
],
|
|
||||||
nameListStr: <String>[
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nCompleta',
|
|
||||||
enText: 'Complete\nSchedule',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nProvisória',
|
|
||||||
enText: 'Provisional\nSchedule',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Visita\nRápida',
|
|
||||||
enText: 'Fast\nSchedule',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -103,6 +113,30 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> signOut(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,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Future preferencesSettings(BuildContext context) async {
|
Future preferencesSettings(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'preferencesSettings',
|
'preferencesSettings',
|
||||||
|
@ -113,7 +147,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
).then((value) => true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future liberationHistoryOptAction(BuildContext context) async {
|
Future liberationHistoryOptAction(BuildContext context) async {
|
||||||
|
@ -175,7 +209,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future messageHistoryAction(BuildContext context) async {
|
Future messageHistoryAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'messageHistoryPage',
|
'messageHistoryPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -187,6 +221,4 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
import 'dart:developer';
|
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/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/atomic_components/menu_card_item/menu_card_item.dart';
|
||||||
|
@ -9,8 +8,8 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
||||||
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'menu_component_model.dart';
|
import 'menu_component_model.dart';
|
||||||
|
|
||||||
export 'menu_component_model.dart';
|
export 'menu_component_model.dart';
|
||||||
|
|
||||||
class MenuComponentWidget extends StatefulWidget {
|
class MenuComponentWidget extends StatefulWidget {
|
||||||
|
@ -49,161 +48,234 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
||||||
|
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final options = widget.item == MenuItem.button
|
final options = () {
|
||||||
? <MenuEntry>[
|
if (widget.item == MenuItem.button) {
|
||||||
MenuButtonWidget(
|
return <MenuEntry>[
|
||||||
icon: FFIcons.kvector1,
|
MenuButtonWidget(
|
||||||
action: () async {
|
icon: FFIcons.kvector1,
|
||||||
await _model.scheduleVisitOptAction(context);
|
action: () async {
|
||||||
setState(() {});
|
await _model.scheduleVisitOptAction(context);
|
||||||
},
|
setState(() {});
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
},
|
||||||
enText: 'Schedule\nVisit',
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Agendar\nVisita',
|
enText: 'Schedule\nVisit',
|
||||||
),
|
ptText: 'Agendar\nVisita',
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.khome,
|
icon: FFIcons.khome,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.registerVisitorOptAction(context);
|
await _model.registerVisitorOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Register\nVisitor',
|
enText: 'Register\nVisitor',
|
||||||
ptText: 'Cadastro\nde Visitante',
|
ptText: 'Cadastro\nde Visitante',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
MenuButtonWidget(
|
||||||
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
MenuButtonWidget(
|
await _model.accessQRCodeOptAction(context);
|
||||||
icon: Icons.qr_code,
|
setState(() {});
|
||||||
action: () async {
|
},
|
||||||
await _model.accessQRCodeOptAction(context);
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
setState(() {});
|
enText: 'QRCode\nAccess',
|
||||||
},
|
ptText: 'QRCode\nde Acesso',
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'QRCode\nAccess',
|
|
||||||
ptText: 'QRCode\nde Acesso',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.people,
|
icon: Icons.people,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.peopleOnThePropertyAction(context);
|
await _model.peopleOnThePropertyAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Poeple on\nthe Property',
|
enText: 'Poeple on\nthe Property',
|
||||||
ptText: 'Pessoas na\nPropriedade',
|
ptText: 'Pessoas na\nPropriedade',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.history_sharp,
|
icon: Icons.history_sharp,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.liberationHistoryOptAction(context);
|
await _model.liberationHistoryOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Consult\nHistories',
|
enText: 'Consult\nHistories',
|
||||||
ptText: 'Consultar\nHistóricos',
|
ptText: 'Consultar\nHistóricos',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.settings,
|
icon: Icons.settings,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.preferencesSettings(context);
|
await _model.preferencesSettings(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Preferences\nSettings',
|
enText: 'Preferences\nSettings',
|
||||||
ptText: 'Preferências \nde Configurações',
|
ptText: 'Preferências \nde Configurações',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
: <MenuEntry>[
|
];
|
||||||
MenuCardItem(
|
}
|
||||||
icon: FFIcons.kvector1,
|
if (widget.item == MenuItem.card) {
|
||||||
action: () async {
|
return <MenuEntry>[
|
||||||
await _model.scheduleVisitOptAction(context);
|
MenuCardItem(
|
||||||
setState(() {});
|
icon: FFIcons.kvector1,
|
||||||
},
|
action: () async {
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
await _model.scheduleVisitOptAction(context);
|
||||||
enText: 'Schedule\nVisit',
|
setState(() {});
|
||||||
ptText: 'Agendar\nVisita',
|
},
|
||||||
),
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Schedule\nVisit',
|
||||||
|
ptText: 'Agendar\nVisita',
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: FFIcons.khome,
|
icon: FFIcons.khome,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.registerVisitorOptAction(context);
|
await _model.registerVisitorOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Register\nVisitor',
|
enText: 'Register\nVisitor',
|
||||||
ptText: 'Cadastro\nde Visitante',
|
ptText: 'Cadastro\nde Visitante',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
MenuCardItem(
|
||||||
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
MenuCardItem(
|
await _model.accessQRCodeOptAction(context);
|
||||||
icon: Icons.qr_code,
|
setState(() {});
|
||||||
action: () async {
|
},
|
||||||
await _model.accessQRCodeOptAction(context);
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
setState(() {});
|
enText: 'QRCode\nAccess',
|
||||||
},
|
ptText: 'QRCode\nde Acesso',
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'QRCode\nAccess',
|
|
||||||
ptText: 'QRCode\nde Acesso',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.people,
|
icon: Icons.people,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.peopleOnThePropertyAction(context);
|
await _model.peopleOnThePropertyAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Poeple on\nthe Property',
|
enText: 'Poeple on\nthe Property',
|
||||||
ptText: 'Pessoas\nna Propriedade',
|
ptText: 'Pessoas\nna Propriedade',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.history_sharp,
|
icon: Icons.history_sharp,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.liberationHistoryOptAction(context);
|
await _model.liberationHistoryOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Consult\nHistories',
|
enText: 'Consult\nHistories',
|
||||||
ptText: 'Consultar\nHistoricos',
|
ptText: 'Consultar\nHistoricos',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.settings,
|
icon: Icons.settings,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.preferencesSettings(context);
|
await _model.preferencesSettings(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Preferences\nSettings',
|
enText: 'Preferences\nSettings',
|
||||||
ptText: 'Preferências\nde Configuração',
|
ptText: 'Preferências\nde Configuração',
|
||||||
),
|
|
||||||
),
|
),
|
||||||
];
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// if (MenuItem.tile)
|
||||||
|
return <MenuEntry>[
|
||||||
|
MenuCardItem(
|
||||||
|
icon: FFIcons.kvector1,
|
||||||
|
action: () async {
|
||||||
|
await _model.scheduleVisitOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Schedule Visit',
|
||||||
|
ptText: 'Agendar Visita',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: FFIcons.khome,
|
||||||
|
action: () async {
|
||||||
|
await _model.registerVisitorOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Register Visitor',
|
||||||
|
ptText: 'Cadastro de Visitante',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
|
await _model.accessQRCodeOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'QRCode Access',
|
||||||
|
ptText: 'QRCode de Acesso',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.people,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Poeple on the Property',
|
||||||
|
ptText: 'Pessoas na Propriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.history_sharp,
|
||||||
|
action: () async {
|
||||||
|
await _model.liberationHistoryOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Consult Histories',
|
||||||
|
ptText: 'Consultar Historicos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.logout,
|
||||||
|
action: () async {
|
||||||
|
await _model.signOut(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Logout Account',
|
||||||
|
ptText: 'Sair da Conta',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.settings,
|
||||||
|
action: () async {
|
||||||
|
await _model.preferencesSettings(context).then((value) => value);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Preferences Settings',
|
||||||
|
ptText: 'Preferências de 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(
|
||||||
|
@ -245,7 +317,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,99 +67,115 @@ 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,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
addAutomaticKeepAlives: true,
|
addAutomaticKeepAlives: true,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: widget.options.length,
|
itemCount: widget.options.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
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.card:
|
case MenuItem.card:
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: MediaQuery.sizeOf(context).height * 0.8,
|
height: MediaQuery.sizeOf(context).height * 0.8,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
addAutomaticKeepAlives: true,
|
addAutomaticKeepAlives: true,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
itemCount: widget.options.length,
|
itemCount: widget.options.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
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.08,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.08,
|
||||||
|
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(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Expand',
|
enText: 'Expand',
|
||||||
ptText: 'Expandir',
|
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(
|
style: FlutterFlowTheme.of(context).title1.override(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
fontFamily: 'Nunito',
|
||||||
child: FlutterFlowIconButton(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
borderColor: Colors.transparent,
|
fontSize: 12.0,
|
||||||
borderRadius: 20.0,
|
fontWeight: FontWeight.w600,
|
||||||
borderWidth: 0.0,
|
fontStyle: FontStyle.normal,
|
||||||
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();
|
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();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
);
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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]);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -123,12 +120,12 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
ptText: 'Minimizar',
|
ptText: 'Minimizar',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).title1.override(
|
style: FlutterFlowTheme.of(context).title1.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontStyle: FontStyle.normal,
|
fontStyle: FontStyle.normal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
|
|
||||||
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class UpArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
class UpArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
|
@ -185,11 +183,12 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
topLeft: Radius.circular(25.0),
|
topLeft: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(25.0),
|
topRight: Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
imageUrl:
|
||||||
|
"https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
||||||
eachLocalsItem,
|
eachLocalsItem,
|
||||||
r'''$.CLI_ID''',
|
r'''$.CLI_ID''',
|
||||||
).toString()}.png',
|
).toString()}.png",
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.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 '/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'visitor_details_modal_template_component_model.dart';
|
import 'visitor_details_modal_template_component_model.dart';
|
||||||
|
|
||||||
export 'visitor_details_modal_template_component_model.dart';
|
export 'visitor_details_modal_template_component_model.dart';
|
||||||
|
|
||||||
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
||||||
|
@ -125,8 +128,8 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
widget.visitorImageURL!,
|
imageUrl: widget.visitorImageURL!,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -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,15 +4,17 @@ 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';
|
||||||
|
<<<<<<< HEAD
|
||||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart';
|
import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart';
|
||||||
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
||||||
|
=======
|
||||||
|
import 'package:hub/pages/no_connection_page/no_connection_page.dart';
|
||||||
|
>>>>>>> main
|
||||||
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';
|
||||||
|
|
||||||
|
@ -83,9 +85,21 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
|
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
|
||||||
),
|
),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
|
<<<<<<< HEAD
|
||||||
name: 'receptionPage',
|
name: 'receptionPage',
|
||||||
path: '/receptionPage',
|
path: '/receptionPage',
|
||||||
builder: (context, params) => const ReceptionPageWidget()),
|
builder: (context, params) => const ReceptionPageWidget()),
|
||||||
|
=======
|
||||||
|
name: 'no-connection',
|
||||||
|
path: '/no-connection',
|
||||||
|
builder: (context, params) => const NoConnectionScreen(),
|
||||||
|
),
|
||||||
|
// FFRoute(
|
||||||
|
// name: 'visitHistoryPage',
|
||||||
|
// path: '/visitHistoryPage',
|
||||||
|
// builder: (context, params) => const VisitHistoryPageWidget(),
|
||||||
|
// ),
|
||||||
|
>>>>>>> main
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'messageHistoryPage',
|
name: 'messageHistoryPage',
|
||||||
path: '/messageHistoryPage',
|
path: '/messageHistoryPage',
|
||||||
|
|
|
@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.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/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:developer';
|
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:hub/actions/actions.dart';
|
import 'package:hub/actions/actions.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||||
import 'package:hub/backend/schema/enums/enums.dart';
|
import 'package:hub/backend/schema/enums/enums.dart';
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||||
|
@ -12,9 +12,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 {
|
||||||
|
@ -29,6 +28,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
bool localStatus = false;
|
bool localStatus = false;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
Future<void> checkLocalStatus() async {
|
Future<void> checkLocalStatus() async {
|
||||||
localStatus = await checkLocals(
|
localStatus = await checkLocals(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -36,6 +36,8 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> main
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
@ -46,31 +48,52 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
() async {
|
() async {
|
||||||
await FirebaseMessagingService().updateDeviceToken();
|
await FirebaseMessagingService().updateDeviceToken();
|
||||||
}();
|
}();
|
||||||
|
void fetchData() async {
|
||||||
|
bool success = false;
|
||||||
|
while (!success) {
|
||||||
|
final response = await PhpGroup.getDadosCall.call(
|
||||||
|
devUUID: AppState().devUUID,
|
||||||
|
userUUID: AppState().userUUID,
|
||||||
|
cliUUID: AppState().cliUUID,
|
||||||
|
atividade: 'getDados',
|
||||||
|
);
|
||||||
|
|
||||||
|
switch (response.statusCode) {
|
||||||
|
case 200:
|
||||||
|
if (response.jsonBody['error'] == false) {
|
||||||
|
success = true;
|
||||||
|
AppState().whatsapp = response.jsonBody['whatsapp'];
|
||||||
|
AppState().provisional = response.jsonBody['provisional'];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
await DialogUtil.warningDefault(context);
|
||||||
|
safeSetState(() {});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchData();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
@override
|
localStatus = await checkLocals(
|
||||||
void initState() {
|
context: context,
|
||||||
super.initState();
|
model: _model,
|
||||||
checkLocalStatus();
|
safeSetState: safeSetState,
|
||||||
}
|
);
|
||||||
|
|
||||||
// Rest of your code...
|
if (AppState().cliUUID.isEmpty) {
|
||||||
if (AppState().cliUUID == null || AppState().cliUUID.isEmpty) {
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: false,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
enableDrag: false,
|
enableDrag: false,
|
||||||
isDismissible: false,
|
isDismissible: false,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return GestureDetector(
|
return Padding(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
child: const BottomArrowLinkedLocalsComponentWidget(),
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: const BottomArrowLinkedLocalsComponentWidget(),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
|
@ -180,7 +203,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
Widget createLocal(bool localStatus) {
|
Widget createLocal(bool localStatus) {
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
model: _model.localComponentModel,
|
model: _model.localComponentModel,
|
||||||
updateCallback: () => setState(() {}),
|
updateCallback: () => safeSetState(() {}),
|
||||||
child: LocalProfileComponentWidget(
|
child: LocalProfileComponentWidget(
|
||||||
localStatus: localStatus,
|
localStatus: localStatus,
|
||||||
),
|
),
|
||||||
|
@ -240,8 +263,8 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
60.0, 15.0, 0.0, 0.0),
|
60.0, 15.0, 0.0, 0.0),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: Image.network(
|
child: Image.asset(
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png',
|
'assets/images/logo.png',
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
fit: BoxFit.none,
|
fit: BoxFit.none,
|
||||||
|
@ -255,9 +278,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
0.0, 15.0, 0.0, 0.0),
|
0.0, 15.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
'FRE ACCESS',
|
||||||
'rg9pzkpz' /* FRE ACCESS */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
|
@ -278,28 +299,28 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
// Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
// alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Container(
|
// child: Container(
|
||||||
width: 100.0,
|
// width: 100.0,
|
||||||
height: 50.0,
|
// height: 50.0,
|
||||||
decoration: const BoxDecoration(),
|
// decoration: const BoxDecoration(),
|
||||||
child: Align(
|
// child: Align(
|
||||||
alignment: const AlignmentDirectional(1.0, 1.0),
|
// alignment: const AlignmentDirectional(1.0, 1.0),
|
||||||
child: FlutterFlowIconButton(
|
// child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
// borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
// borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
// buttonSize: 40.0,
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.notifications_sharp,
|
// Icons.notifications_sharp,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
// color: FlutterFlowTheme.of(context).info,
|
||||||
size: 24.0,
|
// size: 24.0,
|
||||||
),
|
// ),
|
||||||
onPressed: () {},
|
// onPressed: () {},
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -310,7 +331,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
|
|
||||||
SizedBox buildDrawer(BuildContext context) {
|
SizedBox buildDrawer(BuildContext context) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 750.0,
|
width: MediaQuery.of(context).size.width * 0.8,
|
||||||
child: Drawer(
|
child: Drawer(
|
||||||
elevation: 16.0,
|
elevation: 16.0,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -358,12 +379,21 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
valueOrDefault<String>(
|
imageUrl: valueOrDefault(
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
|
'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
'assets/images/error_image.svg'),
|
||||||
),
|
width: 80.0,
|
||||||
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
placeholder: (context, url) =>
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/error_image.svg'),
|
||||||
|
errorListener: (_) => Image.asset(
|
||||||
|
'assets/images/error_image.svg'),
|
||||||
|
errorWidget: (_, __, ___) => Image.asset(
|
||||||
|
'assets/images/error_image.svg'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
@ -391,40 +421,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
|
||||||
width: 50.0,
|
|
||||||
child: Container(
|
|
||||||
height: 30.0,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderRadius: 100.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.close_sharp,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
size: 20.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
if (scaffoldKey
|
|
||||||
.currentState!.isDrawerOpen ||
|
|
||||||
scaffoldKey.currentState!
|
|
||||||
.isEndDrawerOpen) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
.divide(const SizedBox(width: 0.0))
|
.divide(const SizedBox(width: 0.0))
|
||||||
.around(const SizedBox(width: 0.0)),
|
.around(const SizedBox(width: 0.0)),
|
||||||
|
@ -528,59 +524,19 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: wrapWithModel(
|
child: SingleChildScrollView(
|
||||||
model: _model.menuComponentModel,
|
child: wrapWithModel(
|
||||||
updateCallback: () => setState(() {}),
|
model: _model.menuComponentModel,
|
||||||
child: MenuComponentWidget(
|
updateCallback: () => setState(() {}),
|
||||||
expandable: false,
|
child: const MenuComponentWidget(
|
||||||
style: MenuView.list,
|
expandable: false,
|
||||||
item: MenuItem.card,
|
style: MenuView.list,
|
||||||
|
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)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -148,7 +148,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
Center(
|
Center(
|
||||||
child: Text(FFLocalizations.of(context).getVariableText(
|
child: Text(FFLocalizations.of(context).getVariableText(
|
||||||
ptText: "Nenhuma solicitação encontrada!",
|
ptText: "Nenhuma solicitação encontrada!",
|
||||||
enText: "No visit found")),
|
enText: "No requests found")),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -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';
|
||||||
|
@ -316,8 +313,18 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
AppState().deleteCliUUID();
|
AppState().deleteCliUUID();
|
||||||
AppState().deleteLocal();
|
AppState().deleteLocal();
|
||||||
AppState().deleteOwnerUUID();
|
AppState().deleteOwnerUUID();
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context, true);
|
||||||
|
context.goNamed(
|
||||||
|
'homePage',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: true,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
@ -734,6 +741,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';
|
||||||
|
@ -66,7 +65,18 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
<<<<<<< HEAD
|
||||||
itemCount: 7, // Assuming 4 items for simplicity
|
itemCount: 7, // Assuming 4 items for simplicity
|
||||||
|
=======
|
||||||
|
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
// crossAxisCount: 3,
|
||||||
|
// crossAxisSpacing: 12.0,
|
||||||
|
// mainAxisSpacing: 12.0,
|
||||||
|
// childAspectRatio: 1.0,
|
||||||
|
// mainAxisExtent: 100.0,
|
||||||
|
// ),
|
||||||
|
itemCount: 8, // Assuming 4 items for simplicity
|
||||||
|
>>>>>>> main
|
||||||
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) {
|
||||||
|
@ -140,7 +150,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',
|
||||||
|
@ -149,13 +159,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');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1114,9 +1114,7 @@ Widget scheduleVisit(BuildContext context,
|
||||||
if (value.contains('{') &&
|
if (value.contains('{') &&
|
||||||
value.contains('}') &&
|
value.contains('}') &&
|
||||||
value.contains(':')) {
|
value.contains(':')) {
|
||||||
// log("Valor e um Objeto | Usuário Escolheu o Motivo ${_model.dropDownValue1}");
|
|
||||||
} else {
|
} else {
|
||||||
// log("Valor e uma String | Usuário Escolheu o Motivo ${_model.dropDownValue1}");
|
|
||||||
if (reasonsJsonList != null &&
|
if (reasonsJsonList != null &&
|
||||||
reasonsJsonList.isNotEmpty) {
|
reasonsJsonList.isNotEmpty) {
|
||||||
var item = reasonsJsonList.where(
|
var item = reasonsJsonList.where(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -8,24 +7,34 @@ class DialogUtil {
|
||||||
static const double _height = 350;
|
static const double _height = 350;
|
||||||
|
|
||||||
static Future<dynamic> errorDefault(BuildContext context) {
|
static Future<dynamic> errorDefault(BuildContext context) {
|
||||||
return error(context, FFLocalizations.of(context).getVariableText(
|
return error(
|
||||||
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
context,
|
||||||
enText: "Failed to perform operation, please try again later."
|
FFLocalizations.of(context).getVariableText(
|
||||||
));
|
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
||||||
|
enText: "Failed to perform operation, please try again later."));
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> warningDefault(BuildContext context) {
|
||||||
|
return warning(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Atenção, algo deu errado. Tente novamente mais tarde.",
|
||||||
|
enText: "Warning, something went wrong. Try again later."))
|
||||||
|
.then((value) => value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<dynamic> error(BuildContext context, String message) async {
|
static Future<dynamic> error(BuildContext context, String message) async {
|
||||||
return await showDialog(
|
return await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: _height,
|
height: _height,
|
||||||
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error))
|
child: Padding(
|
||||||
)
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
);
|
child: ThrowExceptionWidget(
|
||||||
}
|
msg: message, type: EnumThrowException.error))));
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<dynamic> warning(BuildContext context, String message) async {
|
static Future<dynamic> warning(BuildContext context, String message) async {
|
||||||
|
@ -35,11 +44,11 @@ class DialogUtil {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: _height,
|
height: _height,
|
||||||
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning))
|
child: Padding(
|
||||||
)
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
);
|
child: ThrowExceptionWidget(
|
||||||
}
|
msg: message, type: EnumThrowException.warning))));
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<dynamic> success(BuildContext context, String message) async {
|
static Future<dynamic> success(BuildContext context, String message) async {
|
||||||
|
@ -49,11 +58,10 @@ class DialogUtil {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: _height,
|
height: _height,
|
||||||
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success))
|
child: Padding(
|
||||||
)
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
);
|
child: ThrowExceptionWidget(
|
||||||
}
|
msg: message, type: EnumThrowException.success))));
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue