This commit is contained in:
J. A. Messias 2024-11-11 17:32:32 -03:00
parent 5e10f6cc65
commit b88cd3e8bd
18 changed files with 100 additions and 109 deletions

View File

@ -63,12 +63,9 @@ class PhpGroup {
class GetOpenedVisits { class GetOpenedVisits {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String userUUID = final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String cliID =
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
const String atividade = 'getOpenedVisits'; const String atividade = 'getOpenedVisits';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
@ -98,12 +95,9 @@ class GetOpenedVisits {
class GetResidentsByProperty { class GetResidentsByProperty {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String userUUID = final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String cliID =
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
const String atividade = 'getResidentsByProperty'; const String atividade = 'getResidentsByProperty';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
@ -132,12 +126,9 @@ class GetResidentsByProperty {
class GetVehiclesByProperty { class GetVehiclesByProperty {
Future<ApiCallResponse> call(final String page) async { Future<ApiCallResponse> call(final String page) async {
final String baseUrl = PhpGroup.getBaseUrl(); final String baseUrl = PhpGroup.getBaseUrl();
final String devUUID = final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String userUUID = final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
final String cliID =
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
const String atividade = 'getVehiclesByProperty'; const String atividade = 'getVehiclesByProperty';
const String pageSize = '10'; const String pageSize = '10';
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(

View File

@ -3,7 +3,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart';
class MenuButtonWidget extends MenuEntry { class MenuButtonWidget extends MenuEntry {
const MenuButtonWidget({ const MenuButtonWidget({
super.key, super.key,

View File

@ -3,7 +3,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart';
class MenuCardItem extends MenuEntry { class MenuCardItem extends MenuEntry {
const MenuCardItem({ const MenuCardItem({
super.key, super.key,

View File

@ -1,7 +1,6 @@
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 '/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';

View File

@ -175,7 +175,7 @@ class _CardItemTemplateComponentWidgetState extends State<CardItemTemplateCompon
.addToStart(const SizedBox(height: 5)), .addToStart(const SizedBox(height: 5)),
), ),
), ),
if(widget.imagePath != null) _generateImage(), if (widget.imagePath != null) _generateImage(),
].addToEnd(const SizedBox(width: 10)).addToStart(const SizedBox(width: 10)), ].addToEnd(const SizedBox(width: 10)).addToStart(const SizedBox(width: 10)),
); );
} else { } else {

View File

@ -75,7 +75,8 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height * 0.02), SizedBox(height: MediaQuery.of(context).size.height * 0.02),
if(widget.imagePath != null) Container( if (widget.imagePath != null)
Container(
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
@ -90,7 +91,6 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useOldImageOnUrlChange: true, useOldImageOnUrlChange: true,
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.height * 0.03), SizedBox(height: MediaQuery.of(context).size.height * 0.03),
Row( Row(
children: statusLinkedHashMap.expand((linkedHashMap) { children: statusLinkedHashMap.expand((linkedHashMap) {

View File

@ -54,7 +54,6 @@ class AppStateNotifier extends ChangeNotifier {
} }
GoRouter createRouter(AppStateNotifier appStateNotifier) { GoRouter createRouter(AppStateNotifier appStateNotifier) {
return GoRouter( return GoRouter(
initialLocation: '/', initialLocation: '/',
debugLogDiagnostics: true, debugLogDiagnostics: true,

View File

@ -32,7 +32,8 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
final cliUUID = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? ''; final cliUUID = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? '';
const createdAt = '0000-00-00 00:00:00'; const createdAt = '0000-00-00 00:00:00';
final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID'; final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID';
final freUserData = "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\":\"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; final freUserData =
"{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\":\"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }";
return { return {
'url': url, 'url': url,
'name': name, 'name': name,
@ -55,7 +56,9 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) {
return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); return Center(
child: Text(FFLocalizations.of(context)
.getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado')));
} else { } else {
final data = snapshot.data!; final data = snapshot.data!;
final url = data['url']!; final url = data['url']!;

View File

@ -37,7 +37,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
void initState() { void initState() {
super.initState(); super.initState();
_model = createModel(context, () => HomePageModel(safeSetState: () => safeSetState((){}))); _model = createModel(context, () => HomePageModel(safeSetState: () => safeSetState(() {})));
_model.textController ??= TextEditingController(); _model.textController ??= TextEditingController();
_model.textFieldFocusNode ??= FocusNode(); _model.textFieldFocusNode ??= FocusNode();

View File

@ -8,7 +8,6 @@ class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyP
PeopleOnThePropertyPageModel({this.onRefresh}); PeopleOnThePropertyPageModel({this.onRefresh});
late final VoidCallback? onRefresh; late final VoidCallback? onRefresh;
final unfocusNode = FocusNode(); final unfocusNode = FocusNode();
late final String devUUID; late final String devUUID;
late final String cliUUID; late final String cliUUID;
@ -16,7 +15,6 @@ class PeopleOnThePropertyPageModel extends FlutterFlowModel<PeopleOnThePropertyP
@override @override
void initState(BuildContext context) { void initState(BuildContext context) {
initVariables(); initVariables();
} }
void initVariables() async { void initVariables() async {

View File

@ -29,7 +29,8 @@ class _ReservationPageWidgetState extends State<ReservationPageWidget> {
final clientId = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? ''; final clientId = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? '';
const createdAt = '0000-00-00 00:00:00'; const createdAt = '0000-00-00 00:00:00';
final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId'; final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId';
final freUserData = "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\": \"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; final freUserData =
"{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\": \"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }";
return { return {
'url': url, 'url': url,
'name': name, 'name': name,
@ -52,7 +53,9 @@ class _ReservationPageWidgetState extends State<ReservationPageWidget> {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) {
return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); return Center(
child: Text(FFLocalizations.of(context)
.getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado')));
} else { } else {
final data = snapshot.data!; final data = snapshot.data!;
final url = data['url']!; final url = data['url']!;

View File

@ -17,7 +17,7 @@ import 'package:share_plus/share_plus.dart';
import '../../shared/utils/validator_util.dart'; import '../../shared/utils/validator_util.dart';
class ScheduleCompleteVisitPageModel extends FlutterFlowModel<ScheduleComplete> { class ScheduleCompleteVisitPageModel extends FlutterFlowModel<ScheduleComplete> {
ScheduleCompleteVisitPageModel({ this.safeSetState}); ScheduleCompleteVisitPageModel({this.safeSetState});
late VoidCallback? safeSetState; late VoidCallback? safeSetState;
late Function(Function) updateState; late Function(Function) updateState;

View File

@ -24,13 +24,15 @@ import 'package:hub/shared/utils/share_util.dart';
class ScheduleComplete extends StatefulWidget { class ScheduleComplete extends StatefulWidget {
const ScheduleComplete({super.key}); const ScheduleComplete({super.key});
@override State<StatefulWidget> createState() => throw UnimplementedError(); @override
State<StatefulWidget> createState() => throw UnimplementedError();
} }
class ScheduleCompleteVisitPageWidget extends ScheduleComplete { class ScheduleCompleteVisitPageWidget extends ScheduleComplete {
const ScheduleCompleteVisitPageWidget({super.key}); const ScheduleCompleteVisitPageWidget({super.key});
@override State<ScheduleCompleteVisitPageWidget> createState() => _ScheduleCompleteVisitPageWidgetState(); @override
State<ScheduleCompleteVisitPageWidget> createState() => _ScheduleCompleteVisitPageWidgetState();
} }
class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitPageWidget> class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitPageWidget>
@ -44,9 +46,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitP
final scaffoldKey = GlobalKey<ScaffoldState>(); final scaffoldKey = GlobalKey<ScaffoldState>();
@override void initState() { @override
void initState() {
super.initState(); super.initState();
_model = createModel(context, () => ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState((){}))); _model = createModel(context, () => ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState(() {})));
_model.updateState = (Function fn) => safeSetState(fn()); _model.updateState = (Function fn) => safeSetState(fn());
_model.tabBarController = TabController( _model.tabBarController = TabController(
@ -94,7 +97,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitP
super.dispose(); super.dispose();
} }
@override Widget build(BuildContext context) { @override
Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus onTap: () => _model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(_model.unfocusNode) ? FocusScope.of(context).requestFocus(_model.unfocusNode)

View File

@ -48,8 +48,7 @@ class VehicleModel extends FlutterFlowModel<VehicleOnTheProperty> {
'${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:': '${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:':
item['tag'].toString().toUpperCase(), item['tag'].toString().toUpperCase(),
}), }),
statusHashMap: [ statusHashMap: [],
],
); );
} }
} }

View File

@ -19,8 +19,6 @@ class VisitsModel extends FlutterFlowModel<VehicleOnTheProperty> {
dynamic item; dynamic item;
@override @override
void initState(BuildContext context) { void initState(BuildContext context) {
resetInstance(); resetInstance();
@ -81,8 +79,8 @@ class VisitsModel extends FlutterFlowModel<VehicleOnTheProperty> {
Map<String, Color>.from({ Map<String, Color>.from({
item['VTA_FIXA'] item['VTA_FIXA']
? FFLocalizations.of(context).getVariableText(ptText: "Entrada Única", enText: "Single Entry") ? FFLocalizations.of(context).getVariableText(ptText: "Entrada Única", enText: "Single Entry")
: FFLocalizations.of(context).getVariableText(ptText: "Entrada Recorrente", enText: "Recurrent Entry") : FFLocalizations.of(context).getVariableText(
: FlutterFlowTheme.of(context).warning ptText: "Entrada Recorrente", enText: "Recurrent Entry"): FlutterFlowTheme.of(context).warning
}), }),
]); ]);
} }

View File

@ -48,7 +48,6 @@ class LocalizationService {
static Future<bool> processLocals(BuildContext context) async { static Future<bool> processLocals(BuildContext context) async {
try { try {
final GetLocalsCall callback = PhpGroup.getLocalsCall; final GetLocalsCall callback = PhpGroup.getLocalsCall;
final ApiCallResponse response = await callback.call(); final ApiCallResponse response = await callback.call();
final bool isError = response.jsonBody['error']; final bool isError = response.jsonBody['error'];