some changes
This commit is contained in:
parent
453cec6040
commit
0f41eba57f
|
@ -10,7 +10,7 @@
|
|||
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
|
||||
|
||||
<application
|
||||
android:label="FREHub"
|
||||
android:label="Access Hub"
|
||||
tools:replace="android:label"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:ffi';
|
||||
|
||||
import 'package:f_r_e_hub/flutter_flow/permissions_util.dart';
|
||||
import 'commons/widgets/permissions_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:csv/csv.dart';
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
export '/backend/schema/util/schema_util.dart';
|
||||
|
||||
export 'device_struct.dart';
|
|
@ -1,20 +1,23 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:f_r_e_hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||
import 'package:f_r_e_hub/custom_code/actions/get_dev_u_u_i_d.dart';
|
||||
import 'package:f_r_e_hub/pages/home_page/home_page_widget.dart';
|
||||
// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart';
|
||||
import 'package:hub/commons/components/templates/exception/widget.dart';
|
||||
import 'package:hub/modals/filters/selections/widget.dart';
|
||||
import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart';
|
||||
import 'package:hub/pages/home/model.dart';
|
||||
import 'package:hub/pages/home/widget.dart';
|
||||
import 'package:hub/commons/actions/get_dev_u_u_i_d.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:sqflite/utils/utils.dart';
|
||||
import 'dart:developer';
|
||||
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||
import '/custom_code/actions/index.dart' as actions;
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/random_data_util.dart' as random_data;
|
||||
import '/commons/actions/actions.dart' as action_blocks;
|
||||
import '/commons/actions/api_calls.dart';
|
||||
import '/commons/actions/index.dart' as actions;
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import '/commons/widgets/random_data_util.dart' as random_data;
|
||||
|
||||
Future repeatVisitScheduleAction(
|
||||
BuildContext context, {
|
||||
|
@ -651,4 +654,140 @@ Widget buildQrCode(
|
|||
// String escapeMECARD(String content) {
|
||||
// // Implementação para escapar caracteres.
|
||||
// return content.replaceAll(':', '\\:'); // Exemplo simplificado.
|
||||
// }
|
||||
// }
|
||||
|
||||
/// menu
|
||||
|
||||
Future scheduleVisitOptAction(BuildContext context) async {
|
||||
await showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: OptionSelectionModalWidget(
|
||||
routesListStr: <String>[
|
||||
'scheduleCompleteVisitPage',
|
||||
'scheduleProvisionalVisitPage',
|
||||
'fastPassPage',
|
||||
],
|
||||
iconsListIcon: <IconData>[
|
||||
Icons.date_range_rounded,
|
||||
Icons.date_range_rounded,
|
||||
Icons.date_range_rounded,
|
||||
],
|
||||
nameListStr: <String>[
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Visita\nCompleta',
|
||||
enText: 'Complete\nSchedule',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Visita\nProvisória',
|
||||
enText: 'Provisional\nSchedule',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Visita\nRápida',
|
||||
enText: 'Fast\nSchedule',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future registerVisitorOptAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'registerVisitorPage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future peopleOnThePropertyAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'peopleOnThePropertyPage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.fade,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future preferencesSettings(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'preferencesSettings',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future liberationHistoryOptAction(BuildContext context) async {
|
||||
await showAdaptiveDialog(
|
||||
// isScrollControlled: true,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// enableDrag: false,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: OptionSelectionModalWidget(
|
||||
routesListStr: <String>[
|
||||
'liberationHistory',
|
||||
'acessHistoryPage',
|
||||
'scheduleCompleteVisitPage',
|
||||
// 'messageHistoryPage',
|
||||
],
|
||||
iconsListIcon: <IconData>[
|
||||
Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
// Icons.history_rounded,
|
||||
],
|
||||
nameListStr: <String>[
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Histórico\nde Liberação',
|
||||
enText: 'Liberation\nHistory',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Histórico\nde Acesso',
|
||||
enText: 'Access\nHistory',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Histórico\nde Visita',
|
||||
enText: 'Visit\nHistory',
|
||||
),
|
||||
// FFLocalizations.of(context).getVariableText(
|
||||
// ptText: 'Histórico\nde Mensagens',
|
||||
// enText: 'Message\nHistory',
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future accessQRCodeOptAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'qrCodePage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
|
@ -4,7 +4,7 @@ import 'dart:developer';
|
|||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'api_manager.dart';
|
||||
|
||||
export 'api_manager.dart' show ApiCallResponse;
|
|
@ -11,7 +11,7 @@ import 'package:equatable/equatable.dart';
|
|||
import 'package:http_parser/http_parser.dart';
|
||||
import 'package:mime_type/mime_type.dart';
|
||||
|
||||
import '/flutter_flow/uploaded_file.dart';
|
||||
import '/commons/widgets/uploaded_file.dart';
|
||||
|
||||
import 'get_streamed_response.dart';
|
||||
|
|
@ -1,15 +1,12 @@
|
|||
// Automatic FlutterFlow imports
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
import '/commons/actions/actions.dart' as action_blocks;
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'index.dart'; // Imports other custom actions
|
||||
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
|
||||
import '/commons/widgets/custom_functions.dart'; // Imports custom functions
|
||||
import 'package:flutter/material.dart';
|
||||
// Begin custom action code
|
||||
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
// Automatic FlutterFlow imports
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
import '/commons/actions/actions.dart' as action_blocks;
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'index.dart'; // Imports other custom actions
|
||||
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
|
||||
import '/commons/widgets/custom_functions.dart'; // Imports custom functions
|
||||
import 'package:flutter/material.dart';
|
||||
// Begin custom action code
|
||||
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import 'dart:developer';
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
import '/commons/actions/actions.dart' as action_blocks;
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'index.dart'; // Imports other custom actions
|
||||
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
|
||||
import '/commons/widgets/custom_functions.dart'; // Imports custom functions
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
|
@ -1,3 +1,6 @@
|
|||
export 'convert_image_file_to_base64.dart' show convertImageFileToBase64;
|
||||
export 'convert_to_upload_file.dart' show convertToUploadFile;
|
||||
export 'get_dev_u_u_i_d.dart' show getDevUUID;
|
||||
export 'actions.dart' show Actions;
|
||||
export 'api_calls.dart' show ApiCalls;
|
||||
export 'api_manager.dart' show ApiManager;
|
|
@ -1,15 +1,32 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:f_r_e_hub/pages/fast_pass_page/fast_pass_page_widget.dart';
|
||||
import 'package:f_r_e_hub/pages/message_history_page/message_history_page_widget.dart';
|
||||
import 'package:f_r_e_hub/pages/preferences_settings_page/preferences_settings_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:hub/pages/consult/access/acess_history_page_widget.dart';
|
||||
// import 'package:hub/pages/schedule/visit/fastpass/fast_pass_page_widget.dart';
|
||||
// import 'package:hub/pages/consult/message/message_history_page_widget.dart';
|
||||
// import 'package:hub/pages/settings/preferences_settings_widget.dart';
|
||||
// import 'package:hub/pages/consult/visit/visit_history_page_widget.dart';
|
||||
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/pages/consults/access/widget.dart';
|
||||
import 'package:hub/pages/consults/liberation/widget.dart';
|
||||
import 'package:hub/pages/consults/message/widget.dart';
|
||||
import 'package:hub/pages/consults/poeple/widget.dart';
|
||||
import 'package:hub/pages/consults/qrcode/widget.dart';
|
||||
import 'package:hub/pages/consults/visit/widget.dart';
|
||||
import 'package:hub/pages/home/widget.dart';
|
||||
import 'package:hub/pages/onboarding/signin/widget.dart';
|
||||
import 'package:hub/pages/onboarding/signup/widget.dart';
|
||||
import 'package:hub/pages/onboarding/welcome/widget.dart';
|
||||
import 'package:hub/pages/registers/visitor/widget.dart';
|
||||
import 'package:hub/pages/schedules/visit/complete/widget.dart';
|
||||
import 'package:hub/pages/schedules/visit/fastpass/widget.dart';
|
||||
import 'package:hub/pages/schedules/visit/provisional/widget.dart';
|
||||
import 'package:hub/pages/settings/widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import '/index.dart';
|
||||
import '../../pages/visit_history_page/visit_history_page_widget.dart';
|
||||
// import '../../pages//visit_history_page_widget.dart';
|
||||
|
||||
export 'package:go_router/go_router.dart';
|
||||
|
|
@ -4,18 +4,16 @@ import 'dart:developer';
|
|||
import 'dart:io';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:f_r_e_hub/actions/actions.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/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/commons/actions/api_calls.dart';
|
||||
import 'package:hub/commons/actions/actions.dart';
|
||||
import 'package:hub/app_state.dart';
|
||||
import 'package:hub/commons/actions/api_manager.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:hub/modals/notifications/access_notification/widget.dart';
|
||||
import 'package:hub/modals/notifications/message_notificaion/widget.dart';
|
||||
import 'package:hub/modals/notifications/visit_request/widget.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
class PushNotificationService {
|
||||
|
@ -108,17 +106,17 @@ class PushNotificationService {
|
|||
await Future.delayed(Duration(milliseconds: 100));
|
||||
}
|
||||
|
||||
const initializationSettingsAndroid = AndroidInitializationSettings('mipmap/ic_fre_black');
|
||||
const initializationSettingsIOS = DarwinInitializationSettings(
|
||||
var initializationSettingsAndroid =
|
||||
AndroidInitializationSettings('mipmap/ic_fre_black');
|
||||
var initializationSettingsIOS = DarwinInitializationSettings(
|
||||
requestAlertPermission: true,
|
||||
requestBadgePermission: true,
|
||||
requestSoundPermission: true,
|
||||
);
|
||||
const initializationSettings = InitializationSettings(
|
||||
var initializationSettings = InitializationSettings(
|
||||
android: initializationSettingsAndroid,
|
||||
iOS: initializationSettingsIOS,
|
||||
);
|
||||
|
||||
_flutterLocalNotificationsPlugin.initialize(
|
||||
initializationSettings,
|
||||
onDidReceiveNotificationResponse: (NotificationResponse response) async {
|
||||
|
@ -187,17 +185,7 @@ class PushNotificationService {
|
|||
|
||||
_onMessage.add(message);
|
||||
log('Extra: ${message.notification?.body}');
|
||||
Map<String, dynamic> extra = {};
|
||||
log('Message: ${message.data}');
|
||||
|
||||
if (message.data['click_action'] == 'mensagem') {
|
||||
extra['body'] = message.notification?.body;
|
||||
}
|
||||
|
||||
log('New Extra: $extra');
|
||||
|
||||
NotificationHandler().handleMessage(message.data, context, extra: extra);
|
||||
});
|
||||
NotificationHandler().handleMessage(message.data, context); });
|
||||
}
|
||||
|
||||
void configureTokenRefresh() {
|
||||
|
@ -273,11 +261,8 @@ class PushNotificationService {
|
|||
}
|
||||
|
||||
void _showNotification(RemoteMessage message) async {
|
||||
Map<String, dynamic> messageParsed = message.toMap();
|
||||
Map<String, dynamic> data = messageParsed['data'];
|
||||
Map<String, dynamic> notification = messageParsed['notification'];
|
||||
|
||||
String channelId = _getChannelIdBasedOnClickAction(data['click_action']);
|
||||
String channelId =
|
||||
_getChannelIdBasedOnClickAction(message.data['click_action']);
|
||||
|
||||
var androidDetails = AndroidNotificationDetails(
|
||||
channelId,
|
||||
|
@ -286,33 +271,19 @@ class PushNotificationService {
|
|||
importance: Importance.max,
|
||||
priority: Priority.high,
|
||||
);
|
||||
var iOSDetails = const DarwinNotificationDetails(
|
||||
categoryIdentifier: 'plainCategory',
|
||||
sound: 'slow_spring_board.aiff',
|
||||
presentList: true,
|
||||
interruptionLevel: InterruptionLevel.critical,
|
||||
);
|
||||
|
||||
var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
||||
var iOSDetails = DarwinNotificationDetails();
|
||||
var generalNotificationDetails =
|
||||
NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
||||
|
||||
log('Showing notification: ${message.messageId.hashCode}');
|
||||
log('Message Title: ${notification['title'].toString()}');
|
||||
log('Message Body: ${notification['body'].toString()}');
|
||||
log('Message Payload: ${data.toString()}');
|
||||
|
||||
await _flutterLocalNotificationsPlugin.show(
|
||||
DateTime.now().microsecond,
|
||||
notification['title'].toString(),
|
||||
notification['body'].toString(),
|
||||
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
|
||||
math.Random().nextInt(1 << 30),
|
||||
message.notification?.title,
|
||||
message.notification?.body,
|
||||
generalNotificationDetails,
|
||||
payload: data.toString(),
|
||||
).catchError((err, stack) {
|
||||
log('Error: $err');
|
||||
log('Stack: $stack');
|
||||
});
|
||||
|
||||
|
||||
|
||||
payload: message.data.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
_handleNotificationClick(Map<String, dynamic> payload, {Map<String, dynamic> extra = const {}}) {
|
||||
|
@ -347,15 +318,15 @@ class NotificationHandler {
|
|||
switch (message['click_action']) {
|
||||
case 'visit_request':
|
||||
_showVisitRequestDialog(message, context);
|
||||
|
||||
break;
|
||||
case 'cancel_request':
|
||||
_showVisitRequestResolvedDialog(message, context);
|
||||
case '':
|
||||
break;
|
||||
case 'access':
|
||||
_showAcessNotificationModal(message, context);
|
||||
break;
|
||||
case 'mensagem':
|
||||
_showMessageNotificationDialog(message, context, extra);
|
||||
_showMessageNotificationDialog(message, context, extra);
|
||||
break;
|
||||
case 'enroll_cond':
|
||||
log('enroll_cond');
|
||||
|
@ -382,7 +353,6 @@ class NotificationHandler {
|
|||
void _showAcessNotificationModal(
|
||||
Map<String, dynamic> message, BuildContext context) {
|
||||
log('Showing access notification dialog');
|
||||
log('Message: ${message}');
|
||||
log('USR_TIPO: ${message['USR_TIPO']}');
|
||||
log('USR_ID: ${message['USR_ID']}');
|
||||
log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}');
|
||||
|
@ -390,27 +360,21 @@ class NotificationHandler {
|
|||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
String id = _getIdBasedOnUserType(message);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: AccessNotificationModalTemplateComponentWidget(
|
||||
datetime: message['ACE_DATAHORA'].toString(),
|
||||
drive: message['SET_DESCRICAO'].toString(),
|
||||
id: message['USR_TIPO'].toString() == 'O'
|
||||
? message['USR_ID'].toString() == ''
|
||||
? '0'
|
||||
: message['USR_ID'].toString()
|
||||
: message['USR_DOCUMENTO'].toString() == ''
|
||||
? '0'
|
||||
: message['USR_DOCUMENTO'].toString(),
|
||||
name: message['PES_NOME'].toString(),
|
||||
type: message['USR_TIPO'],
|
||||
)),
|
||||
);
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: AccessNotificationModalTemplateComponentWidget(
|
||||
datetime: message['ACE_DATAHORA'].toString(),
|
||||
drive: message['ACI_DESCRICAO'].toString(),
|
||||
id: message['USR_TIPO'].toString() == 'O'
|
||||
? message['USR_ID'].toString() == ''
|
||||
? '0'
|
||||
: message['USR_ID'].toString()
|
||||
: message['USR_DOCUMENTO'].toString() == ''
|
||||
? '0'
|
||||
: message['USR_DOCUMENTO'].toString(),
|
||||
name: message['PES_NOME'].toString(),
|
||||
type: message['USR_TIPO'],
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -419,31 +383,17 @@ class NotificationHandler {
|
|||
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
|
||||
log('Showing message notification dialog');
|
||||
log('Notification "message": $message');
|
||||
log('Extra: $extra');
|
||||
Map<String, dynamic> local = {};
|
||||
|
||||
try {
|
||||
local = jsonDecode(message['local']);
|
||||
} catch (err) {
|
||||
local = message['local'];
|
||||
}
|
||||
|
||||
showDialog(
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: MessageNotificationModalTemplateComponentWidget(
|
||||
id: local['CLI_ID'].toString(),
|
||||
from: message['remetente'].toString(),
|
||||
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
|
||||
),
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: MessageNotificationModalTemplateComponentWidget(
|
||||
id: message['local']['CLI_ID'].toString(),
|
||||
from: message['remetente'].toString(),
|
||||
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -474,35 +424,6 @@ class NotificationHandler {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showVisitRequestResolvedDialog(
|
||||
Map<String, dynamic> message, BuildContext context) {
|
||||
log('Showing visit request notification dialog');
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: VisitRequestTemplateComponentWidget(
|
||||
vteName: message['nomevisita'].toString(),
|
||||
vteReason: message['motivo'].toString(),
|
||||
vteMsg: message['resposta'].toString(),
|
||||
vteDocument: message['documento'].toString(),
|
||||
vteUUID: message['codvisita'].toString(),
|
||||
vawRef: message['referencia'].toString(),
|
||||
vawStatus: message['status'].toString(),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PushNotificationManager {
|
|
@ -3,12 +3,12 @@ import 'dart:developer';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
|
||||
import '../../flutter_flow/lat_lng.dart';
|
||||
import '../../flutter_flow/place.dart';
|
||||
import '../../flutter_flow/uploaded_file.dart';
|
||||
import '/commons/widgets/lat_lng.dart';
|
||||
import '/commons/widgets/place.dart';
|
||||
import '/commons/widgets/uploaded_file.dart';
|
||||
|
||||
/// SERIALIZATION HELPERS
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
// import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
// import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:rxdart/rxdart.dart';
|
|
@ -1,5 +1,6 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'local_profile_component_widget.dart' show LocalProfileComponentWidget;
|
||||
import 'package:hub/commons/components/atoms/local_header/widget.dart';
|
||||
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LocalProfileComponentModel
|
|
@ -1,15 +1,16 @@
|
|||
import 'package:f_r_e_hub/actions/actions.dart';
|
||||
|
||||
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';
|
||||
import '/flutter_flow/custom_functions.dart' as functions;
|
||||
import '/flutter_flow/random_data_util.dart' as random_data;
|
||||
|
||||
import 'package:hub/commons/components/atoms/local_header/model.dart';
|
||||
import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart';
|
||||
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import '/commons/widgets/custom_functions.dart' as functions;
|
||||
import '/commons/widgets/random_data_util.dart' as random_data;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'local_profile_component_model.dart';
|
||||
export 'local_profile_component_model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class LocalProfileComponentWidget extends StatefulWidget {
|
||||
const LocalProfileComponentWidget({
|
|
@ -0,0 +1,147 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_item/widget.dart';
|
||||
import 'package:hub/commons/widgets/custom_icons.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_theme.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:hub/commons/widgets/internationalization.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
class MenuButtonWidget extends MenuEntry {
|
||||
const MenuButtonWidget({
|
||||
Key? key,
|
||||
this.action,
|
||||
this.title,
|
||||
this.icon,
|
||||
}) : super(key: key);
|
||||
|
||||
final Function()? action;
|
||||
final String? title;
|
||||
final IconData? icon;
|
||||
|
||||
@override
|
||||
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
||||
}
|
||||
|
||||
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
await widget.action?.call();
|
||||
},
|
||||
child: Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
blurRadius: 4.0,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).customColor5,
|
||||
offset: const Offset(
|
||||
0.0,
|
||||
2.0,
|
||||
),
|
||||
)
|
||||
],
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
color: FlutterFlowTheme.of(context).alternate,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(0.0, 0.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(
|
||||
-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(8.0, 0.0, 0.0, 0.0),
|
||||
child: Container(
|
||||
width: 30.0,
|
||||
height: 30.0,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
alignment:
|
||||
const AlignmentDirectional(
|
||||
0.0, 0.0),
|
||||
child: Icon(
|
||||
widget.icon,
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
size: 24.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(0.0, 0.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(
|
||||
0.0, 0.0),
|
||||
child: Text(
|
||||
widget.title ?? '',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleLarge
|
||||
.override(
|
||||
fontFamily: 'Nunito',
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap()
|
||||
.containsKey('Nunito'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
].divide(const SizedBox(height: 0.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_item/widget.dart';
|
||||
import 'package:hub/commons/widgets/custom_icons.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_theme.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_util.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
class MenuButtonWidget extends MenuEntry {
|
||||
const MenuButtonWidget({
|
||||
Key? key,
|
||||
this.action,
|
||||
this.title,
|
||||
this.icon,
|
||||
}) : super(key: key);
|
||||
|
||||
final Function()? action;
|
||||
final String? title;
|
||||
final IconData? icon;
|
||||
|
||||
@override
|
||||
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
||||
}
|
||||
|
||||
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
await widget.action?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 1.0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 40.0,
|
||||
height: 40.0,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
FFIcons.kfast,
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
10.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
widget.title ?? 'Menu Item',
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleLarge
|
||||
.override(
|
||||
fontFamily: 'Nunito',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
fontSize: 15.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
'Nunito'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
widget.icon,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.customColor1,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'card_item_template_component_widget.dart'
|
||||
show CardItemTemplateComponentWidget;
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'widget.dart';
|
||||
|
||||
class CardItemTemplateComponentModel
|
||||
extends FlutterFlowModel<CardItemTemplateComponentWidget> {
|
||||
@override
|
|
@ -1,14 +1,15 @@
|
|||
import 'dart:collection';
|
||||
import 'dart:developer';
|
||||
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'card_item_template_component_model.dart';
|
||||
export 'card_item_template_component_model.dart';
|
||||
|
||||
import 'model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class CardItemTemplateComponentWidget extends StatefulWidget {
|
||||
const CardItemTemplateComponentWidget({
|
||||
|
@ -20,8 +21,8 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
|
|||
});
|
||||
|
||||
final Map<String, String>? labelsHashMap;
|
||||
final Map<String, Color>? statusHashMap;
|
||||
final Map<String, String> imageHashMap; //document/vteID and type
|
||||
final List<Map<String, Color>?> statusHashMap;
|
||||
final Map<String, String> imageHashMap;
|
||||
final Future Function()? onTapCardItemAction;
|
||||
|
||||
@override
|
||||
|
@ -35,8 +36,8 @@ class _CardItemTemplateComponentWidgetState
|
|||
LinkedHashMap<String, String> get labelsLinkedHashMap =>
|
||||
LinkedHashMap.from(widget.labelsHashMap ?? {});
|
||||
|
||||
LinkedHashMap<String, Color> get statusLinkedHashMap =>
|
||||
LinkedHashMap.from(widget.statusHashMap ?? {});
|
||||
List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
|
||||
widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList();
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
|
@ -70,7 +71,8 @@ class _CardItemTemplateComponentWidgetState
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
context.watch<FFAppState>();
|
||||
log('imageHashMap: ${widget.imageHashMap}');
|
||||
|
||||
|
||||
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -178,36 +180,40 @@ class _CardItemTemplateComponentWidgetState
|
|||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 3.0),
|
||||
child: Container(
|
||||
width: 200.0,
|
||||
height: 27.0,
|
||||
decoration: BoxDecoration(
|
||||
color: statusLinkedHashMap.values.first,
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
statusLinkedHashMap.keys
|
||||
.first, // Acessa diretamente a chave como texto do status
|
||||
style: TextStyle(
|
||||
// Substitua por seu tema ou estilo de texto
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.info, // Cor do texto, ajuste conforme necessário
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: statusLinkedHashMap.expand((linkedHashMap) {
|
||||
return linkedHashMap.entries.map((MapEntry<String, Color> item) {
|
||||
return Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3.0),
|
||||
child: Container(
|
||||
width: 100.0,
|
||||
height: 27.0,
|
||||
decoration: BoxDecoration(
|
||||
color: item.value, // Usa a cor do item atual
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
item.key, // Usa a chave do item atual como texto
|
||||
style: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}).toList(),
|
||||
),
|
||||
]),
|
||||
),
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
abstract class MenuEntry extends StatefulWidget {
|
||||
const MenuEntry({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget;
|
||||
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'widget.dart';
|
||||
|
||||
class MenuListViewComponentModel
|
||||
extends FlutterFlowModel<MenuListViewComponentWidget> {
|
||||
@override
|
|
@ -0,0 +1,172 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/commons/components/atoms/menu_button_item/widget.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_item/widget.dart';
|
||||
import 'package:hub/commons/schema/enums/enums.dart';
|
||||
|
||||
import '/commons/widgets/flutter_flow_icon_button.dart';
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'model.dart';
|
||||
|
||||
|
||||
class MenuListViewComponentWidget extends StatefulWidget {
|
||||
const MenuListViewComponentWidget({
|
||||
super.key,
|
||||
required this.changeMenuStyle,
|
||||
required this.registerVisitorOptAction,
|
||||
required this.scheduleVisitOptAction,
|
||||
required this.peopleOnThePropertyOptAction,
|
||||
required this.preferencesSettings,
|
||||
required this.liberationHistoryOptAction,
|
||||
required this.accessQRCodeOptAction,
|
||||
required this.expandable,
|
||||
required this.item,
|
||||
required this.options,
|
||||
required this.messageHistoryAction,
|
||||
});
|
||||
|
||||
final bool expandable;
|
||||
final MenuItem item;
|
||||
|
||||
final List<MenuEntry> options;
|
||||
final Future Function()? changeMenuStyle;
|
||||
final Future Function()? registerVisitorOptAction;
|
||||
final Future Function()? scheduleVisitOptAction;
|
||||
final Future Function()? peopleOnThePropertyOptAction;
|
||||
final Future Function()? preferencesSettings;
|
||||
final Future Function()? liberationHistoryOptAction;
|
||||
final Future Function()? accessQRCodeOptAction;
|
||||
final Future Function()? messageHistoryAction;
|
||||
|
||||
@override
|
||||
State<MenuListViewComponentWidget> createState() =>
|
||||
_MenuListViewComponentWidgetState();
|
||||
}
|
||||
|
||||
class _MenuListViewComponentWidgetState
|
||||
extends State<MenuListViewComponentWidget> {
|
||||
late MenuListViewComponentModel _model;
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => MenuListViewComponentModel());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Wrap(
|
||||
spacing: 0.0,
|
||||
runSpacing: 0.0,
|
||||
alignment: WrapAlignment.start,
|
||||
crossAxisAlignment: WrapCrossAlignment.start,
|
||||
direction: Axis.horizontal,
|
||||
runAlignment: WrapAlignment.start,
|
||||
verticalDirection: VerticalDirection.down,
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
buildMenuItem(context),
|
||||
if (widget.expandable)
|
||||
buildExpandableButton(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildMenuItem(BuildContext context) {
|
||||
switch(widget.item) {
|
||||
case MenuItem.button:
|
||||
return SizedBox(
|
||||
height: 100,
|
||||
width: double.infinity,
|
||||
child: ListView.builder(
|
||||
addAutomaticKeepAlives: true,
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
||||
itemCount: widget.options.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height: 115,
|
||||
width: 115,
|
||||
child: widget.options[index]);
|
||||
},
|
||||
),
|
||||
);
|
||||
case MenuItem.card:
|
||||
return ListView.builder(
|
||||
addAutomaticKeepAlives: true,
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
itemCount: widget.options.length,
|
||||
itemBuilder: (context, index) {
|
||||
return MenuButtonWidget(
|
||||
action: widget.registerVisitorOptAction,
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Register Visitor',
|
||||
ptText: 'Registrar Visitante',
|
||||
),
|
||||
icon: Icons.person_add_alt_1_outlined,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Row buildExpandableButton(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Expand',
|
||||
ptText: 'Expandir',
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).title1.override(
|
||||
fontFamily: 'Nunito',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 12.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontStyle: FontStyle.normal,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: FlutterFlowIconButton(
|
||||
borderColor: Colors.transparent,
|
||||
borderRadius: 20.0,
|
||||
borderWidth: 0.0,
|
||||
buttonSize: 50.0,
|
||||
fillColor: const Color(0x00FFFFFF),
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_down_outlined,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
onPressed: () async {
|
||||
await widget.changeMenuStyle?.call();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'menu_staggered_view_component_widget.dart'
|
||||
show MenuStaggeredViewComponentWidget;
|
||||
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'widget.dart';
|
||||
|
||||
class MenuStaggeredViewComponentModel
|
||||
extends FlutterFlowModel<MenuStaggeredViewComponentWidget> {
|
||||
@override
|
|
@ -4,12 +4,12 @@ import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
|||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'menu_staggered_view_component_model.dart';
|
||||
import '/commons/widgets/flutter_flow_icon_button.dart';
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'model.dart';
|
||||
|
||||
export 'menu_staggered_view_component_model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
||||
const MenuStaggeredViewComponentWidget({
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:f_r_e_hub/backend/api_requests/api_manager.dart';
|
||||
import 'package:f_r_e_hub/flutter_flow/request_manager.dart';
|
||||
import 'package:hub/commons/actions/api_manager.dart';
|
||||
import 'package:hub/commons/widgets/request_manager.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'message_well_component_widget.dart' show MessageWellComponentWidget;
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'widget.dart';
|
||||
|
||||
class MessageWellComponentModel
|
||||
extends FlutterFlowModel<MessageWellComponentWidget> {
|
||||
final unfocusNode = FocusNode();
|
|
@ -2,10 +2,10 @@ import 'dart:async';
|
|||
import 'dart:collection';
|
||||
import 'dart:developer';
|
||||
|
||||
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/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/commons/actions/api_calls.dart';
|
||||
import 'package:hub/app_state.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_theme.dart';
|
||||
import 'package:hub/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
@ -1,11 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_list_view/model.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_staggered_view/model.dart';
|
||||
|
||||
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
||||
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'menu_component_widget.dart' show MenuComponentWidget;
|
||||
import 'package:hub/modals/filters/selections/widget.dart';
|
||||
|
||||
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'widget.dart' show MenuComponentWidget;
|
||||
|
||||
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||
/// Local state fields for this component.
|
||||
|
@ -128,13 +130,13 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
'liberationHistory',
|
||||
'acessHistoryPage',
|
||||
'scheduleCompleteVisitPage',
|
||||
// 'messageHistoryPage',
|
||||
'messageHistoryPage'
|
||||
],
|
||||
iconsListIcon: <IconData>[
|
||||
Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
// Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
],
|
||||
nameListStr: <String>[
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
|
@ -149,10 +151,10 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
ptText: 'Histórico\nde Visita',
|
||||
enText: 'Visit\nHistory',
|
||||
),
|
||||
// FFLocalizations.of(context).getVariableText(
|
||||
// ptText: 'Histórico\nde Mensagens',
|
||||
// enText: 'Message\nHistory',
|
||||
// ),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Histórico\nde Mensagens',
|
||||
enText: 'Message\nHistory',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -172,4 +174,19 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future messageHistoryAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'messageHistoryPage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
|
||||
|
||||
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:hub/commons/components/atoms/menu_button_item/widget.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_item/widget.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_list_view/widget.dart';
|
||||
import 'package:hub/commons/components/molecules/menu_staggered_view/widget.dart';
|
||||
import 'package:hub/commons/schema/enums/enums.dart';
|
||||
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class MenuComponentWidget extends StatefulWidget {
|
||||
const MenuComponentWidget({
|
||||
Key? key,
|
||||
required this.style,
|
||||
required this.item,
|
||||
required this.expandable,
|
||||
required this.options,
|
||||
});
|
||||
final MenuView style;
|
||||
final MenuItem item;
|
||||
final bool expandable;
|
||||
final List<MenuEntry> options;
|
||||
|
||||
@override
|
||||
State<MenuComponentWidget> createState() => _MenuComponentWidgetState();
|
||||
}
|
||||
|
||||
class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||
late MenuComponentModel _model;
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => MenuComponentModel());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
log('MenuComponentWidget: ${widget.options.toList().toString()}');
|
||||
return Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) {
|
||||
if (_model.isGrid == true) {
|
||||
return wrapWithModel(
|
||||
model: _model.menuListViewComponentModel,
|
||||
updateCallback: () => setState(() {}),
|
||||
updateOnChange: true,
|
||||
child: MenuListViewComponentWidget(
|
||||
options: widget.options,
|
||||
expandable: widget.expandable,
|
||||
item: widget.item,
|
||||
|
||||
|
||||
changeMenuStyle: () async {
|
||||
await _model.changeMenuStyle(context);
|
||||
setState(() {});
|
||||
},
|
||||
registerVisitorOptAction: () async {
|
||||
await _model.registerVisitorOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
scheduleVisitOptAction: () async {
|
||||
await _model.scheduleVisitOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
peopleOnThePropertyOptAction: () async {
|
||||
await _model.peopleOnThePropertyAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
preferencesSettings: () async {
|
||||
await _model.preferencesSettings(context);
|
||||
setState(() {});
|
||||
},
|
||||
liberationHistoryOptAction: () async {
|
||||
await _model.liberationHistoryOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
accessQRCodeOptAction: () async {
|
||||
await _model.accessQRCodeOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
messageHistoryAction: () async {
|
||||
await _model.messageHistoryAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return wrapWithModel(
|
||||
model: _model.menuStaggeredViewComponentModel,
|
||||
updateCallback: () => setState(() {}),
|
||||
updateOnChange: true,
|
||||
child: MenuStaggeredViewComponentWidget(
|
||||
changeMenuStyleAction: () async {
|
||||
await _model.changeMenuStyle(context);
|
||||
setState(() {});
|
||||
},
|
||||
registerVisitorOptAction: () async {
|
||||
await _model.registerVisitorOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
scheduleVisitOptAction: () async {
|
||||
await _model.scheduleVisitOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
peopleOnThePropertyOptAction: () async {
|
||||
await _model.peopleOnThePropertyAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
preferencesSettings: () async {
|
||||
await _model.preferencesSettings(context);
|
||||
setState(() {});
|
||||
},
|
||||
liberationHistoryOptAction: () async {
|
||||
await _model.liberationHistoryOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
accessQRCodeOptAction: () async {
|
||||
await _model.accessQRCodeOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){
|
||||
return wrapWithModel(
|
||||
model: _model.menuListViewComponentModel,
|
||||
updateCallback: () => setState(() {}),
|
||||
updateOnChange: true,
|
||||
child: MenuListViewComponentWidget(
|
||||
expandable: widget.expandable,
|
||||
item: widget.item,
|
||||
options: widget.options,
|
||||
messageHistoryAction: () async {
|
||||
await _model.messageHistoryAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
|
||||
|
||||
changeMenuStyle: () async {
|
||||
await _model.changeMenuStyle(context);
|
||||
setState(() {});
|
||||
},
|
||||
registerVisitorOptAction: () async {
|
||||
await _model.registerVisitorOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
scheduleVisitOptAction: () async {
|
||||
await _model.scheduleVisitOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
peopleOnThePropertyOptAction: () async {
|
||||
await _model.peopleOnThePropertyAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
preferencesSettings: () async {
|
||||
await _model.preferencesSettings(context);
|
||||
setState(() {});
|
||||
},
|
||||
liberationHistoryOptAction: () async {
|
||||
await _model.liberationHistoryOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
accessQRCodeOptAction: () async {
|
||||
await _model.accessQRCodeOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
|
||||
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future accessQRCodeOptAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'qrCodePage',
|
||||
extra: <String, dynamic>{
|
||||
kTransitionInfoKey: const TransitionInfo(
|
||||
hasTransition: true,
|
||||
transitionType: PageTransitionType.scale,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'throw_exception_widget.dart' show ThrowExceptionWidget;
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'widget.dart' show ThrowExceptionWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ThrowExceptionModel extends FlutterFlowModel<ThrowExceptionWidget> {
|
|
@ -1,11 +1,11 @@
|
|||
import '/flutter_flow/flutter_flow_animations.dart';
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/widgets/flutter_flow_animations.dart';
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'throw_exception_model.dart';
|
||||
export 'throw_exception_model.dart';
|
||||
import 'model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class ThrowExceptionWidget extends StatefulWidget {
|
||||
const ThrowExceptionWidget({
|
|
@ -5,6 +5,17 @@ enum AppHeaderComponent {
|
|||
home,
|
||||
}
|
||||
|
||||
enum MenuView {
|
||||
list_grid,
|
||||
list,
|
||||
grid,
|
||||
}
|
||||
|
||||
enum MenuItem {
|
||||
button,
|
||||
card
|
||||
}
|
||||
|
||||
extension FFEnumExtensions<T extends Enum> on T {
|
||||
String serialize() => name;
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
// ignore_for_file: unnecessary_getters_setters
|
||||
|
||||
import '/backend/schema/util/schema_util.dart';
|
||||
import '/commons/schema/util/schema_util.dart';
|
||||
|
||||
import 'index.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
|
||||
class DeviceStruct extends BaseStruct {
|
||||
DeviceStruct({
|
|
@ -0,0 +1,3 @@
|
|||
export '/commons/schema/util/schema_util.dart';
|
||||
|
||||
export 'device_struct.dart';
|
|
@ -3,8 +3,8 @@ import 'dart:convert';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:from_css_color/from_css_color.dart';
|
||||
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
|
||||
export 'package:collection/collection.dart' show ListEquality;
|
||||
export 'package:flutter/material.dart' show Color, Colors;
|
|
@ -8,8 +8,8 @@ import 'package:timeago/timeago.dart' as timeago;
|
|||
import 'lat_lng.dart';
|
||||
import 'place.dart';
|
||||
import 'uploaded_file.dart';
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/backend/schema/enums/enums.dart';
|
||||
import '/commons/schema/structs/index.dart';
|
||||
import '/commons/schema/enums/enums.dart';
|
||||
|
||||
String? isOneAcliID(String jsonString) {
|
||||
// Converte o JSON em um Map
|
|
@ -11,14 +11,14 @@ import 'package:json_path/json_path.dart';
|
|||
import 'package:timeago/timeago.dart' as timeago;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import '/main.dart';
|
||||
|
||||
|
||||
export 'keep_alive_wrapper.dart';
|
||||
export 'lat_lng.dart';
|
||||
export 'place.dart';
|
||||
export 'uploaded_file.dart';
|
||||
export '../app_state.dart';
|
||||
export '/app_state.dart';
|
||||
export 'flutter_flow_model.dart';
|
||||
export 'dart:math' show min, max;
|
||||
export 'dart:typed_data' show Uint8List;
|
||||
|
@ -27,7 +27,7 @@ export 'package:intl/intl.dart';
|
|||
export 'package:page_transition/page_transition.dart';
|
||||
export 'custom_icons.dart' show FFIcons;
|
||||
export 'internationalization.dart' show FFLocalizations;
|
||||
export 'nav/nav.dart';
|
||||
export 'package:hub/commons/actions/nav.dart';
|
||||
|
||||
T valueOrDefault<T>(T? value, T defaultValue) =>
|
||||
(value is String && value.isEmpty) || value == null ? defaultValue : value;
|
|
@ -0,0 +1,179 @@
|
|||
// // Automatic FlutterFlow imports
|
||||
// import '/commons/schema/structs/index.dart';
|
||||
// import '/commons/schema/enums/enums.dart';
|
||||
// import '/actions/actions.dart' as action_blocks;
|
||||
// import '/flutter_flow/flutter_flow_theme.dart';
|
||||
// import '/flutter_flow/flutter_flow_util.dart';
|
||||
// import 'index.dart'; // Imports other custom widgets
|
||||
// import '/custom_code/actions/index.dart'; // Imports custom actions
|
||||
// import '/flutter_flow/custom_functions.dart'; // Imports custom functions
|
||||
// import 'package:flutter/material.dart';
|
||||
// // Begin custom widget code
|
||||
// // DO NOT REMOVE OR MODIFY THE CODE ABOVE!
|
||||
|
||||
// import 'package:crop_your_image/crop_your_image.dart';
|
||||
// import 'package:google_fonts/google_fonts.dart';
|
||||
// import '/commons/firebase_storage/storage.dart';
|
||||
|
||||
// class ImageCropper extends StatefulWidget {
|
||||
// const ImageCropper({
|
||||
// super.key,
|
||||
// this.width,
|
||||
// this.height,
|
||||
// this.imageFile,
|
||||
// this.callBackAction,
|
||||
// this.currentUserId,
|
||||
// });
|
||||
|
||||
// final double? width;
|
||||
// final double? height;
|
||||
// final FFUploadedFile? imageFile;
|
||||
// final Future Function(String? url)? callBackAction;
|
||||
// final String? currentUserId;
|
||||
|
||||
// @override
|
||||
// State<ImageCropper> createState() => _ImageCropperState();
|
||||
// }
|
||||
|
||||
// class _ImageCropperState extends State<ImageCropper> {
|
||||
// bool loading = false;
|
||||
// final _crop_controller = CropController();
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Stack(
|
||||
// children: [
|
||||
// Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Container(
|
||||
// width: widget.width ?? double.infinity,
|
||||
// height: (widget.height ?? 555) - 80,
|
||||
// child: Center(
|
||||
// child: Crop(
|
||||
// image: Uint8List.fromList(widget.imageFile!.bytes!),
|
||||
// controller: _crop_controller,
|
||||
// onCropped: (image) async {
|
||||
// final path = _getStoragePath(_firebasePathPrefix(),
|
||||
// widget.imageFile!.name!, false, 0);
|
||||
// uploadData(path, image).then((value) {
|
||||
// log('image cropped');
|
||||
// widget.callBackAction!.call(value!);
|
||||
// loading = false;
|
||||
// });
|
||||
// // add error handling here
|
||||
// },
|
||||
|
||||
// aspectRatio: 1 / 1,
|
||||
// initialSize: 0.5,
|
||||
// // initialArea: Rect.fromLTWH(240, 212, 800, 600),\
|
||||
// //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80),
|
||||
// withCircleUi: true,
|
||||
// baseColor: Color.fromARGB(255, 0, 3, 22),
|
||||
// maskColor: Colors.white.withAlpha(100),
|
||||
// radius: 20,
|
||||
|
||||
// onMoved: (newRect) {
|
||||
// // do something with current cropping area.
|
||||
// },
|
||||
// onStatusChanged: (status) {
|
||||
// // do something with current CropStatus
|
||||
// },
|
||||
// cornerDotBuilder: (size, edgeAlignment) =>
|
||||
// const DotControl(color: Colors.white),
|
||||
// interactive: true,
|
||||
// // fixArea: true,
|
||||
// ))),
|
||||
// Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5),
|
||||
// child: ElevatedButton(
|
||||
// onPressed: () async {
|
||||
// if (!loading) {
|
||||
// setState(() {
|
||||
// loading = true;
|
||||
// });
|
||||
// log('Button pressed ...');
|
||||
// _crop_controller.crop();
|
||||
|
||||
// //widget.loading = true;
|
||||
// }
|
||||
// },
|
||||
// style: ButtonStyle(
|
||||
// backgroundColor: MaterialStateProperty.all<Color>(
|
||||
// FlutterFlowTheme.of(context).primaryColor,
|
||||
// ),
|
||||
// padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
|
||||
// EdgeInsets.zero,
|
||||
// ),
|
||||
// shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
// RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(100),
|
||||
// side: BorderSide.none,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// child: Container(
|
||||
// width: 250,
|
||||
// height: 50,
|
||||
// alignment: Alignment.center,
|
||||
// child: loading
|
||||
// ? CircularProgressIndicator(
|
||||
// valueColor:
|
||||
// AlwaysStoppedAnimation<Color>(Colors.white),
|
||||
// )
|
||||
// : Text(
|
||||
// 'Crop',
|
||||
// style: FlutterFlowTheme.of(context)
|
||||
// .subtitle2
|
||||
// .override(
|
||||
// fontFamily: 'Lexend',
|
||||
// color: Colors.white,
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.normal,
|
||||
// useGoogleFonts: GoogleFonts.asMap()
|
||||
// .containsKey(
|
||||
// FlutterFlowTheme.of(context)
|
||||
// .subtitle2Family),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
// ]),
|
||||
// Positioned(
|
||||
// top: 4,
|
||||
// right: 4,
|
||||
// child: IconButton(
|
||||
// icon: Icon(Icons.close),
|
||||
// onPressed: () => Navigator.pop(context),
|
||||
// ))
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
|
||||
// String _getStoragePath(
|
||||
// String? pathPrefix,
|
||||
// String filePath,
|
||||
// bool isVideo, [
|
||||
// int? index,
|
||||
// ]) {
|
||||
// pathPrefix ??= _firebasePathPrefix();
|
||||
// pathPrefix = _removeTrailingSlash(pathPrefix);
|
||||
// final timestamp = DateTime.now().microsecondsSinceEpoch;
|
||||
// final prefix = 'cropped-';
|
||||
// // Workaround fixed by https://github.com/flutter/plugins/pull/3685
|
||||
// // (not yet in stable).
|
||||
// final ext = isVideo ? 'mp4' : filePath.split('.').last;
|
||||
// final indexStr = index != null ? '_$index' : '';
|
||||
// return '$pathPrefix/$prefix$timestamp$indexStr.$ext';
|
||||
// }
|
||||
|
||||
// String? _removeTrailingSlash(String? path) =>
|
||||
// path != null && path.endsWith('/')
|
||||
// ? path.substring(0, path.length - 1)
|
||||
// : path;
|
||||
|
||||
// String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads';
|
||||
// }
|
||||
// // Set your widget name, define your parameter, and then add the
|
||||
// // boilerplate code using the green button on the right!
|
|
@ -1,5 +1,5 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'text_field_component_widget.dart' show TextFieldComponentWidget;
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'widget.dart' show TextFieldComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TextFieldComponentModel
|
|
@ -1,9 +1,9 @@
|
|||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/commons/widgets/flutter_flow_theme.dart';
|
||||
import '/commons/widgets/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'text_field_component_model.dart';
|
||||
export 'text_field_component_model.dart';
|
||||
import 'model.dart';
|
||||
export 'model.dart';
|
||||
|
||||
class TextFieldComponentWidget extends StatefulWidget {
|
||||
const TextFieldComponentWidget({
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue