Merge branch 'main' into fix/a11yHome
This commit is contained in:
commit
040ad232da
|
@ -138,6 +138,9 @@ PODS:
|
|||
- OrderedSet (~> 5.0)
|
||||
- flutter_secure_storage (6.0.0):
|
||||
- Flutter
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- GoogleAppMeasurement (10.27.0):
|
||||
- GoogleAppMeasurement/AdIdSupport (= 10.27.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||
|
@ -222,6 +225,7 @@ PODS:
|
|||
- Flutter
|
||||
- FlutterMacOS
|
||||
- SwiftyGif (5.4.5)
|
||||
- Toast (4.1.1)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
- video_player_avfoundation (0.0.1):
|
||||
|
@ -242,6 +246,7 @@ DEPENDENCIES:
|
|||
- Flutter (from `Flutter`)
|
||||
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
|
@ -277,6 +282,7 @@ SPEC REPOS:
|
|||
- PromisesSwift
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
awesome_notifications:
|
||||
|
@ -301,6 +307,8 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
|
||||
flutter_secure_storage:
|
||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
||||
fluttertoast:
|
||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
local_auth_darwin:
|
||||
|
@ -346,6 +354,7 @@ SPEC CHECKSUMS:
|
|||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
|
||||
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
||||
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
|
||||
GoogleAppMeasurement: f65fc137531af9ad647f1c0a42f3b6a4d3a98049
|
||||
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
|
||||
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
|
||||
|
@ -363,6 +372,7 @@ SPEC CHECKSUMS:
|
|||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
||||
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
||||
|
|
|
@ -510,8 +510,6 @@ class ApiManager {
|
|||
result = ApiCallResponse(null, {}, -1, exception: e);
|
||||
}
|
||||
|
||||
log('Params: $params');
|
||||
log('JsonBody: ${result.jsonBody}');
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,21 +53,11 @@ class NotificationService {
|
|||
|
||||
static Future<void> onActionReceivedMethod(
|
||||
ReceivedAction receivedAction) async {
|
||||
// debugPrint('onActionReceivedMethod');
|
||||
// final payload = receivedAction.payload ?? {};
|
||||
// if (payload['navigate'] == 'true') {
|
||||
// locator<NavigationService>().navigateToWithParams(notificationRoute, {'title': payload['title']!, 'body': payload['body']!});
|
||||
// }
|
||||
final payload = receivedAction.payload ?? {};
|
||||
final extra = receivedAction.body;
|
||||
final handleClick = payload['click_action'];
|
||||
|
||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||
// try {
|
||||
// localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||
// } catch (e) {
|
||||
// localId = payload['local']['CLI_ID'].toString();
|
||||
// }
|
||||
|
||||
log('payload: $payload');
|
||||
log('extra: $extra');
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
part 'connectivity_event.dart';
|
||||
part 'connectivity_state.dart';
|
||||
|
||||
class ConnectivityBloc extends Bloc<ConnectivityEvent, ConnectivityState> {
|
||||
final Connectivity _connectivity;
|
||||
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
|
||||
|
||||
ConnectivityBloc(this._connectivity) : super(ConnectivityInitial()) {
|
||||
on<ConnectivityChanged>(_onConnectivityChanged);
|
||||
_connectivitySubscription = _connectivity.onConnectivityChanged.listen(
|
||||
(List<ConnectivityResult> result) {
|
||||
add(ConnectivityChanged(result.first));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _onConnectivityChanged(
|
||||
ConnectivityChanged event, Emitter<ConnectivityState> emit) {
|
||||
if (event.result == ConnectivityResult.none) {
|
||||
emit(ConnectivityFailure());
|
||||
} else {
|
||||
emit(ConnectivitySuccess());
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_connectivitySubscription.cancel();
|
||||
return super.close();
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
part of 'connectivity_bloc.dart';
|
||||
|
||||
abstract class ConnectivityEvent extends Equatable {
|
||||
const ConnectivityEvent();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class ConnectivityChanged extends ConnectivityEvent {
|
||||
final ConnectivityResult result;
|
||||
|
||||
const ConnectivityChanged(this.result);
|
||||
|
||||
@override
|
||||
List<Object> get props => [result];
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
part of 'connectivity_bloc.dart';
|
||||
|
||||
abstract class ConnectivityState extends Equatable {
|
||||
const ConnectivityState();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class ConnectivityInitial extends ConnectivityState {}
|
||||
|
||||
class ConnectivitySuccess extends ConnectivityState {}
|
||||
|
||||
class ConnectivityFailure extends ConnectivityState {}
|
|
@ -87,41 +87,41 @@ class _VisitorNotFoundComponentWidgetState
|
|||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0),
|
||||
const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'1p9mykbj' /* Usuário não encontrado */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
textAlign: TextAlign.center,
|
||||
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||
FlutterFlowTheme.of(context).headlineSmallFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||
FlutterFlowTheme.of(context).headlineSmallFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10, 0, 10, 10),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'kt937sp6' /* O documento inserido não corre... */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
textAlign: TextAlign.center,
|
||||
style: FlutterFlowTheme.of(context).labelSmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontStyle: FontStyle.italic,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||
child: FFButtonWidget(
|
||||
|
@ -157,13 +157,13 @@ class _VisitorNotFoundComponentWidgetState
|
|||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
FlutterFlowTheme.of(context).labelSmallFamily,
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
|
@ -171,10 +171,10 @@ class _VisitorNotFoundComponentWidgetState
|
|||
width: 1.0,
|
||||
),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(25.0),
|
||||
bottomRight: Radius.circular(25.0),
|
||||
topLeft: Radius.circular(25.0),
|
||||
topRight: Radius.circular(25.0),
|
||||
bottomLeft: Radius.circular(10.0),
|
||||
bottomRight: Radius.circular(10.0),
|
||||
topLeft: Radius.circular(10.0),
|
||||
topRight: Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -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,9 +1,14 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.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/templates_components/card_item_template_component/card_item_template_component_widget.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 '/backend/api_requests/api_calls.dart';
|
||||
|
@ -14,14 +19,20 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
|||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<BottomArrowLinkedLocalsComponentWidget> createState() =>
|
||||
_BottomArrowLinkedLocalsComponentWidgetState();
|
||||
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState();
|
||||
}
|
||||
|
||||
class _BottomArrowLinkedLocalsComponentWidgetState
|
||||
extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||
late BottomArrowLinkedLocalsComponentModel _model;
|
||||
|
||||
|
||||
bool _loading = false;
|
||||
bool _hasData = false;
|
||||
|
||||
late Future<void> _localsFuture;
|
||||
List<dynamic> _localsWrap = [];
|
||||
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
|
@ -31,8 +42,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model =
|
||||
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||
_localsFuture = _fetchLocals();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -42,248 +53,224 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
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
|
||||
Widget build(BuildContext context) {
|
||||
context.watch<AppState>();
|
||||
|
||||
double height = MediaQuery.sizeOf(context).height;
|
||||
|
||||
return Align(
|
||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||
alignment: const AlignmentDirectional(0, 1),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 150.0,
|
||||
height: height - (height * 0.5),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(0.0),
|
||||
bottomRight: Radius.circular(0.0),
|
||||
topLeft: Radius.circular(25.0),
|
||||
topRight: Radius.circular(25.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 150.0,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(0.0),
|
||||
bottomRight: Radius.circular(0.0),
|
||||
topLeft: Radius.circular(0.0),
|
||||
topRight: Radius.circular(0.0),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.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,
|
||||
topLeft: Radius.circular(25),
|
||||
topRight: Radius.circular(25)
|
||||
)
|
||||
?.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,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _loading == false && _localsWrap.isEmpty)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum Local Encontrado.",
|
||||
enText: "No local found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty)
|
||||
Expanded(child: _listItems(context)),
|
||||
if (_loading == true)
|
||||
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: CachedNetworkImage(
|
||||
imageUrl:
|
||||
"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: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
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)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -81,13 +81,14 @@ class _LocalProfileComponentWidgetState
|
|||
isScrollControlled: true,
|
||||
backgroundColor: const Color(0x00FFFFFF),
|
||||
context: context,
|
||||
enableDrag: false,
|
||||
isDismissible: false,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const SizedBox(
|
||||
height: double.infinity,
|
||||
child:
|
||||
BottomArrowLinkedLocalsComponentWidget(),
|
||||
child: BottomArrowLinkedLocalsComponentWidget(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||
import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart';
|
||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
||||
|
@ -103,7 +104,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
|||
textInputAction: TextInputAction.done,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: false,
|
||||
isDense: true,
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'cjlpru1m' /* Procure pelo documento do visi... */,
|
||||
),
|
||||
|
@ -176,7 +177,8 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
|||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(signed: true),
|
||||
validator: _model.textControllerValidator.asValidator(context),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
|
@ -417,7 +419,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
|||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20.0,
|
||||
height: 30.0,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -472,7 +474,9 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
|||
ToastUtil.showToast(
|
||||
message: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Visitante já adicionado!',
|
||||
enText: 'Visitor already added!'));
|
||||
enText: 'Visitor already added!'),
|
||||
gravity: ToastGravity.TOP,
|
||||
backgroundColor: Colors.red);
|
||||
}
|
||||
} else {
|
||||
await showAdaptiveDialog(
|
||||
|
|
|
@ -690,8 +690,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
|||
// visitorNotFoundComponent
|
||||
{
|
||||
'1p9mykbj': {
|
||||
'pt': 'Usuário não encontrado',
|
||||
'en': 'User not found',
|
||||
'pt': 'Usuário Não Encontrado',
|
||||
'en': 'User Not Found',
|
||||
},
|
||||
'kt937sp6': {
|
||||
'pt':
|
||||
|
|
|
@ -75,20 +75,15 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
|||
|
||||
if (AppState().cliUUID.isEmpty) {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: false,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
enableDrag: false,
|
||||
isDismissible: false,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _model.unfocusNode.canRequestFocus
|
||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||
: FocusScope.of(context).unfocus(),
|
||||
child: Padding(
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const BottomArrowLinkedLocalsComponentWidget(),
|
||||
),
|
||||
);
|
||||
},
|
||||
).then((value) => safeSetState(() {}));
|
||||
|
|
|
@ -148,7 +148,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
|||
Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhuma solicitação encontrada!",
|
||||
enText: "No visit found")),
|
||||
enText: "No requests found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -33,7 +33,7 @@ class ScheduleCompleteVisitPageModel
|
|||
String convertDateFormat(String dateStr) {
|
||||
try {
|
||||
// Formato original
|
||||
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||
DateFormat originalFormat = DateFormat('dd/MM/yyyy HH:mm:ss');
|
||||
// Novo formato
|
||||
DateFormat newFormat = DateFormat('y-M-d H:mm:ss');
|
||||
|
||||
|
@ -197,7 +197,7 @@ class ScheduleCompleteVisitPageModel
|
|||
textFieldFocusNode1 = FocusNode();
|
||||
textController1 = TextEditingController(
|
||||
text: dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
'dd/MM/yyyy HH:mm:ss',
|
||||
DateTime.now().add(const Duration(minutes: 10)),
|
||||
// locale: FFLocalizations.of(context).languageCode,
|
||||
));
|
||||
|
@ -206,7 +206,7 @@ class ScheduleCompleteVisitPageModel
|
|||
textFieldFocusNode2 = FocusNode();
|
||||
textController2 = TextEditingController(
|
||||
text: dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
'dd/MM/yyyy HH:mm:ss',
|
||||
DateTime.now().add(const Duration(days: 1)),
|
||||
// locale: FFLocalizations.of(context).languageCode,
|
||||
));
|
||||
|
|
|
@ -1114,9 +1114,7 @@ Widget scheduleVisit(BuildContext context,
|
|||
if (value.contains('{') &&
|
||||
value.contains('}') &&
|
||||
value.contains(':')) {
|
||||
// log("Valor e um Objeto | Usuário Escolheu o Motivo ${_model.dropDownValue1}");
|
||||
} else {
|
||||
// log("Valor e uma String | Usuário Escolheu o Motivo ${_model.dropDownValue1}");
|
||||
if (reasonsJsonList != null &&
|
||||
reasonsJsonList.isNotEmpty) {
|
||||
var item = reasonsJsonList.where(
|
||||
|
|
|
@ -79,7 +79,6 @@ dependencies:
|
|||
timeago: 3.6.1
|
||||
url_launcher: 6.3.0
|
||||
url_launcher_android: 6.3.3
|
||||
bloc: ^8.1.4
|
||||
url_launcher_ios: 6.3.0
|
||||
url_launcher_platform_interface: 2.3.2
|
||||
video_player: 2.8.7
|
||||
|
|
Loading…
Reference in New Issue