Refactor visit request template component logic
This commit is contained in:
parent
c323260c6c
commit
450e0823a6
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
import 'package:f_r_e_hub/app_state.dart';
|
import 'package:f_r_e_hub/app_state.dart';
|
||||||
import 'package:f_r_e_hub/backend/api_requests/api_calls.dart';
|
import 'package:f_r_e_hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -18,6 +19,7 @@ class PushNotificationService {
|
||||||
|
|
||||||
PushNotificationService() {
|
PushNotificationService() {
|
||||||
_initializeLocalNotifications(_context);
|
_initializeLocalNotifications(_context);
|
||||||
|
_createNotificationChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initialize(BuildContext context) async {
|
Future<void> initialize(BuildContext context) async {
|
||||||
|
@ -116,18 +118,31 @@ class PushNotificationService {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
_createNotificationChannel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _createNotificationChannel() {
|
void _createNotificationChannels() {
|
||||||
|
List<String> actions = [
|
||||||
|
'visit_request',
|
||||||
|
'visit_response',
|
||||||
|
'access',
|
||||||
|
'mensagem',
|
||||||
|
'enroll_cond',
|
||||||
|
'miscellaneous'
|
||||||
|
];
|
||||||
|
for (String action in actions) {
|
||||||
|
_createNotificationChannel(action, "Channel for $action");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _createNotificationChannel(String channelId, String channelName) {
|
||||||
_flutterLocalNotificationsPlugin
|
_flutterLocalNotificationsPlugin
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin>()
|
AndroidFlutterLocalNotificationsPlugin>()
|
||||||
?.createNotificationChannel(
|
?.createNotificationChannel(
|
||||||
AndroidNotificationChannel(
|
AndroidNotificationChannel(
|
||||||
'channelID',
|
channelId, // Use o click_action como ID do canal
|
||||||
'channelName',
|
channelName, // Nome descritivo baseado no click_action
|
||||||
description: 'Channel Description',
|
description: 'Channel for $channelName notifications',
|
||||||
importance: Importance.max,
|
importance: Importance.max,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -181,7 +196,7 @@ class PushNotificationService {
|
||||||
|
|
||||||
final NotificationSettings settings =
|
final NotificationSettings settings =
|
||||||
await _requestNotificationPermission();
|
await _requestNotificationPermission();
|
||||||
await _fetchAndLogApnsToken(settings);
|
if (Platform.isIOS) await _fetchAndLogApnsToken(settings);
|
||||||
|
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
|
@ -222,11 +237,32 @@ class PushNotificationService {
|
||||||
return PhpGroup.updToken.error((response?.jsonBody ?? '')) == false;
|
return PhpGroup.updToken.error((response?.jsonBody ?? '')) == false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _getChannelIdBasedOnClickAction(String clickAction) {
|
||||||
|
// Retorna o ID do canal com base no click_action
|
||||||
|
// Exemplo simples, pode ser expandido conforme necessário
|
||||||
|
switch (clickAction) {
|
||||||
|
case 'visit_request':
|
||||||
|
return 'visit_request';
|
||||||
|
case '':
|
||||||
|
return 'visit_response';
|
||||||
|
case 'access':
|
||||||
|
return 'access';
|
||||||
|
case 'mensagem':
|
||||||
|
return 'mensagem';
|
||||||
|
case 'enroll_cond':
|
||||||
|
return 'enroll_cond';
|
||||||
|
default:
|
||||||
|
return 'miscellaneous';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _showNotification(RemoteMessage message) async {
|
void _showNotification(RemoteMessage message) async {
|
||||||
|
String channelId =
|
||||||
|
_getChannelIdBasedOnClickAction(message.data['click_action']);
|
||||||
var androidDetails = AndroidNotificationDetails(
|
var androidDetails = AndroidNotificationDetails(
|
||||||
'channelID',
|
channelId,
|
||||||
'channelName',
|
'Channel Name for $channelId',
|
||||||
channelDescription: 'Channel Description',
|
channelDescription: 'Channel Description for $channelId',
|
||||||
importance: Importance.max,
|
importance: Importance.max,
|
||||||
priority: Priority.high,
|
priority: Priority.high,
|
||||||
);
|
);
|
||||||
|
@ -274,10 +310,20 @@ class NotificationHandler {
|
||||||
switch (message['click_action']) {
|
switch (message['click_action']) {
|
||||||
case 'visit_request':
|
case 'visit_request':
|
||||||
_showVisitRequestDialog(message, context);
|
_showVisitRequestDialog(message, context);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'visit_response':
|
case '':
|
||||||
debugPrint('visit_response');
|
debugPrint('visit_response');
|
||||||
break;
|
break;
|
||||||
|
case 'access':
|
||||||
|
debugPrint('access');
|
||||||
|
break;
|
||||||
|
case 'mensagem':
|
||||||
|
debugPrint('mensagem');
|
||||||
|
break;
|
||||||
|
case 'enroll_cond':
|
||||||
|
debugPrint('enroll_cond');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
debugPrint('Notification type not recognized');
|
debugPrint('Notification type not recognized');
|
||||||
}
|
}
|
||||||
|
@ -285,6 +331,7 @@ class NotificationHandler {
|
||||||
|
|
||||||
void _showVisitRequestDialog(
|
void _showVisitRequestDialog(
|
||||||
Map<String, dynamic> message, BuildContext context) {
|
Map<String, dynamic> message, BuildContext context) {
|
||||||
|
debugPrint('Showing visit request dialog');
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
||||||
|
@ -45,6 +47,20 @@ class ViewVisitDetailWidget extends StatefulWidget {
|
||||||
State<ViewVisitDetailWidget> createState() => _ViewVisitDetailWidgetState();
|
State<ViewVisitDetailWidget> createState() => _ViewVisitDetailWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<dynamic>? findVisitorById(List<dynamic>? jsonList, String? id) {
|
||||||
|
if (jsonList == null || id == null) return null;
|
||||||
|
try {
|
||||||
|
var foundItem = jsonList.firstWhere(
|
||||||
|
(item) => item["VAW_ID"] == id,
|
||||||
|
orElse: () => null,
|
||||||
|
);
|
||||||
|
return foundItem != null ? [foundItem] : null;
|
||||||
|
} catch (e) {
|
||||||
|
print("Error searching item: $e");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
late ViewVisitDetailModel _model;
|
late ViewVisitDetailModel _model;
|
||||||
|
|
||||||
|
@ -61,14 +77,16 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
|
|
||||||
// On component load action.
|
// On component load action.
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
if (widget.visitStatusStr != null) {
|
||||||
_model.visitStatusColor = await action_blocks.manageStatusColorAction(
|
_model.visitStatusColor = await action_blocks.manageStatusColorAction(
|
||||||
context,
|
context,
|
||||||
visitStatusStr: widget.visitStatusStr,
|
visitStatusStr: widget.visitStatusStr!,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController(
|
_model.textController1 = TextEditingController(
|
||||||
text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr);
|
text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??=
|
_model.textController2 ??=
|
||||||
|
@ -99,6 +117,9 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var filteredVisitorJsonList =
|
||||||
|
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
||||||
|
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
|
@ -135,8 +156,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(1.0, 0.0),
|
alignment: const AlignmentDirectional(1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 15.0, 0.0),
|
15.0, 0.0, 15.0, 0.0),
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
|
@ -165,8 +186,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 20.0),
|
0.0, 0.0, 20.0, 20.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
|
@ -200,8 +221,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration: const Duration(milliseconds: 500),
|
fadeInDuration:
|
||||||
fadeOutDuration: const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
|
fadeOutDuration:
|
||||||
|
const Duration(milliseconds: 500),
|
||||||
imageUrl: valueOrDefault<String>(
|
imageUrl: valueOrDefault<String>(
|
||||||
widget.visitorImgPath,
|
widget.visitorImgPath,
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||||
|
@ -220,8 +243,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0),
|
8.0, 0.0, 8.0, 10.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -296,8 +319,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
0.0, 0.0, 0.0, 10.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -482,8 +505,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
0.0, 0.0, 0.0, 10.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -670,8 +693,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
8.0, 0.0, 8.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController6,
|
controller: _model.textController6,
|
||||||
focusNode: _model.textFieldFocusNode6,
|
focusNode: _model.textFieldFocusNode6,
|
||||||
|
@ -751,7 +774,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 35.0,
|
height: 35.0,
|
||||||
|
@ -889,7 +913,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
ParamType.String,
|
ParamType.String,
|
||||||
),
|
),
|
||||||
'visitorJsonList': serializeParam(
|
'visitorJsonList': serializeParam(
|
||||||
widget.visitorJsonList,
|
filteredVisitorJsonList,
|
||||||
ParamType.JSON,
|
ParamType.JSON,
|
||||||
isList: true,
|
isList: true,
|
||||||
),
|
),
|
||||||
|
|
|
@ -72,7 +72,6 @@ class VisitRequestTemplateComponentModel
|
||||||
(visitRequest.jsonBody ?? ''),
|
(visitRequest.jsonBody ?? ''),
|
||||||
) ==
|
) ==
|
||||||
false) {
|
false) {
|
||||||
Navigator.pop(context);
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -557,7 +557,6 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var shouldSetState = false;
|
var shouldSetState = false;
|
||||||
_model.blockVisitRequest =
|
|
||||||
await _model.visitRequestComponentAction(
|
await _model.visitRequestComponentAction(
|
||||||
context,
|
context,
|
||||||
actionValue: 'B',
|
actionValue: 'B',
|
||||||
|
@ -566,13 +565,10 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
vteUUID: widget.vteUUID,
|
vteUUID: widget.vteUUID,
|
||||||
);
|
);
|
||||||
shouldSetState = true;
|
shouldSetState = true;
|
||||||
if (_model.blockVisitRequest == true) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
if (shouldSetState) setState(() {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Verifica se o widget ainda está montado antes de tomar qualquer ação baseada no contexto
|
||||||
|
if (!mounted) return;
|
||||||
|
Navigator.pop(context);
|
||||||
if (shouldSetState) setState(() {});
|
if (shouldSetState) setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -588,7 +584,6 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var shouldSetState = false;
|
var shouldSetState = false;
|
||||||
_model.approveVisitRequest =
|
|
||||||
await _model.visitRequestComponentAction(
|
await _model.visitRequestComponentAction(
|
||||||
context,
|
context,
|
||||||
actionValue: 'L',
|
actionValue: 'L',
|
||||||
|
@ -597,13 +592,9 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
vteUUID: widget.vteUUID,
|
vteUUID: widget.vteUUID,
|
||||||
);
|
);
|
||||||
shouldSetState = true;
|
shouldSetState = true;
|
||||||
if (_model.approveVisitRequest == true) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
if (shouldSetState) setState(() {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!mounted) return;
|
||||||
|
Navigator.pop(context);
|
||||||
if (shouldSetState) setState(() {});
|
if (shouldSetState) setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -62,7 +62,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: '_initialize',
|
name: '_initialize',
|
||||||
path: '/',
|
path: '/',
|
||||||
builder: (context, _) => const OnBoardingPageWidget(),
|
builder: (context, _) => FFAppState().isLogged
|
||||||
|
? const HomePageWidget()
|
||||||
|
: const OnBoardingPageWidget(),
|
||||||
),
|
),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'homePage',
|
name: 'homePage',
|
||||||
|
|
|
@ -52,6 +52,10 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
extends State<ScheduleCompleteVisitPageWidget>
|
extends State<ScheduleCompleteVisitPageWidget>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late ScheduleCompleteVisitPageModel _model;
|
late ScheduleCompleteVisitPageModel _model;
|
||||||
|
int _visitHistoryLoadingIdx = 0;
|
||||||
|
final int _visitHistoryLoadingCount = 10;
|
||||||
|
List<dynamic> _visitHistoryList = [];
|
||||||
|
ScrollController _visitHistoryController = ScrollController();
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
|
@ -99,6 +103,28 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _loadMoreVisitHistory() async {
|
||||||
|
final total = List.generate(
|
||||||
|
100, (index) => "Item $index"); // Exemplo de lista total de itens
|
||||||
|
final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount;
|
||||||
|
final int end = start + _visitHistoryLoadingCount > total.length
|
||||||
|
? total.length
|
||||||
|
: start + _visitHistoryLoadingCount;
|
||||||
|
if (start < total.length) {
|
||||||
|
final List<dynamic> newItems = total.sublist(start, end);
|
||||||
|
_visitHistoryList.addAll(newItems);
|
||||||
|
_visitHistoryLoadingIdx++;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void_scrollListener() {
|
||||||
|
if (_visitHistoryController.position.pixels ==
|
||||||
|
_visitHistoryController.position.maxScrollExtent) {
|
||||||
|
_loadMoreVisitHistory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_model.dispose();
|
_model.dispose();
|
||||||
|
@ -215,9 +241,11 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 30.0, 0.0, 30.0),
|
20.0, 30.0, 0.0, 30.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -255,7 +283,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
.map((e) => e)
|
.map((e) => e)
|
||||||
.toList();
|
.toList();
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding:
|
||||||
|
const EdgeInsets.fromLTRB(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@ -267,7 +296,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
itemCount:
|
itemCount:
|
||||||
visitorListView.length,
|
visitorListView.length,
|
||||||
separatorBuilder: (_, __) =>
|
separatorBuilder: (_, __) =>
|
||||||
const SizedBox(height: 5.0),
|
const SizedBox(
|
||||||
|
height: 5.0),
|
||||||
itemBuilder: (context,
|
itemBuilder: (context,
|
||||||
visitorListViewIndex) {
|
visitorListViewIndex) {
|
||||||
final visitorListViewItem =
|
final visitorListViewItem =
|
||||||
|
@ -413,8 +443,10 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.divide(const SizedBox(
|
.divide(
|
||||||
width: 30.0))
|
const SizedBox(
|
||||||
|
width:
|
||||||
|
30.0))
|
||||||
.addToStart(
|
.addToStart(
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width:
|
width:
|
||||||
|
@ -429,10 +461,12 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
Stack(
|
Stack(
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment:
|
||||||
|
const AlignmentDirectional(
|
||||||
0.01, 0.0),
|
0.01, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 20.0),
|
0.0, 0.0, 0.0, 20.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
|
@ -508,18 +542,12 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(14.0,
|
||||||
14.0,
|
0.0, 0.0, 20.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
20.0),
|
|
||||||
color: FlutterFlowTheme
|
color: FlutterFlowTheme
|
||||||
.of(context)
|
.of(context)
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
|
@ -558,10 +586,12 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(
|
alignment:
|
||||||
|
const AlignmentDirectional(
|
||||||
0.0, 0.0),
|
0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 50.0, 0.0, 0.0),
|
0.0, 50.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -570,7 +600,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
.width *
|
.width *
|
||||||
0.8,
|
0.8,
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
|
@ -614,9 +645,11 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 24.0, 0.0, 24.0),
|
20.0, 24.0, 0.0, 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -650,13 +683,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 0.0, 0.0, 0.0),
|
20.0, 0.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
|
@ -692,7 +727,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -1044,13 +1080,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 0.0, 0.0, 0.0),
|
20.0, 0.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
|
@ -1086,7 +1124,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -1441,9 +1480,11 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 24.0, 0.0, 24.0),
|
20.0, 24.0, 0.0, 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -1477,13 +1518,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 0.0, 0.0, 0.0),
|
20.0, 0.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 42.0,
|
height: 42.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
|
@ -1517,13 +1560,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 24.0, 0.0),
|
0.0, 0.0, 24.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: FutureBuilder<
|
child: FutureBuilder<
|
||||||
ApiCallResponse>(
|
ApiCallResponse>(
|
||||||
future: PhpGroup
|
future: PhpGroup
|
||||||
|
@ -1650,13 +1695,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 0.0, 0.0, 0.0),
|
20.0, 0.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 42.0,
|
height: 42.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
|
@ -1690,13 +1737,15 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 24.0, 0.0),
|
0.0, 0.0, 24.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 40.0,
|
height: 40.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration:
|
||||||
|
const BoxDecoration(),
|
||||||
child: FutureBuilder<
|
child: FutureBuilder<
|
||||||
ApiCallResponse>(
|
ApiCallResponse>(
|
||||||
future: PhpGroup
|
future: PhpGroup
|
||||||
|
@ -1826,9 +1875,11 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 24.0, 0.0, 24.0),
|
20.0, 24.0, 0.0, 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -1859,8 +1910,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
.fromSTEB(
|
||||||
30.0, 0.0, 30.0, 20.0),
|
30.0, 0.0, 30.0, 20.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
@ -1936,9 +1987,11 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
20.0, 0.0, 0.0, 24.0),
|
20.0, 0.0, 0.0, 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -1969,9 +2022,8 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
@ -2786,10 +2838,14 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
BorderRadius.circular(
|
BorderRadius.circular(
|
||||||
0.0),
|
0.0),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration: const Duration(
|
fadeInDuration:
|
||||||
milliseconds: 500),
|
const Duration(
|
||||||
fadeOutDuration: const Duration(
|
milliseconds:
|
||||||
milliseconds: 500),
|
500),
|
||||||
|
fadeOutDuration:
|
||||||
|
const Duration(
|
||||||
|
milliseconds:
|
||||||
|
500),
|
||||||
imageUrl: valueOrDefault<
|
imageUrl: valueOrDefault<
|
||||||
String>(
|
String>(
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
|
|
Loading…
Reference in New Issue