WIP
This commit is contained in:
parent
c377524735
commit
a1d361b777
|
@ -63,36 +63,34 @@ class PhpGroup {
|
|||
}
|
||||
|
||||
class GetProvSchedules {
|
||||
Future<ApiCallResponse> call(final String page) async {
|
||||
// final String baseUrl = PhpGroup.getBaseUrl();
|
||||
// final String devUUID = (await StorageHelper().g(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
// final String userUUID = (await StorageHelper().g(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
// final String cliID = (await StorageHelper().g(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
// const String atividade = 'getProvSchedules';
|
||||
// const String pageSize = '10';
|
||||
final String baseUrl = 'http://localhost:3000';
|
||||
Future<ApiCallResponse> call(final String page, final String status) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
const String atividade = 'getAgendamentoProv';
|
||||
const String pageSize = '10';
|
||||
// const String baseUrl = 'http://localhost:3000';
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'getProvSchedules',
|
||||
apiUrl: '$baseUrl/getAgendamentoProv.php',
|
||||
apiUrl: '$baseUrl/processRequest.php',
|
||||
callType: ApiCallType.POST,
|
||||
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
params: {
|
||||
"proId": "8",
|
||||
"status": "AT",
|
||||
"page": page,
|
||||
"pageSize": "10"
|
||||
// 'devUUID': devUUID,
|
||||
// 'userUUID': userUUID,
|
||||
// 'cliID': cliID,
|
||||
// 'atividade': atividade,
|
||||
// 'page': page,
|
||||
// 'pageSize': pageSize,
|
||||
if(status != '') 'status': status,
|
||||
'devUUID': devUUID,
|
||||
'userUUID': userUUID,
|
||||
'cliID': cliID,
|
||||
'atividade': atividade,
|
||||
'page': page,
|
||||
'pageSize': pageSize,
|
||||
},
|
||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||
returnBody: true,
|
||||
encodeBodyUtf8: false,
|
||||
decodeUtf8: false,
|
||||
cache: false,
|
||||
isStreamingApi: false,
|
||||
alwaysAllowBody: false,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -165,6 +165,7 @@ class _CardItemTemplateComponentWidgetState extends State<CardItemTemplateCompon
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
..._generateLabels(),
|
||||
SizedBox(height: 3),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
|
|
|
@ -241,9 +241,7 @@ class _ProvisionalScheduleHistoryState extends State<ProvisionalScheduleHistoryS
|
|||
Future<ApiCallResponse?> fetchProvisionalScheduleHistoryService() async {
|
||||
try {
|
||||
setState(() => _loading = true);
|
||||
var response = await PhpGroup.getProvSchedules.call(
|
||||
_pageNumber.toString()
|
||||
);
|
||||
var response = await PhpGroup.getProvSchedules.call(_pageNumber.toString());
|
||||
|
||||
final List<dynamic> ProvisionalScheduleHistory = response.jsonBody['agendamento']['value'] ?? [];
|
||||
|
||||
|
@ -447,4 +445,5 @@ class _ProvisionalScheduleHistoryState extends State<ProvisionalScheduleHistoryS
|
|||
"https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg",
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/form_field_controller.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
|
||||
|
||||
|
||||
class FilterModal extends FlutterFlowModel<FilterModalWidget> {
|
||||
FocusNode? textFieldFocusNode;
|
||||
TextEditingController? textController;
|
||||
String? Function(BuildContext, String?)? textControllerValidator;
|
||||
bool? checkboxValue1;
|
||||
bool? checkboxValue2;
|
||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
textFieldFocusNode?.dispose();
|
||||
textController?.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
class FilterModalWidget extends StatefulWidget {
|
||||
final Map<String, dynamic> defaultSelections;
|
||||
final Map<String, List<Map<String, String>>> filterOptions;
|
||||
final Map<String, String> filterTitles;
|
||||
|
||||
const FilterModalWidget({
|
||||
super.key,
|
||||
required this.defaultSelections,
|
||||
required this.filterOptions,
|
||||
required this.filterTitles,
|
||||
});
|
||||
|
||||
@override
|
||||
_FilterModalWidgetState createState() => _FilterModalWidgetState();
|
||||
}
|
||||
|
||||
class _FilterModalWidgetState extends State<FilterModalWidget> {
|
||||
late FilterModal _model;
|
||||
late Map<String, dynamic> selected;
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_model = createModel(context, () => FilterModal());
|
||||
|
||||
_model.textController ??= TextEditingController();
|
||||
_model.textFieldFocusNode ??= FocusNode();
|
||||
|
||||
selected = widget.defaultSelections;
|
||||
}
|
||||
|
||||
void _applyFilter() {
|
||||
Map<String, String> filterResult = {
|
||||
'search': _model.textController?.text == '' ? '' : _model.textController!.text.toLowerCase(),
|
||||
};
|
||||
|
||||
widget.filterOptions.forEach((key, options) {
|
||||
filterResult[key] = selected[key]!.isEmpty || selected[key]!.length > 1
|
||||
? ''
|
||||
: selected[key]!;
|
||||
});
|
||||
|
||||
context.pop(filterResult);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) {
|
||||
double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context);
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 3.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
widget.filterTitles[key]!,
|
||||
textAlign: TextAlign.left,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: limitedInputFontSize,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: options.length,
|
||||
itemBuilder: (context, index) {
|
||||
final option = options[index];
|
||||
return CheckboxListTile(
|
||||
title: Text(
|
||||
option['title']!,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: limitedInputFontSize,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
dense: true,
|
||||
value: selected[key]!.contains(option['value']),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
if (value == true) {
|
||||
if (!selected[key]!.contains(option['value'])) {
|
||||
selected[key] = (option['value']);
|
||||
}
|
||||
} else {
|
||||
selected[key] = '';
|
||||
}
|
||||
});
|
||||
},
|
||||
activeColor: FlutterFlowTheme.of(context).primary,
|
||||
checkColor: FlutterFlowTheme.of(context).info,
|
||||
checkboxShape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
enableFeedback: true,
|
||||
side: BorderSide(
|
||||
width: 5,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
|
||||
return Center(
|
||||
child: Container(
|
||||
width: screenWidth - (screenWidth * 0.35),
|
||||
height: screenWidth - (screenWidth * 0.1),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText('yfj9pd6k'),
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: LimitedFontSizeUtil.getHeaderFontSize(context),
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: widget.filterOptions.keys.map((key) {
|
||||
return _buildCheckboxListTile(key, widget.filterOptions[key]!, 14);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: _applyFilter,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: FlutterFlowTheme.of(context).info,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
child: Text(FFLocalizations.of(context).getText('88kshkph'),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: LimitedFontSizeUtil.getInputFontSize(context),
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export 'filter_modal.dart';
|
|
@ -75,13 +75,16 @@ class VisitsModel extends FlutterFlowModel<VehicleOnTheProperty> {
|
|||
imagePath:
|
||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${devUUID}&cliID=${cliUUID}&atividade=getFoto&Documento=${item['VDO_DOCUMENTO']}&tipo=E',
|
||||
statusHashMap: [
|
||||
if (item['VTA_FIXA'] != null)
|
||||
Map<String, Color>.from({
|
||||
item['VTA_FIXA']
|
||||
? FFLocalizations.of(context).getVariableText(ptText: "Entrada Única", enText: "Single Entry")
|
||||
: FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Entrada Recorrente", enText: "Recurrent Entry"): FlutterFlowTheme.of(context).warning
|
||||
}),
|
||||
]);
|
||||
Map<String, Color>.from({
|
||||
if (item['VTA_FIXA'] != null)
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: item['VTA_FIXA'] ? "Entrada Única" : "Entrada Recorrente",
|
||||
enText: item['VTA_FIXA'] ? "Single Entry" : "Recurrent Entry",
|
||||
): item['VTA_FIXA'] == true
|
||||
? FlutterFlowTheme.of(context).success
|
||||
: FlutterFlowTheme.of(context).warning,
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,14 +232,14 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> with TickerPr
|
|||
uItem['MOT_DESCRICAO'][0].toUpperCase() + uItem['MOT_DESCRICAO'].substring(1).toLowerCase(),
|
||||
},
|
||||
statusHashMap: [
|
||||
if (uItem['VTA_FIXA'] == true)
|
||||
if (uItem['VTA_FIXA'] == false)
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Recorrente',
|
||||
enText: 'Recurrent',
|
||||
): FlutterFlowTheme.of(context).warning,
|
||||
},
|
||||
if (uItem['VTA_FIXA'] == false)
|
||||
if (uItem['VTA_FIXA'] == true)
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Única',
|
||||
|
|
Loading…
Reference in New Issue