WIP
This commit is contained in:
parent
09b339da8d
commit
ccd63168bd
|
@ -1,4 +1,3 @@
|
|||
|
||||
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
|
@ -12,10 +11,7 @@ export 'local_profile_component_model.dart';
|
|||
////
|
||||
|
||||
class LocalProfileComponentWidget extends StatefulWidget {
|
||||
const LocalProfileComponentWidget({
|
||||
required bool localStatus,
|
||||
super.key
|
||||
});
|
||||
const LocalProfileComponentWidget({required bool localStatus, super.key});
|
||||
|
||||
@override
|
||||
State<LocalProfileComponentWidget> createState() =>
|
||||
|
@ -87,8 +83,7 @@ class _LocalProfileComponentWidgetState
|
|||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const SizedBox(
|
||||
height: double.infinity,
|
||||
child:
|
||||
BottomArrowLinkedLocalsComponentWidget(),
|
||||
child: BottomArrowLinkedLocalsComponentWidget(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -96,23 +91,23 @@ class _LocalProfileComponentWidgetState
|
|||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(200.0),
|
||||
child:
|
||||
Image.network(
|
||||
child: Image.network(
|
||||
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
||||
width: 80.0,
|
||||
height: 80.0,
|
||||
fit: BoxFit.cover,
|
||||
alignment: const Alignment(0.0, 0.0),
|
||||
errorBuilder: (context, error, stackTrace) => Image.network(
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
Image.network(
|
||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||
width: 80.0,
|
||||
height: 80.0,
|
||||
fit: BoxFit.cover,
|
||||
alignment: const Alignment(0.0, 0.0),
|
||||
errorBuilder: (context, error, stackTrace) => Image.asset('assets/images/error_image.svg'),
|
||||
),
|
||||
)
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
Image.asset('assets/images/error_image.svg'),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -125,8 +120,7 @@ class _LocalProfileComponentWidgetState
|
|||
functions.convertToUppercase(FFAppState().local),
|
||||
'NOME DO LOCAL',
|
||||
),
|
||||
style:
|
||||
FlutterFlowTheme.of(context).labelMedium.override(
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Nunito',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 14.0,
|
||||
|
|
|
@ -84,7 +84,6 @@ Widget buildDetails(
|
|||
)
|
||||
.then((value) {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
if (value == false) {
|
||||
showSnackbar(
|
||||
context,
|
||||
|
@ -105,6 +104,8 @@ Widget buildDetails(
|
|||
);
|
||||
}
|
||||
}).catchError((err, stack) {
|
||||
Navigator.pop(context);
|
||||
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
|
|
|
@ -91,9 +91,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Container(
|
||||
return Container(
|
||||
width: constraints.maxWidth,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
|
@ -151,8 +149,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
|
@ -163,8 +160,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
),
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -172,7 +168,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
focusedErrorBorder: InputBorder.none,
|
||||
suffixIcon: Icon(
|
||||
Icons.info,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
|
@ -182,8 +178,8 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
.bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
|
@ -240,8 +236,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
|
@ -252,8 +247,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -302,7 +296,6 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
.addToEnd(const SizedBox(height: 20.0))
|
||||
.addToStart(const SizedBox(height: 20.0)),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -97,38 +97,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
|||
name: 'scheduleCompleteVisitPage',
|
||||
path: '/scheduleCompleteVisitPage',
|
||||
builder: (context, params) => ScheduleCompleteVisitPageWidget(
|
||||
// get current datatime picker dd/mm/aaaa hh:mm:ss
|
||||
// visitStartDateStr: DateTime.now().toString(),
|
||||
// post 1 day
|
||||
// visitEndDateStr: DateTime.now().add(const Duration(days: 1)).toString(),
|
||||
visitorStrList: params.getParam(
|
||||
'visitorStrList',
|
||||
ParamType.String,
|
||||
),
|
||||
visitStartDateStr: params.getParam(
|
||||
'visitStartDateStr',
|
||||
ParamType.String,
|
||||
),
|
||||
visitEndDateStr: params.getParam(
|
||||
'visitEndDateStr',
|
||||
ParamType.String,
|
||||
),
|
||||
visitReasonStr: params.getParam(
|
||||
'visitReasonStr',
|
||||
ParamType.String,
|
||||
),
|
||||
visitLevelStr: params.getParam(
|
||||
'visitLevelStr',
|
||||
ParamType.String,
|
||||
),
|
||||
visitTempBol: params.getParam(
|
||||
'visitTempBol',
|
||||
ParamType.bool,
|
||||
),
|
||||
visitObsStr: params.getParam(
|
||||
'visitObsStr',
|
||||
ParamType.String,
|
||||
),
|
||||
visitorJsonList: params.getParam<dynamic>(
|
||||
'visitorJsonList',
|
||||
ParamType.JSON,
|
||||
|
|
|
@ -20,14 +20,14 @@ void main() async {
|
|||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
await initializeApp();
|
||||
await init();
|
||||
runApp(ChangeNotifierProvider(
|
||||
create: (context) => FFAppState(),
|
||||
child: const MyApp(),
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> initializeApp() async {
|
||||
Future<void> init() async {
|
||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
||||
await FlutterFlowTheme.initialize();
|
||||
|
|
|
@ -330,14 +330,16 @@ Widget liberationHistoryItemCard(
|
|||
})
|
||||
],
|
||||
onTapCardItemAction: () async {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
showDialog(
|
||||
// isScrollControlled: true,
|
||||
// isDismissible: true,
|
||||
// backgroundColor: Colors.transparent,
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return VisitRequestTemplateComponentWidget(
|
||||
return Dialog(
|
||||
alignment: Alignment.center,
|
||||
child: VisitRequestTemplateComponentWidget(
|
||||
// vteName: liberationHistoryItem['VTE_NOME'],
|
||||
// vteReason: liberationHistoryItem['NOT_MOTIVO'],
|
||||
// vawDate: liberationHistoryItem['NOT_STATUS'] == 'S'
|
||||
|
@ -382,12 +384,12 @@ Widget liberationHistoryItemCard(
|
|||
'Are you sure you want to approve this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
backgroundColor: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
text: FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
|
@ -411,8 +413,8 @@ Widget liberationHistoryItemCard(
|
|||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
text: FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
|
@ -475,12 +477,12 @@ Widget liberationHistoryItemCard(
|
|||
'Are you sure you want to block this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
backgroundColor: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
text: FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
|
@ -504,18 +506,20 @@ Widget liberationHistoryItemCard(
|
|||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
text: FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await answersRequest.call(
|
||||
context,
|
||||
liberationHistoryItem['NOT_ID'].toString(),
|
||||
liberationHistoryItem['NOT_ID']
|
||||
.toString(),
|
||||
'B',
|
||||
'Mensagem',
|
||||
liberationHistoryItem['VTE_ID'].toString(),
|
||||
liberationHistoryItem['VTE_ID']
|
||||
.toString(),
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
|
@ -569,6 +573,7 @@ Widget liberationHistoryItemCard(
|
|||
}),
|
||||
// changeStatusAction: answersRequest,
|
||||
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
|
||||
),
|
||||
);
|
||||
},
|
||||
).then((_) {
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
|||
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||
import 'package:hub/flutter_flow/internationalization.dart';
|
||||
import 'package:hub/flutter_flow/request_manager.dart';
|
||||
|
@ -164,11 +165,21 @@ class ScheduleCompleteVisitPageModel
|
|||
);
|
||||
|
||||
textFieldFocusNode1 = FocusNode();
|
||||
textController1 = TextEditingController();
|
||||
textController1 = TextEditingController(
|
||||
text: dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
DateTime.now().add(const Duration(minutes: 10)),
|
||||
// locale: FFLocalizations.of(context).languageCode,
|
||||
));
|
||||
textController1Validator = _textController1Validator;
|
||||
|
||||
textFieldFocusNode2 = FocusNode();
|
||||
textController2 = TextEditingController();
|
||||
textController2 = TextEditingController(
|
||||
text: dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
DateTime.now().add(const Duration(days: 1)),
|
||||
// locale: FFLocalizations.of(context).languageCode,
|
||||
));
|
||||
textController2Validator = _textController2Validator;
|
||||
|
||||
textFieldFocusNode3 = FocusNode();
|
||||
|
|
|
@ -29,22 +29,10 @@ class ScheduleCompleteVisitPageWidget extends StatefulWidget {
|
|||
const ScheduleCompleteVisitPageWidget({
|
||||
super.key,
|
||||
this.visitorStrList,
|
||||
this.visitStartDateStr,
|
||||
this.visitEndDateStr,
|
||||
this.visitReasonStr,
|
||||
this.visitLevelStr,
|
||||
this.visitTempBol,
|
||||
this.visitObsStr,
|
||||
this.visitorJsonList,
|
||||
});
|
||||
|
||||
final String? visitorStrList;
|
||||
final String? visitStartDateStr;
|
||||
final String? visitEndDateStr;
|
||||
final String? visitReasonStr;
|
||||
final String? visitLevelStr;
|
||||
final bool? visitTempBol;
|
||||
final String? visitObsStr;
|
||||
final List<dynamic>? visitorJsonList;
|
||||
|
||||
@override
|
||||
|
@ -250,10 +238,7 @@ Widget bodyScheduleCompleteVisit(
|
|||
scheduleVisit(context, _model, setState, safeSetState),
|
||||
wrapWithModel(
|
||||
model: _model,
|
||||
child: VisitHistoryWidget(
|
||||
model: _model,
|
||||
safeSetState: safeSetState,
|
||||
),
|
||||
child: VisitHistoryWidget(),
|
||||
updateCallback: () {
|
||||
setState(() {});
|
||||
},
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/actions/actions.dart';
|
||||
import 'package:hub/app_state.dart';
|
||||
|
@ -6,33 +8,24 @@ import 'package:hub/backend/api_requests/api_manager.dart';
|
|||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||
import 'package:hub/components/templates_components/details_component/details_component_action.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/internationalization.dart';
|
||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class VisitHistoryWidget extends StatelessWidget {
|
||||
final ScheduleCompleteVisitPageModel _model;
|
||||
final Function safeSetState;
|
||||
|
||||
const VisitHistoryWidget({
|
||||
class VisitHistoryWidget extends StatefulWidget {
|
||||
VisitHistoryWidget({
|
||||
Key? key,
|
||||
required ScheduleCompleteVisitPageModel model,
|
||||
required this.safeSetState,
|
||||
}) : _model = model,
|
||||
super(key: key);
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_VisitHistoryWidgetState createState() => _VisitHistoryWidgetState();
|
||||
}
|
||||
|
||||
class _VisitHistoryWidgetState extends State<VisitHistoryWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 900.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
),
|
||||
child: Consumer<ScheduleCompleteVisitPageModel>(
|
||||
builder: (context, model, _) {
|
||||
return StreamBuilder<ApiCallResponse>(
|
||||
stream: model.visitHistory(
|
||||
var response = ScheduleCompleteVisitPageModel().visitHistory(
|
||||
requestFn: () => PhpGroup.getVisitsCall.call(
|
||||
devUUID: FFAppState().devUUID,
|
||||
userUUID: FFAppState().userUUID,
|
||||
|
@ -41,7 +34,16 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
pageSize: 100,
|
||||
pageNumber: 1,
|
||||
),
|
||||
);
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 900.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
),
|
||||
// child: Consumer<ScheduleCompleteVisitPageModel>(
|
||||
child: StreamBuilder<dynamic>(
|
||||
stream: response,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return Center(
|
||||
|
@ -56,11 +58,13 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
} else if (!snapshot.hasData || snapshot.data!.jsonBody == null) {
|
||||
return const Center(child: Text('No visits found'));
|
||||
}
|
||||
final wrapGetVisitsResponse = snapshot.data!;
|
||||
final visitaWrap = PhpGroup.getVisitsCall
|
||||
var wrapGetVisitsResponse = snapshot.data!;
|
||||
var visitaWrap = PhpGroup.getVisitsCall
|
||||
.visitasList(wrapGetVisitsResponse.jsonBody)
|
||||
?.toList() ??
|
||||
[];
|
||||
log('updated');
|
||||
log('visitaWrap: ${visitaWrap[0]}');
|
||||
return ListView.builder(
|
||||
itemCount: visitaWrap.length,
|
||||
shrinkWrap: true,
|
||||
|
@ -78,8 +82,7 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
|
||||
},
|
||||
statusHashMap: [
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.active)
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
|
@ -94,8 +97,7 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
enText: 'Finished',
|
||||
): FlutterFlowTheme.of(context).success,
|
||||
},
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.unknown)
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown)
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Desconhecido',
|
||||
|
@ -110,8 +112,7 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
enText: 'Canceled',
|
||||
): FlutterFlowTheme.of(context).error,
|
||||
},
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.blocked)
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked)
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloqueado',
|
||||
|
@ -128,22 +129,53 @@ class VisitHistoryWidget extends StatelessWidget {
|
|||
},
|
||||
],
|
||||
onTapCardItemAction: () async {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
await showDialog(
|
||||
// isScrollControlled: true,
|
||||
// isDismissible: true,
|
||||
// backgroundColor: Colors.transparent,
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
|
||||
builder: (context) {
|
||||
return buildDetails(
|
||||
return Dialog(
|
||||
alignment: Alignment.center,
|
||||
child: buildDetails(
|
||||
visitaWrapItem,
|
||||
context,
|
||||
changeStatusAction,
|
||||
),
|
||||
);
|
||||
},
|
||||
).whenComplete(() async {
|
||||
log('Complete');
|
||||
final newResponseStream =
|
||||
ScheduleCompleteVisitPageModel().visitHistory(
|
||||
requestFn: () => PhpGroup.getVisitsCall.call(
|
||||
devUUID: FFAppState().devUUID,
|
||||
userUUID: FFAppState().userUUID,
|
||||
cliID: FFAppState().cliUUID,
|
||||
atividade: 'getVisitas',
|
||||
pageSize: 100,
|
||||
pageNumber: 1,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
newResponseStream.listen((newResponse) {
|
||||
log('New response received: $newResponse');
|
||||
if (mounted) {
|
||||
safeSetState(() {
|
||||
response = newResponse.jsonBody;
|
||||
log('Response updated: $response');
|
||||
});
|
||||
} else {
|
||||
log('Widget is not mounted, skipping state update.');
|
||||
}
|
||||
}).onError((err) {
|
||||
log('Error: $err');
|
||||
});
|
||||
}).catchError((err, stack) {
|
||||
log('Error: $err');
|
||||
log('Stack: $stack');
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue