WIP
This commit is contained in:
parent
5527f35e25
commit
60647a708d
|
@ -288,7 +288,9 @@ class PushNotificationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> _firebaseMessagingBackgroundHandler(
|
static Future<void> _firebaseMessagingBackgroundHandler(
|
||||||
RemoteMessage message) async {}
|
RemoteMessage message) async {
|
||||||
|
log('Handling a background message: ${message.messageId}');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class NotificationHandler {
|
class NotificationHandler {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
@ -111,24 +112,15 @@ Widget buildDetails(
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
|
||||||
context.pushNamed(
|
Navigator.push(
|
||||||
'scheduleCompleteVisitPage',
|
context,
|
||||||
queryParameters: {
|
MaterialPageRoute(
|
||||||
'dropdownValue1': visitaWrapItem['MOT_DESCRICAO'],
|
builder: (context) => ScheduleCompleteVisitPageWidget(
|
||||||
'dropdownValue2': serializeParam(
|
dropdownValue1: visitaWrapItem['MOT_DESCRICAO'],
|
||||||
visitaWrapItem['NAC_DESCRICAO'],
|
dropdownValue2: visitaWrapItem['NAC_DESCRICAO'],
|
||||||
ParamType.String,
|
visitorJsonList: [visitaWrapItem],
|
||||||
),
|
visitorStrList: visitaWrapItem['VTE_DOCUMENTO'],
|
||||||
'visitorStrList': serializeParam(
|
)),
|
||||||
visitaWrapItem['VTE_DOCUMENTO'],
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitorJsonList': serializeParam(
|
|
||||||
[visitaWrapItem],
|
|
||||||
ParamType.JSON,
|
|
||||||
isList: true,
|
|
||||||
),
|
|
||||||
}.withoutNulls,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
|
|
|
@ -30,10 +30,14 @@ import 'package:provider/provider.dart';
|
||||||
class ScheduleCompleteVisitPageWidget extends StatefulWidget {
|
class ScheduleCompleteVisitPageWidget extends StatefulWidget {
|
||||||
const ScheduleCompleteVisitPageWidget({
|
const ScheduleCompleteVisitPageWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
this.dropdownValue1,
|
||||||
|
this.dropdownValue2,
|
||||||
this.visitorStrList,
|
this.visitorStrList,
|
||||||
this.visitorJsonList,
|
this.visitorJsonList,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final String? dropdownValue1;
|
||||||
|
final String? dropdownValue2;
|
||||||
final String? visitorStrList;
|
final String? visitorStrList;
|
||||||
final List<dynamic>? visitorJsonList;
|
final List<dynamic>? visitorJsonList;
|
||||||
|
|
||||||
|
@ -75,12 +79,23 @@ class _ScheduleCompleteVisitPageWidgetState
|
||||||
.toList()
|
.toList()
|
||||||
.cast<dynamic>();
|
.cast<dynamic>();
|
||||||
_model.visitorStrList = widget.visitorStrList!;
|
_model.visitorStrList = widget.visitorStrList!;
|
||||||
|
|
||||||
|
safeSetState(() {});
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((widget.dropdownValue1 != null && widget.dropdownValue1 != '') &&
|
||||||
|
(widget.dropdownValue2 != null && widget.dropdownValue2 != '')) {
|
||||||
|
_model.dropDownValue1 = widget.dropdownValue1!;
|
||||||
|
log('_model.dropdownValue1: ${_model.dropDownValue1 ?? ''}');
|
||||||
|
_model.dropDownValue2 = widget.dropdownValue2!;
|
||||||
|
log('_model.dropdownValue2: ${_model.dropDownValue2 ?? ''}');
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_model.tabBarController = TabController(
|
_model.tabBarController = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: 2,
|
length: 2,
|
||||||
|
@ -1075,7 +1090,6 @@ Widget scheduleVisit(BuildContext context,
|
||||||
atividade: 'getDados',
|
atividade: 'getDados',
|
||||||
),
|
),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
// Customize what your widget looks like when it's loading.
|
|
||||||
if (!snapshot.hasData) {
|
if (!snapshot.hasData) {
|
||||||
return Center(
|
return Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
@ -1095,14 +1109,32 @@ Widget scheduleVisit(BuildContext context,
|
||||||
PhpGroup.getDadosCall.reasonsJsonList(
|
PhpGroup.getDadosCall.reasonsJsonList(
|
||||||
dropDownGetDadosResponse.jsonBody,
|
dropDownGetDadosResponse.jsonBody,
|
||||||
);
|
);
|
||||||
|
// Algoritmo de match
|
||||||
|
if (_model.dropDownValue1 != null &&
|
||||||
|
_model.dropDownValue1!.isNotEmpty) {
|
||||||
|
final matchedValue =
|
||||||
|
reasonsJsonList?.firstWhere(
|
||||||
|
(element) =>
|
||||||
|
element.toString() ==
|
||||||
|
_model.dropDownValue1,
|
||||||
|
orElse: () => null,
|
||||||
|
);
|
||||||
|
if (matchedValue != null) {
|
||||||
|
WidgetsBinding.instance
|
||||||
|
.addPostFrameCallback((_) {
|
||||||
|
_model.dropDownValueController1
|
||||||
|
?.value = matchedValue.toString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return FlutterFlowDropDown<String>(
|
return FlutterFlowDropDown<String>(
|
||||||
fillColor: FlutterFlowTheme.of(context)
|
fillColor: FlutterFlowTheme.of(context)
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
controller:
|
controller:
|
||||||
_model.dropDownValueController1 ??=
|
_model.dropDownValueController1 ??=
|
||||||
FormFieldController<String>(
|
FormFieldController<String>(
|
||||||
_model.dropDownValue1 ??= '',
|
_model.dropDownValue1 ?? ''),
|
||||||
),
|
|
||||||
options: reasonsJsonList != null &&
|
options: reasonsJsonList != null &&
|
||||||
reasonsJsonList != []
|
reasonsJsonList != []
|
||||||
? List<String>.from(
|
? List<String>.from(
|
||||||
|
|
Loading…
Reference in New Issue