dart format
This commit is contained in:
parent
a25f96bd7e
commit
fa393a0b33
|
@ -13,8 +13,7 @@ void main() {
|
|||
|
||||
group('Initialization', () {
|
||||
group('Navigation', () {
|
||||
setUpAll(() async =>
|
||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
testWidgets('Test Welcome', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testWelcome();
|
||||
|
@ -25,16 +24,14 @@ void main() {
|
|||
});
|
||||
group('Authentication', () {
|
||||
group('Sign in', () {
|
||||
setUpAll(() async =>
|
||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
testWidgets('Test Sign In', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testSignIn();
|
||||
});
|
||||
});
|
||||
group('Sign up', () {
|
||||
setUpAll(() async =>
|
||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
|
||||
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
||||
widget = tester;
|
||||
await _testSignUp();
|
||||
|
@ -96,14 +93,8 @@ Future<void> _testWelcome() async {
|
|||
Future<void> _testSignIn() async {
|
||||
await widget.pumpWidget(const App());
|
||||
await _navigateToSignIn();
|
||||
await _auth({
|
||||
'emailTextFormField': 'erro@exemplo.com',
|
||||
'passwordTextFormField': '12345678'
|
||||
});
|
||||
await _auth({
|
||||
'emailTextFormField': 'email_app@exemplo.com',
|
||||
'passwordTextFormField': '12345678'
|
||||
});
|
||||
await _auth({'emailTextFormField': 'erro@exemplo.com', 'passwordTextFormField': '12345678'});
|
||||
await _auth({'emailTextFormField': 'email_app@exemplo.com', 'passwordTextFormField': '12345678'});
|
||||
}
|
||||
|
||||
Future<void> _testSignUp() async {
|
||||
|
@ -120,17 +111,10 @@ Future<void> _testSignUp() async {
|
|||
var name = randomString(7, 7, true, true, true);
|
||||
var email = '$name@example.com';
|
||||
var password = '12345678';
|
||||
credentials = {
|
||||
'nameTextFormField': name,
|
||||
'emailTextFormField': email,
|
||||
'passwordTextFormField': password
|
||||
};
|
||||
credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password};
|
||||
await _navigateToSignUp();
|
||||
await _auth(credentials);
|
||||
credentials = {
|
||||
'emailTextFormField': email,
|
||||
'passwordTextFormField': password
|
||||
};
|
||||
credentials = {'emailTextFormField': email, 'passwordTextFormField': password};
|
||||
await _auth(credentials);
|
||||
}
|
||||
|
||||
|
@ -152,20 +136,17 @@ Future<void> _testForgotPassword() async {
|
|||
|
||||
Future<void> _recoveryPassword() async {
|
||||
await widget.pumpAndSettle();
|
||||
final Finder forgotPassword =
|
||||
find.byKey(const ValueKey<String>('ForgotPassword'));
|
||||
final Finder forgotPassword = find.byKey(const ValueKey<String>('ForgotPassword'));
|
||||
if (forgotPassword.evaluate().isNotEmpty) await widget.tap(forgotPassword);
|
||||
await widget.ensureVisible(forgotPassword);
|
||||
await widget.pumpAndSettle();
|
||||
}
|
||||
|
||||
Future<void> _navigateBackUsingSystemGesture() async =>
|
||||
IntegrationTestWidgetsFlutterBinding.instance.keyboard
|
||||
.isLogicalKeyPressed(LogicalKeyboardKey.escape);
|
||||
IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape);
|
||||
Future<void> _navigateToSignUp() async {
|
||||
await widget.pumpAndSettle();
|
||||
final Finder navToSignUp =
|
||||
find.byKey(const ValueKey<String>('toggleSignUpPage'));
|
||||
final Finder navToSignUp = find.byKey(const ValueKey<String>('toggleSignUpPage'));
|
||||
if (navToSignUp.evaluate().isNotEmpty) {
|
||||
await widget.tap(navToSignUp);
|
||||
await widget.pumpAndSettle();
|
||||
|
@ -174,8 +155,7 @@ Future<void> _navigateToSignUp() async {
|
|||
|
||||
Future<void> _navigateToSignIn() async {
|
||||
await widget.pumpAndSettle();
|
||||
final Finder navToSignIn =
|
||||
find.byKey(const ValueKey<String>('toggleSignInPage'));
|
||||
final Finder navToSignIn = find.byKey(const ValueKey<String>('toggleSignInPage'));
|
||||
expect(navToSignIn, findsOneWidget);
|
||||
if (navToSignIn.evaluate().isNotEmpty) {
|
||||
await widget.tap(navToSignIn);
|
||||
|
@ -214,8 +194,7 @@ Future<void> _submit(String key) async {
|
|||
await widget.pumpAndSettle();
|
||||
}
|
||||
|
||||
final Finder throwExceptionWidget =
|
||||
find.byKey(const ValueKey<String>('ThrowExceptionWidget'));
|
||||
final Finder throwExceptionWidget = find.byKey(const ValueKey<String>('ThrowExceptionWidget'));
|
||||
await widget.pumpAndSettle();
|
||||
if (throwExceptionWidget.evaluate().isNotEmpty) {
|
||||
await widget.ensureVisible(throwExceptionWidget);
|
||||
|
|
|
@ -2520,7 +2520,8 @@ class ApiPagingParams {
|
|||
});
|
||||
|
||||
@override
|
||||
String toString() => 'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)';
|
||||
String toString() =>
|
||||
'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)';
|
||||
}
|
||||
|
||||
String _toEncodable(dynamic item) {
|
||||
|
|
|
@ -107,9 +107,7 @@ class ApiCallResponse {
|
|||
final Object? exception;
|
||||
bool get succeeded => statusCode >= 200 && statusCode < 300;
|
||||
String getHeader(String headerName) => headers[headerName] ?? '';
|
||||
String get bodyText =>
|
||||
response?.body ??
|
||||
(jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
||||
String get bodyText => response?.body ?? (jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
||||
String get exceptionMessage => exception.toString();
|
||||
|
||||
static ApiCallResponse fromHttpResponse(
|
||||
|
@ -123,9 +121,7 @@ class ApiCallResponse {
|
|||
if (bodyType == BodyType.BLOB) {
|
||||
jsonBody = response.bodyBytes;
|
||||
} else {
|
||||
final responseBody = decodeUtf8 && returnBody
|
||||
? const Utf8Decoder().convert(response.bodyBytes)
|
||||
: response.body;
|
||||
final responseBody = decodeUtf8 && returnBody ? const Utf8Decoder().convert(response.bodyBytes) : response.body;
|
||||
jsonBody = returnBody ? json.decode(responseBody) : null;
|
||||
}
|
||||
} catch (_) {}
|
||||
|
@ -137,8 +133,7 @@ class ApiCallResponse {
|
|||
);
|
||||
}
|
||||
|
||||
static ApiCallResponse fromCloudCallResponse(Map<String, dynamic> response) =>
|
||||
ApiCallResponse(
|
||||
static ApiCallResponse fromCloudCallResponse(Map<String, dynamic> response) => ApiCallResponse(
|
||||
response['body'],
|
||||
ApiManager.toStringMap(response['headers'] ?? {}),
|
||||
response['statusCode'] ?? 400,
|
||||
|
@ -155,17 +150,14 @@ class ApiManager {
|
|||
|
||||
static String? _accessToken;
|
||||
|
||||
static void clearCache(String callName) => _apiCache.keys
|
||||
.toSet()
|
||||
.forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
||||
static void clearCache(String callName) =>
|
||||
_apiCache.keys.toSet().forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
||||
|
||||
static Map<String, String> toStringMap(Map map) =>
|
||||
map.map((key, value) => MapEntry(key.toString(), value.toString()));
|
||||
|
||||
static String asQueryParams(Map<String, dynamic> map) => map.entries
|
||||
.map((e) =>
|
||||
"${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}")
|
||||
.join('&');
|
||||
static String asQueryParams(Map<String, dynamic> map) =>
|
||||
map.entries.map((e) => "${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}").join('&');
|
||||
|
||||
static Future<ApiCallResponse> urlRequest(
|
||||
ApiCallType callType,
|
||||
|
@ -179,15 +171,13 @@ class ApiManager {
|
|||
BodyType? bodyType,
|
||||
}) async {
|
||||
if (params.isNotEmpty) {
|
||||
final specifier =
|
||||
Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?';
|
||||
final specifier = Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?';
|
||||
apiUrl = '$apiUrl$specifier${asQueryParams(params)}';
|
||||
}
|
||||
if (isStreamingApi) {
|
||||
client ??= http.Client();
|
||||
final request =
|
||||
http.Request(callType.toString().split('.').last, Uri.parse(apiUrl))
|
||||
..headers.addAll(toStringMap(headers));
|
||||
final request = http.Request(callType.toString().split('.').last, Uri.parse(apiUrl))
|
||||
..headers.addAll(toStringMap(headers));
|
||||
final streamedResponse = await getStreamedResponse(request);
|
||||
return ApiCallResponse(
|
||||
null,
|
||||
|
@ -199,10 +189,8 @@ class ApiManager {
|
|||
final makeRequest = callType == ApiCallType.GET
|
||||
? (client != null ? client.get : http.get)
|
||||
: (client != null ? client.delete : http.delete);
|
||||
final response =
|
||||
await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
||||
return ApiCallResponse.fromHttpResponse(
|
||||
response, returnBody, decodeUtf8, bodyType);
|
||||
final response = await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
||||
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||
}
|
||||
|
||||
static Future<ApiCallResponse> requestWithBody(
|
||||
|
@ -224,13 +212,11 @@ class ApiManager {
|
|||
(alwaysAllowBody && type == ApiCallType.DELETE),
|
||||
'Invalid ApiCallType $type for request with body',
|
||||
);
|
||||
final postBody =
|
||||
createBody(headers, params, body, bodyType, encodeBodyUtf8);
|
||||
final postBody = createBody(headers, params, body, bodyType, encodeBodyUtf8);
|
||||
if (isStreamingApi) {
|
||||
client ??= http.Client();
|
||||
final request =
|
||||
http.Request(type.toString().split('.').last, Uri.parse(apiUrl))
|
||||
..headers.addAll(toStringMap(headers));
|
||||
final request = http.Request(type.toString().split('.').last, Uri.parse(apiUrl))
|
||||
..headers.addAll(toStringMap(headers));
|
||||
request.body = postBody;
|
||||
final streamedResponse = await getStreamedResponse(request);
|
||||
return ApiCallResponse(
|
||||
|
@ -242,8 +228,7 @@ class ApiManager {
|
|||
}
|
||||
|
||||
if (bodyType == BodyType.MULTIPART) {
|
||||
return multipartRequest(type, apiUrl, headers, params, returnBody,
|
||||
decodeUtf8, alwaysAllowBody, bodyType);
|
||||
return multipartRequest(type, apiUrl, headers, params, returnBody, decodeUtf8, alwaysAllowBody, bodyType);
|
||||
}
|
||||
|
||||
final requestFn = {
|
||||
|
@ -252,10 +237,8 @@ class ApiManager {
|
|||
ApiCallType.PATCH: client != null ? client.patch : http.patch,
|
||||
ApiCallType.DELETE: client != null ? client.delete : http.delete,
|
||||
}[type]!;
|
||||
final response = await requestFn(Uri.parse(apiUrl),
|
||||
headers: toStringMap(headers), body: postBody);
|
||||
return ApiCallResponse.fromHttpResponse(
|
||||
response, returnBody, decodeUtf8, bodyType);
|
||||
final response = await requestFn(Uri.parse(apiUrl), headers: toStringMap(headers), body: postBody);
|
||||
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||
}
|
||||
|
||||
static Future<ApiCallResponse> multipartRequest(
|
||||
|
@ -275,19 +258,14 @@ class ApiManager {
|
|||
);
|
||||
|
||||
bool isFile(dynamic e) =>
|
||||
e is FFUploadedFile ||
|
||||
e is List<FFUploadedFile> ||
|
||||
(e is List && e.firstOrNull is FFUploadedFile);
|
||||
e is FFUploadedFile || e is List<FFUploadedFile> || (e is List && e.firstOrNull is FFUploadedFile);
|
||||
|
||||
final nonFileParams = toStringMap(
|
||||
Map.fromEntries(params.entries.where((e) => !isFile(e.value))));
|
||||
final nonFileParams = toStringMap(Map.fromEntries(params.entries.where((e) => !isFile(e.value))));
|
||||
|
||||
List<http.MultipartFile> files = [];
|
||||
params.entries.where((e) => isFile(e.value)).forEach((e) {
|
||||
final param = e.value;
|
||||
final uploadedFiles = param is List
|
||||
? param as List<FFUploadedFile>
|
||||
: [param as FFUploadedFile];
|
||||
final uploadedFiles = param is List ? param as List<FFUploadedFile> : [param as FFUploadedFile];
|
||||
for (var uploadedFile in uploadedFiles) {
|
||||
files.add(
|
||||
http.MultipartFile.fromBytes(
|
||||
|
@ -300,15 +278,13 @@ class ApiManager {
|
|||
}
|
||||
});
|
||||
|
||||
final request = http.MultipartRequest(
|
||||
type.toString().split('.').last, Uri.parse(apiUrl))
|
||||
final request = http.MultipartRequest(type.toString().split('.').last, Uri.parse(apiUrl))
|
||||
..headers.addAll(toStringMap(headers))
|
||||
..files.addAll(files);
|
||||
nonFileParams.forEach((key, value) => request.fields[key] = value);
|
||||
|
||||
final response = await http.Response.fromStream(await request.send());
|
||||
return ApiCallResponse.fromHttpResponse(
|
||||
response, returnBody, decodeUtf8, bodyType);
|
||||
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||
}
|
||||
|
||||
static MediaType? _getMediaType(String? filename) {
|
||||
|
@ -357,13 +333,10 @@ class ApiManager {
|
|||
case null:
|
||||
break;
|
||||
}
|
||||
if (contentType != null &&
|
||||
!headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
||||
if (contentType != null && !headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
||||
headers['Content-Type'] = contentType;
|
||||
}
|
||||
return encodeBodyUtf8 && postBody is String
|
||||
? utf8.encode(postBody)
|
||||
: postBody;
|
||||
return encodeBodyUtf8 && postBody is String ? utf8.encode(postBody) : postBody;
|
||||
}
|
||||
|
||||
Future<ApiCallResponse> call(ApiCallOptions options) => makeApiCall(
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:http/http.dart';
|
||||
|
||||
Future<StreamedResponse> getStreamedResponse(Request request) =>
|
||||
Client().send(request);
|
||||
Future<StreamedResponse> getStreamedResponse(Request request) => Client().send(request);
|
||||
|
|
|
@ -16,8 +16,7 @@ Future<void> handleMessage(RemoteMessage message) async {
|
|||
|
||||
class FirebaseMessagingService {
|
||||
// Singleton instance
|
||||
static final FirebaseMessagingService _instance =
|
||||
FirebaseMessagingService._internal();
|
||||
static final FirebaseMessagingService _instance = FirebaseMessagingService._internal();
|
||||
|
||||
// Factory constructor
|
||||
factory FirebaseMessagingService() => _instance;
|
||||
|
@ -36,8 +35,7 @@ class FirebaseMessagingService {
|
|||
_firebaseMessaging.pluginConstants;
|
||||
}
|
||||
|
||||
static Future<String> getToken() async =>
|
||||
await FirebaseMessaging.instance.getToken() ?? '';
|
||||
static Future<String> getToken() async => await FirebaseMessaging.instance.getToken() ?? '';
|
||||
|
||||
Future<void> updateDeviceToken() async {
|
||||
try {
|
||||
|
|
|
@ -11,8 +11,7 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
|||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
|
||||
Future<void> onMessageReceived(
|
||||
Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||
|
||||
final cliUUID = StorageUtil().cliUUID;
|
||||
|
@ -62,10 +61,8 @@ Future<void> onMessageReceived(
|
|||
enText: 'Approve Visit',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja aprovar essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to approve this visit?',
|
||||
ptText: 'Você tem certeza que deseja aprovar essa visita?',
|
||||
enText: 'Are you sure you want to approve this visit?',
|
||||
),
|
||||
() async {
|
||||
await answersRequest(
|
||||
|
@ -102,10 +99,8 @@ Future<void> onMessageReceived(
|
|||
enText: 'Block Visit',
|
||||
),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja bloquear essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to block this visit?',
|
||||
ptText: 'Você tem certeza que deseja bloquear essa visita?',
|
||||
enText: 'Are you sure you want to block this visit?',
|
||||
), () async {
|
||||
await answersRequest
|
||||
.call(
|
||||
|
@ -190,9 +185,7 @@ Future<void> onMessageReceived(
|
|||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Type',
|
||||
ptText: 'Tipo',
|
||||
): payload['USR_TIPO'].toString() == 'O'
|
||||
? 'Morador'
|
||||
: 'Visitante',
|
||||
): payload['USR_TIPO'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Access Date',
|
||||
ptText: 'Data de Acesso',
|
||||
|
@ -235,11 +228,8 @@ Future<void> onMessageReceived(
|
|||
child: MessageNotificationModalTemplateComponentWidget(
|
||||
id: localId,
|
||||
from: payload['remetente'].toString(),
|
||||
to: payload['destinatario'].toString() == 'O'
|
||||
? 'Morador'
|
||||
: 'Visitante',
|
||||
message:
|
||||
extra.toString().isEmpty ? 'Unknown' : extra.toString(),
|
||||
to: payload['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||
message: extra.toString().isEmpty ? 'Unknown' : extra.toString(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -274,16 +264,10 @@ class NotificationService {
|
|||
ledColor: Colors.white,
|
||||
)
|
||||
],
|
||||
channelGroups: [
|
||||
NotificationChannelGroup(
|
||||
channelGroupKey: 'basic_channel_group',
|
||||
channelGroupName: 'group_1')
|
||||
],
|
||||
channelGroups: [NotificationChannelGroup(channelGroupKey: 'basic_channel_group', channelGroupName: 'group_1')],
|
||||
debug: kDebugMode);
|
||||
|
||||
await AwesomeNotifications()
|
||||
.isNotificationAllowed()
|
||||
.then((isAllowed) async {
|
||||
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||
final bool requestOSnotification = StorageUtil().requestOSnotification;
|
||||
|
||||
if (requestOSnotification == false) {
|
||||
|
@ -302,22 +286,18 @@ class NotificationService {
|
|||
onDismissActionReceivedMethod: onDismissActionReceivedMethod);
|
||||
}
|
||||
|
||||
static Future<void> onActionReceivedMethod(
|
||||
ReceivedAction receivedAction) async {
|
||||
static Future<void> onActionReceivedMethod(ReceivedAction receivedAction) async {
|
||||
final payload = receivedAction.payload ?? {};
|
||||
final extra = receivedAction.body;
|
||||
final handleClick = payload['click_action'];
|
||||
onMessageReceived(payload, extra, handleClick);
|
||||
}
|
||||
|
||||
static Future<void> onNotificationCreatedMethod(
|
||||
ReceivedNotification receivedNotification) async {}
|
||||
static Future<void> onNotificationCreatedMethod(ReceivedNotification receivedNotification) async {}
|
||||
|
||||
static Future<void> onNotificationDisplayedMethod(
|
||||
ReceivedNotification receivedNotification) async {}
|
||||
static Future<void> onNotificationDisplayedMethod(ReceivedNotification receivedNotification) async {}
|
||||
|
||||
static Future<void> onDismissActionReceivedMethod(
|
||||
ReceivedAction receivedAction) async {}
|
||||
static Future<void> onDismissActionReceivedMethod(ReceivedAction receivedAction) async {}
|
||||
|
||||
static Future<void> show({
|
||||
required final String title,
|
||||
|
@ -351,8 +331,7 @@ class NotificationService {
|
|||
schedule: scheduled
|
||||
? NotificationInterval(
|
||||
interval: Duration(seconds: interval!),
|
||||
timeZone:
|
||||
await AwesomeNotifications().getLocalTimeZoneIdentifier(),
|
||||
timeZone: await AwesomeNotifications().getLocalTimeZoneIdentifier(),
|
||||
preciseAlarm: true)
|
||||
: null);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
// ignore_for_file: unnecessary_getters_setters
|
||||
|
||||
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
|
||||
import 'index.dart';
|
||||
|
||||
|
||||
class DeviceStruct extends BaseStruct {
|
||||
DeviceStruct({
|
||||
String? devUUID,
|
||||
|
@ -67,8 +65,7 @@ class DeviceStruct extends BaseStruct {
|
|||
),
|
||||
}.withoutNulls;
|
||||
|
||||
static DeviceStruct fromSerializableMap(Map<String, dynamic> data) =>
|
||||
DeviceStruct(
|
||||
static DeviceStruct fromSerializableMap(Map<String, dynamic> data) => DeviceStruct(
|
||||
devUUID: deserializeParam(
|
||||
data['devUUID'],
|
||||
ParamType.String,
|
||||
|
@ -98,8 +95,7 @@ class DeviceStruct extends BaseStruct {
|
|||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
const ListEquality().hash([devUUID, version, description]);
|
||||
int get hashCode => const ListEquality().hash([devUUID, version, description]);
|
||||
}
|
||||
|
||||
DeviceStruct createDeviceStruct({
|
||||
|
@ -111,4 +107,4 @@ DeviceStruct createDeviceStruct({
|
|||
devUUID: devUUID,
|
||||
version: version,
|
||||
description: description,
|
||||
);
|
||||
);
|
||||
|
|
|
@ -6,13 +6,10 @@ import 'package:hub/backend/schema/enums/enums.dart';
|
|||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
||||
|
||||
|
||||
|
||||
export 'package:collection/collection.dart' show ListEquality;
|
||||
export 'package:flutter/material.dart' show Color, Colors;
|
||||
export 'package:from_css_color/from_css_color.dart';
|
||||
|
||||
|
||||
typedef StructBuilder<T> = T Function(Map<String, dynamic> data);
|
||||
|
||||
abstract class BaseStruct {
|
||||
|
@ -39,8 +36,7 @@ dynamic deserializeStructParam<T>(
|
|||
return null;
|
||||
}
|
||||
return paramValues
|
||||
.map<T>((e) => deserializeStructParam<T>(e, paramType, false,
|
||||
structBuilder: structBuilder))
|
||||
.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder))
|
||||
.toList();
|
||||
} else if (param is Map<String, dynamic>) {
|
||||
return structBuilder(param);
|
||||
|
@ -58,16 +54,9 @@ List<T>? getStructList<T>(
|
|||
dynamic value,
|
||||
StructBuilder<T> structBuilder,
|
||||
) =>
|
||||
value is! List
|
||||
? null
|
||||
: value
|
||||
.whereType<Map<String, dynamic>>()
|
||||
.map((e) => structBuilder(e))
|
||||
.toList();
|
||||
value is! List ? null : value.whereType<Map<String, dynamic>>().map((e) => structBuilder(e)).toList();
|
||||
|
||||
List<T>? getEnumList<T>(dynamic value) => value is! List
|
||||
? null
|
||||
: value.map((e) => deserializeEnum<T>(e)).withoutNulls;
|
||||
List<T>? getEnumList<T>(dynamic value) => value is! List ? null : value.map((e) => deserializeEnum<T>(e)).withoutNulls;
|
||||
|
||||
Color? getSchemaColor(dynamic value) => value is String
|
||||
? fromCssColor(value)
|
||||
|
@ -75,8 +64,6 @@ Color? getSchemaColor(dynamic value) => value is String
|
|||
? value
|
||||
: null;
|
||||
|
||||
List<Color>? getColorsList(dynamic value) =>
|
||||
value is! List ? null : value.map(getSchemaColor).withoutNulls;
|
||||
List<Color>? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls;
|
||||
|
||||
List<T>? getDataList<T>(dynamic value) =>
|
||||
value is! List ? null : value.map((e) => castToType<T>(e)!).toList();
|
||||
List<T>? getDataList<T>(dynamic value) => value is! List ? null : value.map((e) => castToType<T>(e)!).toList();
|
||||
|
|
|
@ -6,12 +6,7 @@ class AtomImageSvgTheme extends StatelessWidget {
|
|||
final double width;
|
||||
final double height;
|
||||
|
||||
const AtomImageSvgTheme({
|
||||
super.key,
|
||||
required this.filename,
|
||||
required this.width,
|
||||
required this.height
|
||||
});
|
||||
const AtomImageSvgTheme({super.key, required this.filename, required this.width, required this.height});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -21,5 +16,4 @@ class AtomImageSvgTheme extends StatelessWidget {
|
|||
|
||||
return SvgPicture.asset(path, width: width, height: height);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
|
@ -66,8 +65,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
|
@ -90,27 +88,19 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
child!,
|
||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
headerTextStyle:
|
||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
selectedDateTimeBackgroundColor:
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
selectedDateTimeForegroundColor:
|
||||
FlutterFlowTheme.of(context).info,
|
||||
pickerDialForegroundColor:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
actionButtonForegroundColor:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
iconSize: 24.0,
|
||||
);
|
||||
},
|
||||
|
@ -167,8 +157,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: widget.controller,
|
||||
focusNode: widget.focusNode,
|
||||
|
@ -178,26 +167,20 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: widget.hintText,
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
lineHeight: 1.0,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -234,11 +217,9 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
lineHeight: 1.8,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
|
@ -246,8 +227,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_drop_down.dart';
|
||||
|
@ -50,8 +49,7 @@ class _CustomSelectState extends State<CustomSelect> {
|
|||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Container(
|
||||
width: 100.0,
|
||||
height: 48.0,
|
||||
|
@ -65,14 +63,11 @@ class _CustomSelectState extends State<CustomSelect> {
|
|||
isMultiSelect: false,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
hintText: widget.hintText,
|
||||
icon: Icon(
|
||||
|
@ -84,8 +79,7 @@ class _CustomSelectState extends State<CustomSelect> {
|
|||
borderColor: FlutterFlowTheme.of(context).customColor6,
|
||||
borderWidth: 0.5,
|
||||
borderRadius: 10.0,
|
||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
||||
12.0, 0.0, 16.0, 0.0),
|
||||
margin: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 16.0, 0.0),
|
||||
hidesUnderline: true,
|
||||
isOverButton: true,
|
||||
isSearchable: false,
|
||||
|
@ -98,31 +92,24 @@ class _CustomSelectState extends State<CustomSelect> {
|
|||
if (widget.isRequired)
|
||||
if (widget.dropDownValue == null || widget.dropDownValue == '')
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||
padding: const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodySmall
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodySmallFamily,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).customColor6,
|
||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodySmallFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||
)),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -36,8 +36,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
if (widget.uploadedFiles != null &&
|
||||
widget.uploadedFiles!.bytes!.isNotEmpty) {
|
||||
if (widget.uploadedFiles != null && widget.uploadedFiles!.bytes!.isNotEmpty) {
|
||||
{
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -47,8 +46,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
onTap: () async {
|
||||
setState(() {
|
||||
widget.isUploading = false;
|
||||
widget.uploadedFiles =
|
||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
widget.uploadedFiles = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
widget.onUploadComplete(widget.uploadedFiles!);
|
||||
});
|
||||
},
|
||||
|
@ -70,8 +68,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () async {
|
||||
final selectedMedia =
|
||||
await selectMediaWithSourceBottomSheet(
|
||||
final selectedMedia = await selectMediaWithSourceBottomSheet(
|
||||
context: context,
|
||||
imageQuality: 100,
|
||||
allowPhoto: true,
|
||||
|
@ -83,9 +80,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
|
||||
try {
|
||||
final message = FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'Uploading file...',
|
||||
ptText: 'Enviando arquivo...');
|
||||
.getVariableText(enText: 'Uploading file...', ptText: 'Enviando arquivo...');
|
||||
showUploadMessage(
|
||||
context,
|
||||
message,
|
||||
|
@ -104,22 +99,18 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
widget.isUploading = false;
|
||||
}
|
||||
if (selectedUploadedFiles.length ==
|
||||
selectedMedia.length) {
|
||||
if (selectedUploadedFiles.length == selectedMedia.length) {
|
||||
setState(() {
|
||||
widget.uploadedFiles = selectedUploadedFiles.first;
|
||||
});
|
||||
widget.onUploadComplete(widget.uploadedFiles!);
|
||||
final message = FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'Success!', ptText: 'Sucesso!');
|
||||
final message =
|
||||
FFLocalizations.of(context).getVariableText(enText: 'Success!', ptText: 'Sucesso!');
|
||||
showUploadMessage(context, message);
|
||||
} else {
|
||||
setState(() {});
|
||||
final message = FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
enText: 'Failed to upload data',
|
||||
ptText: 'Falha ao enviar dados');
|
||||
.getVariableText(enText: 'Failed to upload data', ptText: 'Falha ao enviar dados');
|
||||
showUploadMessage(context, message);
|
||||
return;
|
||||
}
|
||||
|
@ -134,21 +125,16 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 120.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 20.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
14.0, 0.0, 0.0, 20.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(14.0, 0.0, 0.0, 20.0),
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
|
@ -161,17 +147,15 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 65.0, 10.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 65.0, 10.0, 0.0),
|
||||
child: Text(
|
||||
widget.labelText,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -8,7 +8,8 @@ class SubmitButtonUtil extends StatelessWidget {
|
|||
final String labelText;
|
||||
Future Function()? onPressed;
|
||||
|
||||
SubmitButtonUtil({super.key,
|
||||
SubmitButtonUtil({
|
||||
super.key,
|
||||
required this.labelText,
|
||||
required this.onPressed,
|
||||
});
|
||||
|
@ -29,8 +30,7 @@ class SubmitButtonUtil extends StatelessWidget {
|
|||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
|
@ -41,8 +40,7 @@ class TabViewUtil extends StatelessWidget {
|
|||
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
|
||||
fontSize: 13.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).titleMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily),
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(),
|
||||
indicatorColor: FlutterFlowTheme.of(context).primary,
|
||||
|
|
|
@ -2,9 +2,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
|||
import 'text_field_component_widget.dart' show TextFieldComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class TextFieldComponentModel
|
||||
extends FlutterFlowModel<TextFieldComponentWidget> {
|
||||
class TextFieldComponentModel extends FlutterFlowModel<TextFieldComponentWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
// State field(s) for TextField widget.
|
||||
|
@ -20,4 +18,4 @@ class TextFieldComponentModel
|
|||
textFieldFocusNode?.dispose();
|
||||
textController?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ export 'text_field_component_model.dart';
|
|||
|
||||
////
|
||||
|
||||
|
||||
class TextFieldComponentWidget extends StatefulWidget {
|
||||
const TextFieldComponentWidget({
|
||||
super.key,
|
||||
|
@ -21,8 +20,7 @@ class TextFieldComponentWidget extends StatefulWidget {
|
|||
final String? hintTextStrParam;
|
||||
|
||||
@override
|
||||
State<TextFieldComponentWidget> createState() =>
|
||||
_TextFieldComponentWidgetState();
|
||||
State<TextFieldComponentWidget> createState() => _TextFieldComponentWidgetState();
|
||||
}
|
||||
|
||||
class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
||||
|
@ -39,8 +37,7 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
|||
super.initState();
|
||||
_model = createModel(context, () => TextFieldComponentModel());
|
||||
|
||||
_model.textController ??=
|
||||
TextEditingController(text: widget.initialValueStrParam);
|
||||
_model.textController ??= TextEditingController(text: widget.initialValueStrParam);
|
||||
_model.textFieldFocusNode ??= FocusNode();
|
||||
}
|
||||
|
||||
|
@ -66,16 +63,14 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: widget.hintTextStrParam,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -110,11 +105,10 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textControllerValidator.asValidator(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@ class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
|||
// State field(s) for CheckboxGroup widget.
|
||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||
set checkboxGroupValues(List<String>? v) =>
|
||||
checkboxGroupValueController?.value = v;
|
||||
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
|
|
@ -44,12 +44,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
_model.textFieldFocusNode ??= FocusNode();
|
||||
|
||||
selected = {
|
||||
'personType': widget.defaultPersonType == '.*'
|
||||
? ['E', 'O']
|
||||
: [widget.defaultPersonType],
|
||||
'accessType': widget.defaultAccessType == '.*'
|
||||
? ['0', '1']
|
||||
: [widget.defaultAccessType],
|
||||
'personType': widget.defaultPersonType == '.*' ? ['E', 'O'] : [widget.defaultPersonType],
|
||||
'accessType': widget.defaultAccessType == '.*' ? ['0', '1'] : [widget.defaultAccessType],
|
||||
'search': '.*',
|
||||
};
|
||||
}
|
||||
|
@ -58,9 +54,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
Map<String, String> filterResult = {
|
||||
'personType': '',
|
||||
'accessType': '',
|
||||
'search': _model.textController?.text == ''
|
||||
? '.*'
|
||||
: _model.textController!.text.toLowerCase(),
|
||||
'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(),
|
||||
};
|
||||
|
||||
if (selected['personType']!.isEmpty) {
|
||||
|
@ -83,8 +77,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
context.pop(filterResult);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxListTile(
|
||||
String key, List<Map<String, String>> options, double fontsize) {
|
||||
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
|
@ -100,8 +93,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: fontsize,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -121,8 +113,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: fontsize,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -149,8 +140,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
width: 5,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
),
|
||||
controlAffinity:
|
||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -193,23 +183,18 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 10.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getText('yfj9pd6k'), // Filtros
|
||||
style:
|
||||
FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 18.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily),
|
||||
),
|
||||
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 18.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -221,8 +206,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildCheckboxListTile(
|
||||
'personType', personTypeOptions, 14),
|
||||
_buildCheckboxListTile('personType', personTypeOptions, 14),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,8 +3,6 @@ import '/flutter_flow/form_field_controller.dart';
|
|||
import 'opt_modal_widget.dart' show OptModalWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
|
@ -19,8 +17,7 @@ class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
|||
// State field(s) for CheckboxGroup widget.
|
||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||
set checkboxGroupValues(List<String>? v) =>
|
||||
checkboxGroupValueController?.value = v;
|
||||
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
@ -30,4 +27,4 @@ class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
|||
textFieldFocusNode?.dispose();
|
||||
textController?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,12 +49,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
_model.textFieldFocusNode ??= FocusNode();
|
||||
|
||||
selected = {
|
||||
'personType': widget.defaultPersonType == '.*'
|
||||
? ['E', 'O']
|
||||
: [widget.defaultPersonType],
|
||||
'accessType': widget.defaultAccessType == '.*'
|
||||
? ['0', '1']
|
||||
: [widget.defaultAccessType],
|
||||
'personType': widget.defaultPersonType == '.*' ? ['E', 'O'] : [widget.defaultPersonType],
|
||||
'accessType': widget.defaultAccessType == '.*' ? ['0', '1'] : [widget.defaultAccessType],
|
||||
'search': '.*',
|
||||
};
|
||||
}
|
||||
|
@ -63,9 +59,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
Map<String, String> filterResult = {
|
||||
'personType': '',
|
||||
'accessType': '',
|
||||
'search': _model.textController?.text == ''
|
||||
? '.*'
|
||||
: _model.textController!.text.toLowerCase(),
|
||||
'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(),
|
||||
};
|
||||
|
||||
if (selected['personType']!.isEmpty) {
|
||||
|
@ -96,17 +90,14 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText('l7tw8b92'),
|
||||
textAlign: TextAlign
|
||||
.left, // Adiciona esta linha para alinhar o texto à esquerda
|
||||
textAlign: TextAlign.left, // Adiciona esta linha para alinhar o texto à esquerda
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -124,8 +115,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -152,8 +142,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
width: 10,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
),
|
||||
controlAffinity:
|
||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -198,30 +187,23 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 10.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getText('yfj9pd6k'), // Filtros
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.headlineMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily,
|
||||
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController,
|
||||
focusNode: _model.textFieldFocusNode,
|
||||
|
@ -232,27 +214,19 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'0enrtljz' /* Pesquise aqui..... */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -289,14 +263,12 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator:
|
||||
_model.textControllerValidator.asValidator(context),
|
||||
validator: _model.textControllerValidator.asValidator(context),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
|
@ -305,10 +277,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildCheckboxListTile(
|
||||
'personType', personTypeOptions),
|
||||
_buildCheckboxListTile(
|
||||
'accessType', accessTypeOptions),
|
||||
_buildCheckboxListTile('personType', personTypeOptions),
|
||||
_buildCheckboxListTile('accessType', accessTypeOptions),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -319,8 +289,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
foregroundColor: FlutterFlowTheme.of(context).info,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
child:
|
||||
Text(FFLocalizations.of(context).getText('88kshkph')),
|
||||
child: Text(FFLocalizations.of(context).getText('88kshkph')),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OptionSelectionModalModel
|
||||
extends FlutterFlowModel<OptionSelectionModalWidget> {
|
||||
class OptionSelectionModalModel extends FlutterFlowModel<OptionSelectionModalWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,12 +21,10 @@ class OptionSelectionModalWidget extends StatefulWidget {
|
|||
final List<String>? nameListStr;
|
||||
|
||||
@override
|
||||
State<OptionSelectionModalWidget> createState() =>
|
||||
_OptionSelectionModalWidgetState();
|
||||
State<OptionSelectionModalWidget> createState() => _OptionSelectionModalWidgetState();
|
||||
}
|
||||
|
||||
class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
||||
with TickerProviderStateMixin {
|
||||
class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget> with TickerProviderStateMixin {
|
||||
late OptionSelectionModalModel _model;
|
||||
|
||||
final animationsMap = <String, AnimationInfo>{};
|
||||
|
@ -92,17 +90,14 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
|||
return GestureDetector(
|
||||
onTap: () async {
|
||||
context.pop();
|
||||
if (widget.routesListStr![optionsListIndex] ==
|
||||
'scheduleCompleteVisitPage') {
|
||||
if (widget.routesListStr![optionsListIndex] == 'scheduleCompleteVisitPage') {
|
||||
// Navegação para a página ScheduleCompleteVisitPage com queryParameters
|
||||
context.go(
|
||||
'/scheduleCompleteVisitPage',
|
||||
extra: {
|
||||
'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss')
|
||||
.format(DateTime.now()),
|
||||
'visitEndDateStr': DateFormat('yyyy-MM-dd HH:mm:ss')
|
||||
.format(
|
||||
DateTime.now().add(const Duration(days: 1))),
|
||||
'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
|
||||
'visitEndDateStr':
|
||||
DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))),
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
@ -149,27 +144,20 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
|||
children: [
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(-1.0, 0.0),
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 0.0, 0.0),
|
||||
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,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
alignment: const AlignmentDirectional(
|
||||
0.0, 0.0),
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Icon(
|
||||
widget.iconsListIcon![
|
||||
optionsListIndex]!,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
widget.iconsListIcon![optionsListIndex]!,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 34.0,
|
||||
),
|
||||
),
|
||||
|
@ -186,21 +174,16 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(0.0, 0.0),
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Text(
|
||||
widget.nameListStr![optionsListIndex],
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleLarge
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||
fontFamily: 'Nunito',
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Nunito'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,10 +3,7 @@ import '/flutter_flow/form_field_controller.dart';
|
|||
import 'order_filter_modal_widget.dart' show OrderFilterModalWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
||||
|
||||
// State field(s) for TextField widget.
|
||||
FocusNode? textFieldFocusNode;
|
||||
TextEditingController? textController;
|
||||
|
@ -18,8 +15,7 @@ class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
|||
// State field(s) for CheckboxGroup widget.
|
||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||
set checkboxGroupValues(List<String>? v) =>
|
||||
checkboxGroupValueController?.value = v;
|
||||
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
@ -29,4 +25,4 @@ class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
|||
textFieldFocusNode?.dispose();
|
||||
textController?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,26 +28,22 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
late Map<String, dynamic> selected;
|
||||
final List<Map<String, String>> adresseeTypeOptions = [
|
||||
{
|
||||
'title': FFLocalizations.of(StorageUtil().context!)
|
||||
.getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||
'title': FFLocalizations.of(StorageUtil().context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||
'value': 'MOR'
|
||||
},
|
||||
{
|
||||
'title': FFLocalizations.of(StorageUtil().context!)
|
||||
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||
'title': FFLocalizations.of(StorageUtil().context!).getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||
'value': 'PRO'
|
||||
},
|
||||
];
|
||||
final List<Map<String, String>> statusOptions = [
|
||||
{
|
||||
'title': FFLocalizations.of(StorageUtil().context!)
|
||||
.getVariableText(
|
||||
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||
'value': 'notPickedUp'
|
||||
},
|
||||
{
|
||||
'title': FFLocalizations.of(StorageUtil().context!)
|
||||
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||
'title': FFLocalizations.of(StorageUtil().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||
'value': 'pickedUp'
|
||||
},
|
||||
];
|
||||
|
@ -65,12 +61,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
_model = createModel(context, () => OrderFilterModalModel());
|
||||
|
||||
selected = {
|
||||
'adresseeType': widget.defaultAdresseeType == '.*'
|
||||
? ['MOR', 'PRO']
|
||||
: [widget.defaultAdresseeType],
|
||||
'status': widget.defaultStatus == '.*'
|
||||
? ['notPickedUp', 'pickedUp']
|
||||
: [widget.defaultStatus],
|
||||
'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType],
|
||||
'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus],
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -100,8 +92,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
context.pop(filterResult);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxListTile(
|
||||
String key, List<Map<String, String>> options, double fontsize) {
|
||||
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
|
@ -117,8 +108,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: fontsize,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -138,8 +128,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: fontsize,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -167,8 +156,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
width: 5,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
),
|
||||
controlAffinity:
|
||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -197,23 +185,18 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 10.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getText('yfj9pd6k'), // Filtros
|
||||
style:
|
||||
FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 18.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.headlineMediumFamily),
|
||||
),
|
||||
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 18.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -225,8 +208,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildCheckboxListTile(
|
||||
'adresseeType', adresseeTypeOptions, 14),
|
||||
_buildCheckboxListTile('adresseeType', adresseeTypeOptions, 14),
|
||||
_buildCheckboxListTile('status', statusOptions, 14),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -2,12 +2,10 @@ import '/flutter_flow/flutter_flow_util.dart';
|
|||
import 'throw_exception_widget.dart' show ThrowExceptionWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class ThrowExceptionModel extends FlutterFlowModel<ThrowExceptionWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,7 @@ export 'throw_exception_model.dart';
|
|||
|
||||
// ignore: must_be_immutable
|
||||
class ThrowExceptionWidget extends StatefulWidget {
|
||||
ThrowExceptionWidget(
|
||||
{super.key, required this.msg, this.type = EnumThrowException.error});
|
||||
ThrowExceptionWidget({super.key, required this.msg, this.type = EnumThrowException.error});
|
||||
|
||||
final String? msg;
|
||||
EnumThrowException type;
|
||||
|
@ -23,8 +22,7 @@ class ThrowExceptionWidget extends StatefulWidget {
|
|||
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
|
||||
}
|
||||
|
||||
class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||
with TickerProviderStateMixin {
|
||||
class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget> with TickerProviderStateMixin {
|
||||
late ThrowExceptionModel _model;
|
||||
final animationsMap = <String, AnimationInfo>{};
|
||||
|
||||
|
@ -38,6 +36,7 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
return FlutterFlowTheme.of(context).success;
|
||||
}
|
||||
}
|
||||
|
||||
IconData _getIconByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
|
@ -48,26 +47,26 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
return Icons.check_circle_outline;
|
||||
}
|
||||
}
|
||||
|
||||
String _getTitleByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||
return FFLocalizations.of(context).getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||
case EnumThrowException.warning:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||
return FFLocalizations.of(context).getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||
case EnumThrowException.success:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||
return FFLocalizations.of(context).getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override void setState(VoidCallback callback) {
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
@override void initState() {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => ThrowExceptionModel());
|
||||
animationsMap.addAll({
|
||||
|
@ -85,76 +84,82 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
),
|
||||
});
|
||||
}
|
||||
@override void dispose() {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@override Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
key: const ValueKey('ThrowExceptionWidget'),
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
context.pop();
|
||||
},
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 20.0),
|
||||
Stack(
|
||||
children: <Widget>[
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Icon(
|
||||
_getIconByType(context),
|
||||
color: _getColorByType(context),
|
||||
size: 150.0,
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
key: const ValueKey('ThrowExceptionWidget'),
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
context.pop();
|
||||
},
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 20.0),
|
||||
Stack(
|
||||
children: <Widget>[
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Icon(
|
||||
_getIconByType(context),
|
||||
color: _getColorByType(context),
|
||||
size: 150.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
|
||||
const SizedBox(height: 20.0),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
_getTitleByType(context),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: 20.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0),
|
||||
child: Text(
|
||||
valueOrDefault<String>(widget.msg, 'Message Not Found'),
|
||||
],
|
||||
).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
|
||||
const SizedBox(height: 20.0),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
_getTitleByType(context),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: 20.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0),
|
||||
child: Text(
|
||||
valueOrDefault<String>(widget.msg, 'Message Not Found'),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VisitorNotFoundComponentModel
|
||||
extends FlutterFlowModel<VisitorNotFoundComponentWidget> {
|
||||
class VisitorNotFoundComponentModel extends FlutterFlowModel<VisitorNotFoundComponentWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,10 @@ class VisitorNotFoundComponentWidget extends StatefulWidget {
|
|||
|
||||
final String? doc;
|
||||
@override
|
||||
State<VisitorNotFoundComponentWidget> createState() =>
|
||||
_VisitorNotFoundComponentWidgetState();
|
||||
State<VisitorNotFoundComponentWidget> createState() => _VisitorNotFoundComponentWidgetState();
|
||||
}
|
||||
|
||||
class _VisitorNotFoundComponentWidgetState
|
||||
extends State<VisitorNotFoundComponentWidget> {
|
||||
class _VisitorNotFoundComponentWidgetState extends State<VisitorNotFoundComponentWidget> {
|
||||
late VisitorNotFoundComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -61,8 +59,7 @@ class _VisitorNotFoundComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
||||
child: FlutterFlowIconButton(
|
||||
borderRadius: 20.0,
|
||||
borderWidth: 1.0,
|
||||
|
@ -84,19 +81,16 @@ class _VisitorNotFoundComponentWidgetState
|
|||
size: 72.0,
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'1p9mykbj' /* Usuário não encontrado */,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).headlineSmallFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineSmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineSmallFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -113,8 +107,7 @@ class _VisitorNotFoundComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontStyle: FontStyle.italic,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -147,22 +140,18 @@ class _VisitorNotFoundComponentWidgetState
|
|||
).then((value) => context.pop(value));
|
||||
// Navigator.pop(context, value)
|
||||
},
|
||||
text: FFLocalizations.of(context)
|
||||
.getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
||||
text: FFLocalizations.of(context).getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
||||
options: FFButtonOptions(
|
||||
height: 30.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelSmallFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).labelSmallFamily,
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelSmallFamily),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BottomArrowLinkedLocalsComponentModel
|
||||
extends FlutterFlowModel<BottomArrowLinkedLocalsComponentWidget> {
|
||||
class BottomArrowLinkedLocalsComponentModel extends FlutterFlowModel<BottomArrowLinkedLocalsComponentWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,12 +15,10 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
|||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<BottomArrowLinkedLocalsComponentWidget> createState() =>
|
||||
_BottomArrowLinkedLocalsComponentWidgetState();
|
||||
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState();
|
||||
}
|
||||
|
||||
class _BottomArrowLinkedLocalsComponentWidgetState
|
||||
extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||
late BottomArrowLinkedLocalsComponentModel _model;
|
||||
|
||||
bool _loading = false;
|
||||
|
@ -29,17 +27,21 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
late Future<void> _localsFuture;
|
||||
List<dynamic> _localsWrap = [];
|
||||
|
||||
@override void setState(VoidCallback callback) {
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
@override void initState() {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model =
|
||||
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||
_localsFuture = _fetchLocals();
|
||||
}
|
||||
@override void dispose() {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
|
@ -49,8 +51,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Não há mais dados.", enText: "No more data."),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."),
|
||||
),
|
||||
duration: const Duration(seconds: 3),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -64,7 +65,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
var response = await PhpGroup.getLocalsCall.call();
|
||||
final bool isError = response.jsonBody['error'];
|
||||
|
||||
|
||||
if (isError) {
|
||||
final String errorMsg = response.jsonBody['error_msg'];
|
||||
_handleError(context, errorMsg);
|
||||
|
@ -73,7 +73,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
|
||||
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||
|
||||
|
||||
final bool isEmpty = locals.isEmpty;
|
||||
final bool isUnique = locals.length == 1;
|
||||
final bool isActive = locals[0]['CLU_STATUS'] == 'A';
|
||||
|
@ -82,9 +81,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
final bool isEnabled = isUnique && isActive;
|
||||
final bool isDisabled = isUnique && isBlocked;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!isEmpty) {
|
||||
setState(() {
|
||||
_localsWrap.addAll(locals);
|
||||
|
@ -127,7 +123,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
static void _handleError(BuildContext context, String errorMsg) {
|
||||
AuthenticationService.signOut(context);
|
||||
DialogUtil.error(context, errorMsg);
|
||||
LogUtil.requestAPIFailed('getLocals.php', '{devUUID: ${StorageUtil().devUUID}, cliUUID: ${StorageUtil().userUUID}}', 'Get Locals', errorMsg, StackTrace.current);
|
||||
LogUtil.requestAPIFailed('getLocals.php', '{devUUID: ${StorageUtil().devUUID}, cliUUID: ${StorageUtil().userUUID}}',
|
||||
'Get Locals', errorMsg, StackTrace.current);
|
||||
}
|
||||
|
||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||
|
@ -138,9 +135,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
if (response.jsonBody['error'] == false) {
|
||||
return {
|
||||
'error': false,
|
||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Vínculo Ativado com Sucesso",
|
||||
enText: "Link Activated Successfully")
|
||||
'error_msg': FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
||||
};
|
||||
} else {
|
||||
StorageUtil().cliUUID = '';
|
||||
|
@ -148,8 +144,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
}
|
||||
} catch (e, s) {
|
||||
DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed(
|
||||
'responderVinculo.php', '', 'Responder Vínculo', e, s);
|
||||
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s);
|
||||
return {
|
||||
'error': true,
|
||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||
|
@ -174,17 +169,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
Map<String, Color> _statusHashMap(dynamic local) {
|
||||
return Map<String, Color>.from({
|
||||
if (local['CLU_STATUS'] == 'A')
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active'): FlutterFlowTheme.of(context).success
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'):
|
||||
FlutterFlowTheme.of(context).success
|
||||
else if (local['CLU_STATUS'] == 'B')
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloqueado',
|
||||
enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'):
|
||||
FlutterFlowTheme.of(context).error
|
||||
else
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'):
|
||||
FlutterFlowTheme.of(context).warning
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -202,8 +194,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
context.pop();
|
||||
} else if (local['CLU_STATUS'] == 'B') {
|
||||
String message = FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
||||
ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
||||
enText: 'Location Blocked for Access, Contact Administration',
|
||||
);
|
||||
|
||||
|
@ -219,12 +210,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
String localName = local['CLI_NOME'];
|
||||
showAlertDialog(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Deseja aceitar o vínculo a $localName?',
|
||||
enText: 'Do you wish to accept the link to $localName?'),
|
||||
() async {
|
||||
enText: 'Do you wish to accept the link to $localName?'), () async {
|
||||
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||
context.pop();
|
||||
|
||||
|
@ -276,8 +265,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
height: height - (height * 0.5),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -289,16 +277,13 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum Local Encontrado.",
|
||||
enText: "No local found")),
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true &&
|
||||
_loading == false &&
|
||||
_localsWrap.isNotEmpty)
|
||||
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty)
|
||||
Expanded(child: _listItems(context)),
|
||||
if (_loading == true)
|
||||
Container(
|
||||
|
@ -315,8 +300,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
|||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Escolha um local', enText: 'Choose a location'),
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Escolha um local', enText: 'Choose a location'),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
)))),
|
||||
|
|
|
@ -6,8 +6,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
///
|
||||
|
||||
class LocalProfileComponentModel
|
||||
extends FlutterFlowModel<LocalProfileComponentWidget> {
|
||||
class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentWidget> {
|
||||
String cliName = '';
|
||||
String cliUUID = '';
|
||||
VoidCallback? setStateCallback;
|
||||
|
|
|
@ -16,12 +16,10 @@ class LocalProfileComponentWidget extends StatefulWidget {
|
|||
const LocalProfileComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<LocalProfileComponentWidget> createState() =>
|
||||
_LocalProfileComponentWidgetState();
|
||||
State<LocalProfileComponentWidget> createState() => _LocalProfileComponentWidgetState();
|
||||
}
|
||||
|
||||
class _LocalProfileComponentWidgetState
|
||||
extends State<LocalProfileComponentWidget> {
|
||||
class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidget> {
|
||||
late LocalProfileComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -40,7 +38,6 @@ class _LocalProfileComponentWidgetState
|
|||
// WidgetsBinding.instance
|
||||
// .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null));
|
||||
LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null);
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -57,8 +54,6 @@ class _LocalProfileComponentWidgetState
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
|
@ -90,7 +85,8 @@ class _LocalProfileComponentWidgetState
|
|||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
await LocalizationService.selectLocal(context).then((value) => value == true ? onUpdate() : null);
|
||||
await LocalizationService.selectLocal(context)
|
||||
.then((value) => value == true ? onUpdate() : null);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(200.0),
|
||||
|
@ -110,12 +106,9 @@ class _LocalProfileComponentWidgetState
|
|||
height: 80.0,
|
||||
fit: BoxFit.cover,
|
||||
alignment: const Alignment(0.0, 0.0),
|
||||
placeholder: (context, url) =>
|
||||
Image.asset('assets/images/home.png'),
|
||||
errorListener: (_) =>
|
||||
Image.asset('assets/images/home.png'),
|
||||
errorWidget: (_, __, ___) =>
|
||||
Image.asset('assets/images/home.png'),
|
||||
placeholder: (context, url) => Image.asset('assets/images/home.png'),
|
||||
errorListener: (_) => Image.asset('assets/images/home.png'),
|
||||
errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'),
|
||||
),
|
||||
)),
|
||||
),
|
||||
|
@ -134,8 +127,7 @@ class _LocalProfileComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Nunito'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -46,11 +46,23 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
MenuEntry? addMenuEntry(IconData icon, String enText, String ptText, Function() action) {
|
||||
entries.add(
|
||||
item == MenuItem.button
|
||||
? MenuButtonWidget(icon: icon, action: action, title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText), safeSetState: safeSetState)
|
||||
? MenuButtonWidget(
|
||||
icon: icon,
|
||||
action: action,
|
||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
||||
safeSetState: safeSetState)
|
||||
: item == MenuItem.card
|
||||
? MenuCardItem(icon: icon, action: action, title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText), safeSetState: safeSetState)
|
||||
? MenuCardItem(
|
||||
icon: icon,
|
||||
action: action,
|
||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
||||
safeSetState: safeSetState)
|
||||
: item == MenuItem.tile
|
||||
? MenuCardItem(icon: icon, action: action, title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText), safeSetState: safeSetState)
|
||||
? MenuCardItem(
|
||||
icon: icon,
|
||||
action: action,
|
||||
title: FFLocalizations.of(context).getVariableText(enText: enText, ptText: ptText),
|
||||
safeSetState: safeSetState)
|
||||
: null,
|
||||
);
|
||||
return null;
|
||||
|
@ -263,7 +275,12 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: OptionSelectionModalWidget(
|
||||
routesListStr: const <String>['liberationHistory', 'acessHistoryPage', 'scheduleCompleteVisitPage', 'messageHistoryPage'],
|
||||
routesListStr: const <String>[
|
||||
'liberationHistory',
|
||||
'acessHistoryPage',
|
||||
'scheduleCompleteVisitPage',
|
||||
'messageHistoryPage'
|
||||
],
|
||||
iconsListIcon: const <IconData>[
|
||||
Icons.history_rounded,
|
||||
Icons.history_rounded,
|
||||
|
|
|
@ -7,7 +7,13 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
|
||||
class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
||||
const MenuStaggeredViewComponentWidget({super.key, required this.changeMenuStyle, required this.expandable, required this.item, required this.options, required this.isGrid});
|
||||
const MenuStaggeredViewComponentWidget(
|
||||
{super.key,
|
||||
required this.changeMenuStyle,
|
||||
required this.expandable,
|
||||
required this.item,
|
||||
required this.options,
|
||||
required this.isGrid});
|
||||
|
||||
final bool expandable;
|
||||
final MenuItem item;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||
import 'package:hub/flutter_flow/request_manager.dart';
|
||||
|
||||
|
@ -6,10 +5,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
|||
import 'message_well_component_widget.dart' show MessageWellComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class MessageWellComponentModel
|
||||
extends FlutterFlowModel<MessageWellComponentWidget> {
|
||||
class MessageWellComponentModel extends FlutterFlowModel<MessageWellComponentWidget> {
|
||||
final unfocusNode = FocusNode();
|
||||
// State field(s) for TextField widget.
|
||||
FocusNode? textFieldFocusNode;
|
||||
|
@ -30,8 +26,7 @@ class MessageWellComponentModel
|
|||
requestFn: requestFn,
|
||||
);
|
||||
void clearGetLiberationsCache() => _getLiberationsManager.clear();
|
||||
void clearGetLiberationsCacheKey(String? uniqueKey) =>
|
||||
_getLiberationsManager.clearRequest(uniqueKey);
|
||||
void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey);
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
@ -46,4 +41,4 @@ class MessageWellComponentModel
|
|||
|
||||
clearGetLiberationsCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,12 +21,10 @@ class MessageWellComponentWidget extends StatefulWidget {
|
|||
const MessageWellComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<MessageWellComponentWidget> createState() =>
|
||||
_MessageWellComponentWidgetState();
|
||||
State<MessageWellComponentWidget> createState() => _MessageWellComponentWidgetState();
|
||||
}
|
||||
|
||||
class _MessageWellComponentWidgetState
|
||||
extends State<MessageWellComponentWidget> {
|
||||
class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget> {
|
||||
StreamSubscription? _dropdownSubscription;
|
||||
|
||||
@override
|
||||
|
@ -143,8 +141,7 @@ class _MessageWellComponentWidgetState
|
|||
fillColor: theme.primary,
|
||||
),
|
||||
onChanged: (String? newValue) {
|
||||
safeSetState(() => dropdown.value = LinkedHashMap.from(
|
||||
{newValue!: dropdownItems[newValue].toString()}));
|
||||
safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()}));
|
||||
},
|
||||
items: dropdownItems.entries
|
||||
.map((entry) => DropdownMenuItem<String>(
|
||||
|
@ -181,8 +178,7 @@ class _MessageWellComponentWidgetState
|
|||
final formattedWords = words.map((word) {
|
||||
if (word.isEmpty) return word; // Handle empty words
|
||||
final firstLetter = word.substring(0, 1).toUpperCase();
|
||||
final remainingLetters =
|
||||
word.length > 1 ? word.substring(1).toLowerCase() : '';
|
||||
final remainingLetters = word.length > 1 ? word.substring(1).toLowerCase() : '';
|
||||
return '$firstLetter$remainingLetters';
|
||||
});
|
||||
return formattedWords.join(' ');
|
||||
|
@ -238,8 +234,7 @@ class _MessageWellComponentWidgetState
|
|||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Icon(
|
||||
Icons.history,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).customColor6,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
size: 15,
|
||||
),
|
||||
),
|
||||
|
@ -249,8 +244,7 @@ class _MessageWellComponentWidgetState
|
|||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).customColor6,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
@ -265,8 +259,7 @@ class _MessageWellComponentWidgetState
|
|||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Icon(
|
||||
Icons.message,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).customColor6,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
size: 15,
|
||||
),
|
||||
),
|
||||
|
@ -327,8 +320,7 @@ class MessageWellState {
|
|||
return MessageWellState(
|
||||
messages: messages ?? this.messages,
|
||||
pageNumber: pageNumber ?? this.pageNumber,
|
||||
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ??
|
||||
this.allowScrollInSingleChildScrollView,
|
||||
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? this.allowScrollInSingleChildScrollView,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -382,7 +374,6 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
|||
}
|
||||
}
|
||||
|
||||
final messageWellProvider =
|
||||
StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||
final messageWellProvider = StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||
return MessageWellNotifier();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||
|
@ -8,8 +7,7 @@ import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
|||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ScheduleVisitDetailModel
|
||||
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
||||
class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
|
@ -39,8 +37,7 @@ class ScheduleVisitDetailModel
|
|||
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||
DateFormat newFormat = DateFormat('y-M-d H:mm:ss');
|
||||
|
||||
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$')
|
||||
.hasMatch(dateStr)) {
|
||||
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$').hasMatch(dateStr)) {
|
||||
return 'Invalid date format';
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ class ScheduleVisitDetailWidget extends StatefulWidget {
|
|||
final String? visitObsStr;
|
||||
|
||||
@override
|
||||
State<ScheduleVisitDetailWidget> createState() =>
|
||||
_ScheduleVisitDetailWidgetState();
|
||||
State<ScheduleVisitDetailWidget> createState() => _ScheduleVisitDetailWidgetState();
|
||||
}
|
||||
|
||||
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||
|
@ -58,19 +57,16 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
||||
_model.textController2 ??=
|
||||
TextEditingController(text: widget.visitStartDate);
|
||||
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||
_model.textFieldFocusNode2 ??= FocusNode();
|
||||
|
||||
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||
_model.textFieldFocusNode3 ??= FocusNode();
|
||||
|
||||
_model.textController4 ??=
|
||||
TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
||||
_model.textController4 ??= TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
||||
_model.textFieldFocusNode4 ??= FocusNode();
|
||||
|
||||
_model.textController5 ??=
|
||||
TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
||||
_model.textController5 ??= TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
||||
_model.textFieldFocusNode5 ??= FocusNode();
|
||||
|
||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||
|
@ -132,13 +128,11 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
),
|
||||
),
|
||||
child: Visibility(
|
||||
visible: widget.visitorStrList != null &&
|
||||
widget.visitorStrList != '',
|
||||
visible: widget.visitorStrList != null && widget.visitorStrList != '',
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
15.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
||||
child: FlutterFlowIconButton(
|
||||
borderRadius: 20.0,
|
||||
borderWidth: 1.0,
|
||||
|
@ -161,8 +155,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
5.0, 0.0, 5.0, 20.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 20.0),
|
||||
child: SizedBox(
|
||||
width: 100.0,
|
||||
child: ClipRRect(
|
||||
|
@ -190,8 +183,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
focusNode: _model.textFieldFocusNode1,
|
||||
|
@ -203,31 +195,19 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'7w4fohoa' /* Encerramento da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -258,32 +238,25 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController1Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController2,
|
||||
focusNode: _model.textFieldFocusNode2,
|
||||
|
@ -292,98 +265,71 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText: FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
labelText: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Start',
|
||||
ptText: 'Início',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText:
|
||||
FFLocalizations.of(context).getText(
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'0cp1e31d' /* dd/mm/yyyy */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 12,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController2Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -392,90 +338,64 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(context).getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'abppdgz3' /* Término */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText:
|
||||
FFLocalizations.of(context).getText(
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'kqralft4' /* dd/mm/yyyy */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 12,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController3Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -483,16 +403,14 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController4,
|
||||
focusNode: _model.textFieldFocusNode4,
|
||||
|
@ -501,96 +419,69 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(context).getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'xjxhzqqm' /* Motivo da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText:
|
||||
FFLocalizations.of(context).getText(
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'47oezdm6' /* Motivo */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController4Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController5,
|
||||
focusNode: _model.textFieldFocusNode5,
|
||||
|
@ -599,89 +490,63 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(context).getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'2ujg7u18' /* Nível de Acesso */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText:
|
||||
FFLocalizations.of(context).getText(
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'3emmbbfv' /* Nível de Acesso */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController5Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController5Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -691,8 +556,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController6,
|
||||
focusNode: _model.textFieldFocusNode6,
|
||||
|
@ -704,31 +568,19 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'ritce5uw' /* Observações da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -759,18 +611,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController6Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController6Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -780,12 +627,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
_model.postScheduleVisit =
|
||||
await PhpGroup.postScheduleVisitCall.call(
|
||||
_model.postScheduleVisit = await PhpGroup.postScheduleVisitCall.call(
|
||||
devDesc: widget.visitObsStr,
|
||||
idVisitante: widget.visitorStrList,
|
||||
dtInicio:
|
||||
_model.convertDateFormat(widget.visitStartDate ?? ''),
|
||||
dtInicio: _model.convertDateFormat(widget.visitStartDate ?? ''),
|
||||
dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''),
|
||||
unica: widget.visitTempStr,
|
||||
idMotivo: extractIdToStr(widget.visitResonStr!),
|
||||
|
@ -799,12 +644,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
false) {
|
||||
context.pop();
|
||||
} else {
|
||||
final String? msg = PhpGroup.postScheduleVisitCall.errorMsg(
|
||||
final String? msg = PhpGroup.postScheduleVisitCall.errorMsg(
|
||||
(_model.postScheduleVisit?.jsonBody ?? ''),
|
||||
);
|
||||
await DialogUtil.error(context, msg!).then((value) => safeSetState(() {}));
|
||||
|
||||
|
||||
}
|
||||
|
||||
setState(() {});
|
||||
|
|
|
@ -3,8 +3,7 @@ import 'package:hub/components/organism_components/up_arrow_linked_locals_compon
|
|||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
|
||||
class UpArrowLinkedLocalsComponentModel
|
||||
extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
|
|
|
@ -12,12 +12,10 @@ class UpArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
|||
const UpArrowLinkedLocalsComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<UpArrowLinkedLocalsComponentWidget> createState() =>
|
||||
_UpArrowLinkedLocalsComponentWidgetState();
|
||||
State<UpArrowLinkedLocalsComponentWidget> createState() => _UpArrowLinkedLocalsComponentWidgetState();
|
||||
}
|
||||
|
||||
class _UpArrowLinkedLocalsComponentWidgetState
|
||||
extends State<UpArrowLinkedLocalsComponentWidget> {
|
||||
class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocalsComponentWidget> {
|
||||
late UpArrowLinkedLocalsComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -107,8 +105,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
|||
|
||||
return GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 1,
|
||||
crossAxisSpacing: 10.0,
|
||||
mainAxisSpacing: 0.0,
|
||||
|
@ -117,8 +114,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
|||
scrollDirection: Axis.horizontal,
|
||||
itemCount: eachLocals.length,
|
||||
itemBuilder: (context, eachLocalsIndex) {
|
||||
final eachLocalsItem =
|
||||
eachLocals[eachLocalsIndex];
|
||||
final eachLocalsItem = eachLocals[eachLocalsIndex];
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -141,40 +137,31 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
|||
width: 50.0,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(),
|
||||
alignment:
|
||||
const AlignmentDirectional(0.0, 0.0),
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
borderRadius:
|
||||
const BorderRadius.only(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(25.0),
|
||||
bottomRight:
|
||||
Radius.circular(25.0),
|
||||
bottomRight: Radius.circular(25.0),
|
||||
topLeft: Radius.circular(25.0),
|
||||
topRight: Radius.circular(25.0),
|
||||
),
|
||||
border: Border.all(
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.secondaryText,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
const BorderRadius.only(
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(25.0),
|
||||
bottomRight:
|
||||
Radius.circular(25.0),
|
||||
bottomRight: Radius.circular(25.0),
|
||||
topLeft: Radius.circular(25.0),
|
||||
topRight: Radius.circular(25.0),
|
||||
),
|
||||
|
@ -187,36 +174,23 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
|||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.fill,
|
||||
alignment:
|
||||
const Alignment(0.0, 0.0),
|
||||
alignment: const Alignment(0.0, 0.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
getJsonField(
|
||||
eachLocalsItem,
|
||||
r'''$.CLI_NOME''',
|
||||
).toString(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -4,8 +4,7 @@ import 'package:hub/shared/utils/storage_util.dart';
|
|||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'access_notification_modal_template_component_widget.dart'
|
||||
show AccessNotificationModalTemplateComponentWidget;
|
||||
import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget;
|
||||
|
||||
class AccessNotificationModalTemplateComponentModel
|
||||
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||
|
|
|
@ -41,8 +41,7 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_model = createModel(
|
||||
context, () => AccessNotificationModalTemplateComponentModel());
|
||||
_model = createModel(context, () => AccessNotificationModalTemplateComponentModel());
|
||||
|
||||
_model.textController1 ??= TextEditingController(text: widget.name);
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
@ -66,11 +65,9 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String labelTypeResident = FFLocalizations.of(context)
|
||||
.getVariableText(enText: 'Resident', ptText: 'Morador');
|
||||
String labelTypeResident = FFLocalizations.of(context).getVariableText(enText: 'Resident', ptText: 'Morador');
|
||||
|
||||
String labelTypeVisitor = FFLocalizations.of(context)
|
||||
.getVariableText(enText: 'Visitor', ptText: 'Visitante');
|
||||
String labelTypeVisitor = FFLocalizations.of(context).getVariableText(enText: 'Visitor', ptText: 'Visitante');
|
||||
|
||||
return Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
|
@ -113,13 +110,10 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 10.0))
|
||||
.addToEnd(const SizedBox(width: 10.0)),
|
||||
].addToStart(const SizedBox(width: 10.0)).addToEnd(const SizedBox(width: 10.0)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
focusNode: _model.textFieldFocusNode1,
|
||||
|
@ -132,25 +126,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'dvag09pq' /* Nome */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -162,18 +150,16 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController1Validator.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
|
@ -181,10 +167,8 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
children: [
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: TextEditingController(
|
||||
text: widget.type == 'O'
|
||||
? labelTypeResident
|
||||
: labelTypeVisitor),
|
||||
controller:
|
||||
TextEditingController(text: widget.type == 'O' ? labelTypeResident : labelTypeVisitor),
|
||||
focusNode: _model.textFieldFocusNode2,
|
||||
autofocus: false,
|
||||
textInputAction: TextInputAction.next,
|
||||
|
@ -195,27 +179,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'h3s0r1he' /* Tipo */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -227,28 +203,22 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator: _model.textController2Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 24.0))
|
||||
.addToEnd(const SizedBox(width: 24.0)),
|
||||
].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -261,25 +231,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'jveeqpdz' /* Acesso */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -291,23 +255,20 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController3Validator.asValidator(context),
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController4,
|
||||
focusNode: _model.textFieldFocusNode4,
|
||||
|
@ -322,24 +283,18 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
enText: 'Access Sector',
|
||||
ptText: 'Setor de Acesso',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -351,16 +306,14 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
validator:
|
||||
_model.textController4Validator.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'card_item_template_component_widget.dart'
|
||||
show CardItemTemplateComponentWidget;
|
||||
import 'card_item_template_component_widget.dart' show CardItemTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class CardItemTemplateComponentModel
|
||||
extends FlutterFlowModel<CardItemTemplateComponentWidget> {
|
||||
class CardItemTemplateComponentModel extends FlutterFlowModel<CardItemTemplateComponentWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,10 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
|
|||
final Future Function()? onTapCardItemAction;
|
||||
|
||||
@override
|
||||
State<CardItemTemplateComponentWidget> createState() =>
|
||||
_CardItemTemplateComponentWidgetState();
|
||||
State<CardItemTemplateComponentWidget> createState() => _CardItemTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _CardItemTemplateComponentWidgetState
|
||||
extends State<CardItemTemplateComponentWidget> {
|
||||
class _CardItemTemplateComponentWidgetState extends State<CardItemTemplateComponentWidget> {
|
||||
late CardItemTemplateComponentModel _model;
|
||||
late LinkedHashMap<String, String> labelsLinkedHashMap;
|
||||
late List<LinkedHashMap<String, Color>> statusLinkedHashMap;
|
||||
|
@ -40,9 +38,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
super.initState();
|
||||
_model = createModel(context, () => CardItemTemplateComponentModel());
|
||||
labelsLinkedHashMap = LinkedHashMap.from(widget.labelsHashMap ?? {});
|
||||
statusLinkedHashMap = widget.statusHashMap
|
||||
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
|
||||
.toList();
|
||||
statusLinkedHashMap = widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -70,8 +66,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
|
@ -85,8 +80,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
fontSize: 12.5,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -174,9 +168,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
_generateImage(),
|
||||
]
|
||||
.addToEnd(const SizedBox(width: 10))
|
||||
.addToStart(const SizedBox(width: 10)),
|
||||
].addToEnd(const SizedBox(width: 10)).addToStart(const SizedBox(width: 10)),
|
||||
);
|
||||
} else {
|
||||
return Column(
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'change_pass_widget.dart'
|
||||
show PassKeyTemplateWidget;
|
||||
import 'change_pass_widget.dart' show PassKeyTemplateWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class PassKeyTemplateComponentModel
|
||||
extends FlutterFlowModel<PassKeyTemplateWidget> {
|
||||
class PassKeyTemplateComponentModel extends FlutterFlowModel<PassKeyTemplateWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
@ -18,19 +15,18 @@ class PassKeyTemplateComponentModel
|
|||
late bool keyTextFieldVisibility2;
|
||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator1;
|
||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2;
|
||||
String? _keyTextFieldTextControllerValidator(
|
||||
BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty ) {
|
||||
String? _keyTextFieldTextControllerValidator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
if ( val.length < 4 ) {
|
||||
if (val.length < 4) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field must have at least 4 characters',
|
||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||
);
|
||||
enText: 'This field must have at least 4 characters',
|
||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -50,4 +46,4 @@ class PassKeyTemplateComponentModel
|
|||
keyTextFieldTextController1?.dispose();
|
||||
keyTextFieldTextController2?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
tablet: false,
|
||||
))
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -95,8 +94,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 12.0, 0.0, 12.0),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
child: Icon(
|
||||
Icons.arrow_back_rounded,
|
||||
color: Color(0xFF15161E),
|
||||
|
@ -104,20 +102,17 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
12.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'',
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -125,14 +120,11 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'INSERT PASSWORD',
|
||||
ptText: StorageUtil().accessPass != ''
|
||||
? 'ALTERAR SENHA'
|
||||
: 'ADICIONAR SENHA',
|
||||
ptText: StorageUtil().accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA',
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
fontFamily: 'Outfit',
|
||||
|
@ -145,20 +137,17 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Enter your password to continue',
|
||||
ptText: 'Digite sua senha para continuar'),
|
||||
enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -168,8 +157,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
16.0, 12.0, 16.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
|
@ -188,36 +176,29 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
obscureText: !_model.keyTextFieldVisibility1,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
labelText: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Senha',
|
||||
enText: 'Password',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Digite a sua senha.....',
|
||||
enText: 'Enter your password.....',
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -248,14 +229,11 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 24.0, 20.0, 24.0),
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => setState(
|
||||
() => _model.keyTextFieldVisibility1 =
|
||||
!_model.keyTextFieldVisibility1,
|
||||
() => _model.keyTextFieldVisibility1 = !_model.keyTextFieldVisibility1,
|
||||
),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
|
@ -273,20 +251,14 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
maxLength: 4,
|
||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||
buildCounter: (context,
|
||||
{required currentLength,
|
||||
required isFocused,
|
||||
maxLength}) =>
|
||||
null,
|
||||
buildCounter: (context, {required currentLength, required isFocused, maxLength}) => null,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
validator: _model.keyTextFieldTextControllerValidator1
|
||||
.asValidator(context),
|
||||
validator: _model.keyTextFieldTextControllerValidator1.asValidator(context),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(4),
|
||||
|
@ -300,12 +272,10 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () async {
|
||||
if (_model.formKey.currentState == null ||
|
||||
!_model.formKey.currentState!.validate()) {
|
||||
if (_model.formKey.currentState == null || !_model.formKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
await widget.toggleActionStatus?.call(
|
||||
|
@ -317,20 +287,14 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
context.pop(true);
|
||||
},
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
ptText: StorageUtil().accessPass != ''
|
||||
? 'Alterar'
|
||||
: 'Adicionar',
|
||||
enText: StorageUtil().accessPass != ''
|
||||
? 'Change'
|
||||
: 'Add',
|
||||
ptText: StorageUtil().accessPass != '' ? 'Alterar' : 'Adicionar',
|
||||
enText: StorageUtil().accessPass != '' ? 'Change' : 'Add',
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: 270.0,
|
||||
height: 50.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: const Color(0xFF1AAB5F),
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
|
@ -338,8 +302,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:hub/components/templates_components/details_component/details_co
|
|||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
|
||||
|
||||
class DetailsComponentWidget extends StatefulWidget {
|
||||
const DetailsComponentWidget({
|
||||
Key? key,
|
||||
|
@ -31,13 +30,10 @@ class DetailsComponentWidget extends StatefulWidget {
|
|||
class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||
late DetailsComponentModel _model;
|
||||
|
||||
LinkedHashMap<String, String> get labelsLinkedHashMap =>
|
||||
LinkedHashMap.from(widget.labelsHashMap);
|
||||
LinkedHashMap<String, String> get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap);
|
||||
|
||||
List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
|
||||
widget.statusHashMap
|
||||
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
|
||||
.toList();
|
||||
widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList();
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
|
@ -96,8 +92,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
SizedBox(height: MediaQuery.of(context).size.height * 0.03),
|
||||
Row(
|
||||
children: statusLinkedHashMap.expand((linkedHashMap) {
|
||||
return linkedHashMap.entries
|
||||
.map((MapEntry<String, Color> item) {
|
||||
return linkedHashMap.entries.map((MapEntry<String, Color> item) {
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
|
@ -121,29 +116,21 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
filled: true,
|
||||
fillColor: item.value,
|
||||
labelText: item.key,
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
),
|
||||
),
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -155,8 +142,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
|
@ -166,8 +152,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator: _model.textController1Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -187,8 +172,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
readOnly: true,
|
||||
initialValue: '$value',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
|
@ -202,26 +186,19 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground, // Change border color here
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||
),
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
|
@ -231,29 +208,25 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground, // Change border color here
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground, // Change border color here
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground, // Change border color here
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground, // Change border color here
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -261,8 +234,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
},
|
||||
),
|
||||
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
||||
if (widget.buttons
|
||||
.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
||||
if (widget.buttons.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
||||
OverflowBar(
|
||||
overflowAlignment: OverflowBarAlignment.center,
|
||||
overflowSpacing: 2,
|
||||
|
|
|
@ -2,12 +2,10 @@ import 'package:hub/shared/utils/validator_util.dart';
|
|||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'forgot_password_template_component_widget.dart'
|
||||
show ForgotPasswordTemplateComponentWidget;
|
||||
import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ForgotPasswordTemplateComponentModel
|
||||
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||
class ForgotPasswordTemplateComponentModel extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
@ -15,8 +13,7 @@ class ForgotPasswordTemplateComponentModel
|
|||
FocusNode? emailAddressFocusNode;
|
||||
TextEditingController? emailAddressTextController;
|
||||
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
||||
String? _emailAddressTextControllerValidator(
|
||||
BuildContext context, String? val) {
|
||||
String? _emailAddressTextControllerValidator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getText(
|
||||
'snnmkbyc' /* E-mail é Obrigatório */,
|
||||
|
@ -44,4 +41,4 @@ class ForgotPasswordTemplateComponentModel
|
|||
emailAddressFocusNode?.dispose();
|
||||
emailAddressTextController?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -19,12 +18,10 @@ class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
|||
const ForgotPasswordTemplateComponentWidget({super.key});
|
||||
|
||||
@override
|
||||
State<ForgotPasswordTemplateComponentWidget> createState() =>
|
||||
_ForgotPasswordTemplateComponentWidgetState();
|
||||
State<ForgotPasswordTemplateComponentWidget> createState() => _ForgotPasswordTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _ForgotPasswordTemplateComponentWidgetState
|
||||
extends State<ForgotPasswordTemplateComponentWidget> {
|
||||
class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTemplateComponentWidget> {
|
||||
late ForgotPasswordTemplateComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -79,8 +76,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
tablet: false,
|
||||
))
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
child: InkWell(
|
||||
key: const ValueKey<String>('BackButton'),
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -94,8 +90,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 12.0, 0.0, 12.0),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
child: Icon(
|
||||
Icons.arrow_back_rounded,
|
||||
color: Color(0xFF15161E),
|
||||
|
@ -107,13 +102,13 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
child: Text(
|
||||
'',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -121,8 +116,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */),
|
||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||
|
@ -136,8 +130,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText('wu2f7yzo' /* Não se preucupe nós vamos te a... */),
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
|
@ -146,8 +139,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -155,8 +147,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
key: _model.formKey,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
|
@ -175,14 +166,13 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
isDense: true,
|
||||
labelText: FFLocalizations.of(context).getText('mtz8l7ft' /* E-mail */),
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.black,
|
||||
|
@ -211,8 +201,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 24.0, 20.0, 24.0),
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
||||
suffixIcon: Icon(
|
||||
Icons.email,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -225,14 +214,12 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
validator: _model.emailAddressTextControllerValidator
|
||||
.asValidator(context),
|
||||
validator: _model.emailAddressTextControllerValidator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -240,27 +227,22 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('SendButtonWidget'),
|
||||
onPressed: (_model.emailAddressTextController.text == '' ||
|
||||
!ValidatorUtil.isValidEmail(
|
||||
_model.emailAddressTextController.text))
|
||||
!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||
? null
|
||||
: () async => AuthenticationService.forgotPassword(context, _model.emailAddressTextController.text),
|
||||
|
||||
|
||||
: () async =>
|
||||
AuthenticationService.forgotPassword(context, _model.emailAddressTextController.text),
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'74rnd5bu' /* Enviar */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: 270.0,
|
||||
height: 50.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
|
@ -268,8 +250,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
|
|
|
@ -4,8 +4,7 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
|
||||
class LiberationHistoryItemDetailsTemplateComponentModel
|
||||
extends FlutterFlowModel<
|
||||
LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
|
|
|
@ -5,8 +5,7 @@ import 'package:hub/components/templates_components/liberation_history_item_deta
|
|||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
|
||||
class LiberationHistoryItemDetailsTemplateComponentWidget
|
||||
extends StatefulWidget {
|
||||
class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget {
|
||||
const LiberationHistoryItemDetailsTemplateComponentWidget({
|
||||
super.key,
|
||||
required this.name,
|
||||
|
@ -40,8 +39,7 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(
|
||||
context, () => LiberationHistoryItemDetailsTemplateComponentModel());
|
||||
_model = createModel(context, () => LiberationHistoryItemDetailsTemplateComponentModel());
|
||||
|
||||
_model.textController1 ??= TextEditingController(text: widget.name);
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
@ -106,13 +104,10 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 10.0))
|
||||
.addToEnd(const SizedBox(width: 10.0)),
|
||||
].addToStart(const SizedBox(width: 10.0)).addToEnd(const SizedBox(width: 10.0)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
focusNode: _model.textFieldFocusNode1,
|
||||
|
@ -125,25 +120,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'dmazrriq' /* Nome */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -155,18 +144,16 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController1Validator.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
|
@ -185,27 +172,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'xx3ivbr4' /* Tipo */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -217,28 +196,22 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator: _model.textController2Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 24.0))
|
||||
.addToEnd(const SizedBox(width: 24.0)),
|
||||
].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -251,25 +224,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'rhheok7k' /* Acesso */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -281,23 +248,20 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController3Validator.asValidator(context),
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController4,
|
||||
focusNode: _model.textFieldFocusNode4,
|
||||
|
@ -311,24 +275,18 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'w3tciqlv' /* Acionamento */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -340,16 +298,14 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
validator:
|
||||
_model.textController4Validator.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -36,8 +36,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(
|
||||
context, () => MessageNotificationModalTemplateComponentModel());
|
||||
_model = createModel(context, () => MessageNotificationModalTemplateComponentModel());
|
||||
|
||||
_model.textController1 ??= TextEditingController(text: widget.message);
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
@ -76,8 +75,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
focusNode: _model.textFieldFocusNode1,
|
||||
|
@ -92,20 +90,16 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
enText: 'Message',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -120,8 +114,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
|
@ -146,25 +139,19 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
ptText: 'De',
|
||||
enText: 'From',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -176,27 +163,22 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController2Validator.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 24.0))
|
||||
.addToEnd(const SizedBox(width: 24.0)),
|
||||
].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -211,20 +193,16 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
enText: 'To',
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
|
@ -239,8 +217,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
|
|
|
@ -4,8 +4,7 @@ import 'package:hub/components/templates_components/provisional_schedule_templat
|
|||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
|
||||
class ScheduleProvisionalVisitPageModel
|
||||
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||
String cliUUID = '';
|
||||
String devUUID = '';
|
||||
String userUUID = '';
|
||||
|
@ -19,25 +18,21 @@ class ScheduleProvisionalVisitPageModel
|
|||
void addToVisitors(dynamic item) => visitors.add(item);
|
||||
void removeFromVisitors(dynamic item) => visitors.remove(item);
|
||||
void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
|
||||
void insertAtIndexInVisitors(int index, dynamic item) =>
|
||||
visitors.insert(index, item);
|
||||
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) =>
|
||||
visitors[index] = updateFn(visitors[index]);
|
||||
void insertAtIndexInVisitors(int index, dynamic item) => visitors.insert(index, item);
|
||||
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => visitors[index] = updateFn(visitors[index]);
|
||||
|
||||
List<String> docs = [];
|
||||
void addToDocs(String item) => docs.add(item);
|
||||
void removeFromDocs(String item) => docs.remove(item);
|
||||
void removeAtIndexFromDocs(int index) => docs.removeAt(index);
|
||||
void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
|
||||
void updateDocsAtIndex(int index, Function(String) updateFn) =>
|
||||
docs[index] = updateFn(docs[index]);
|
||||
void updateDocsAtIndex(int index, Function(String) updateFn) => docs[index] = updateFn(docs[index]);
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
FocusNode? personNameFocusNode;
|
||||
TextEditingController? personNameTextController;
|
||||
String? Function(BuildContext, String?)? personNameTextControllerValidator;
|
||||
String? _personNameTextControllerValidator(
|
||||
BuildContext context, String? val) {
|
||||
String? _personNameTextControllerValidator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getText(
|
||||
'3hqg8buh',
|
||||
|
@ -110,8 +105,7 @@ class ScheduleProvisionalVisitPageModel
|
|||
}
|
||||
|
||||
bool isFormValid() {
|
||||
if (personNameTextController.text == '' ||
|
||||
personNameTextController.text.length > 80) {
|
||||
if (personNameTextController.text == '' || personNameTextController.text.length > 80) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -121,12 +115,10 @@ class ScheduleProvisionalVisitPageModel
|
|||
|
||||
DateTime selectedDateTime;
|
||||
DateTime currentDateTime = DateTime.now();
|
||||
selectedDateTime =
|
||||
DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||
|
||||
try {
|
||||
selectedDateTime =
|
||||
DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,8 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'qr_code_pass_key_template_component_widget.dart'
|
||||
show QrCodePassKeyTemplateComponentWidget;
|
||||
import 'qr_code_pass_key_template_component_widget.dart' show QrCodePassKeyTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class QrCodePassKeyTemplateComponentModel
|
||||
extends FlutterFlowModel<QrCodePassKeyTemplateComponentWidget> {
|
||||
class QrCodePassKeyTemplateComponentModel extends FlutterFlowModel<QrCodePassKeyTemplateComponentWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
@ -13,19 +11,18 @@ class QrCodePassKeyTemplateComponentModel
|
|||
TextEditingController? keyTextFieldTextController;
|
||||
late bool keyTextFieldVisibility;
|
||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator;
|
||||
String? _keyTextFieldTextControllerValidator(
|
||||
BuildContext context, String? val) {
|
||||
String? _keyTextFieldTextControllerValidator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
if (val.length < 4) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field must be at least 4 characters',
|
||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||
);
|
||||
enText: 'This field must be at least 4 characters',
|
||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -19,12 +19,10 @@ class QrCodePassKeyTemplateComponentWidget extends StatefulWidget {
|
|||
final Future Function(String key)? toggleActionStatus;
|
||||
|
||||
@override
|
||||
State<QrCodePassKeyTemplateComponentWidget> createState() =>
|
||||
_QrCodePassKeyTemplateComponentWidgetState();
|
||||
State<QrCodePassKeyTemplateComponentWidget> createState() => _QrCodePassKeyTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _QrCodePassKeyTemplateComponentWidgetState
|
||||
extends State<QrCodePassKeyTemplateComponentWidget> {
|
||||
class _QrCodePassKeyTemplateComponentWidgetState extends State<QrCodePassKeyTemplateComponentWidget> {
|
||||
late QrCodePassKeyTemplateComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -81,8 +79,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
tablet: false,
|
||||
))
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -95,8 +92,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 12.0, 0.0, 12.0),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
child: Icon(
|
||||
Icons.arrow_back_rounded,
|
||||
color: Color(0xFF15161E),
|
||||
|
@ -104,20 +100,17 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
12.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'',
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -125,8 +118,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'h1xilful' /* DIGITE A SUA SENHA */,
|
||||
|
@ -142,8 +134,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'ujodm2ci' /* Para gerar o QR Code digite a ... */,
|
||||
|
@ -154,8 +145,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -163,8 +153,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
key: _model.formKey,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
|
@ -185,29 +174,25 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'rfqrdet7' /* Senha */,
|
||||
),
|
||||
labelStyle:
|
||||
FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'zz1haydj' /* digite a sua senha..... */,
|
||||
),
|
||||
hintStyle:
|
||||
FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -238,18 +223,14 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
),
|
||||
filled: true,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 24.0, 20.0, 24.0),
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => safeSetState(
|
||||
() => _model.keyTextFieldVisibility =
|
||||
!_model.keyTextFieldVisibility,
|
||||
() => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility,
|
||||
),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
_model.keyTextFieldVisibility
|
||||
? Icons.visibility_outlined
|
||||
: Icons.visibility_off_outlined,
|
||||
_model.keyTextFieldVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 22.0,
|
||||
),
|
||||
|
@ -261,19 +242,13 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
maxLength: 4,
|
||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||
buildCounter: (context,
|
||||
{required currentLength,
|
||||
required isFocused,
|
||||
maxLength}) =>
|
||||
null,
|
||||
buildCounter: (context, {required currentLength, required isFocused, maxLength}) => null,
|
||||
keyboardType: TextInputType.number,
|
||||
validator: _model.keyTextFieldTextControllerValidator
|
||||
.asValidator(context),
|
||||
validator: _model.keyTextFieldTextControllerValidator.asValidator(context),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(4),
|
||||
|
@ -285,12 +260,10 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () async {
|
||||
if (_model.formKey.currentState == null ||
|
||||
!_model.formKey.currentState!.validate()) {
|
||||
if (_model.formKey.currentState == null || !_model.formKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
await widget.toggleActionStatus?.call(
|
||||
|
@ -304,10 +277,8 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
options: FFButtonOptions(
|
||||
width: 270.0,
|
||||
height: 50.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: const Color(0xFF1AAB5F),
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
|
@ -315,8 +286,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
|||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
|
|
|
@ -9,8 +9,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
|||
import '/flutter_flow/form_field_controller.dart';
|
||||
import 'regisiter_vistor_template_component_widget.dart';
|
||||
|
||||
class RegisiterVistorTemplateComponentModel
|
||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||
class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||
Timer? _debounceTimer;
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
|
@ -18,8 +17,7 @@ class RegisiterVistorTemplateComponentModel
|
|||
|
||||
final unfocusNode = FocusNode();
|
||||
bool isDataUploading = false;
|
||||
FFUploadedFile uploadedLocalFile =
|
||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
|
||||
void debounce(Function() fn, Duration time) {
|
||||
if (_debounceTimer != null) {
|
||||
|
@ -43,14 +41,12 @@ class RegisiterVistorTemplateComponentModel
|
|||
return null;
|
||||
}
|
||||
|
||||
Future<bool> getVisitanteByDocument(
|
||||
String document, BuildContext context) async {
|
||||
Future<bool> getVisitanteByDocument(String document, BuildContext context) async {
|
||||
final response = await PhpGroup.getVisitorByDocCall.call(
|
||||
documento: document,
|
||||
);
|
||||
|
||||
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
||||
response.jsonBody['error'] != 'false') {
|
||||
if (response.jsonBody['visitante']['VTE_ID'] != '0' && response.jsonBody['error'] != 'false') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -93,9 +89,7 @@ class RegisiterVistorTemplateComponentModel
|
|||
TextEditingController? textController4;
|
||||
String? Function(BuildContext, String?)? textController4Validator;
|
||||
String? _textController4Validator(BuildContext context, String? val) {
|
||||
if (val != null &&
|
||||
val.isNotEmpty &&
|
||||
ValidatorUtil.isValidEmail(val) == false) {
|
||||
if (val != null && val.isNotEmpty && ValidatorUtil.isValidEmail(val) == false) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Invalid email',
|
||||
ptText: 'Email inválido',
|
||||
|
|
|
@ -22,16 +22,13 @@ class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
|||
final String source;
|
||||
final String? doc;
|
||||
|
||||
const RegisiterVistorTemplateComponentWidget(
|
||||
{super.key, required this.source, this.doc});
|
||||
const RegisiterVistorTemplateComponentWidget({super.key, required this.source, this.doc});
|
||||
|
||||
@override
|
||||
State<RegisiterVistorTemplateComponentWidget> createState() =>
|
||||
_RegisiterVistorTemplateComponentWidgetState();
|
||||
State<RegisiterVistorTemplateComponentWidget> createState() => _RegisiterVistorTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _RegisiterVistorTemplateComponentWidgetState
|
||||
extends State<RegisiterVistorTemplateComponentWidget> {
|
||||
class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistorTemplateComponentWidget> {
|
||||
late RegisiterVistorTemplateComponentModel _model;
|
||||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
@ -51,8 +48,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
|
||||
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
||||
|
||||
_model =
|
||||
createModel(context, () => RegisiterVistorTemplateComponentModel());
|
||||
_model = createModel(context, () => RegisiterVistorTemplateComponentModel());
|
||||
|
||||
_model.textController1 ??= TextEditingController();
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
@ -89,19 +85,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_model.textController1.text.isEmpty ||
|
||||
_model.textController1.text == '') {
|
||||
if (_model.textController1.text.isEmpty || _model.textController1.text == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_model.dropDownValue == null ||
|
||||
_model.dropDownValue!.isEmpty ||
|
||||
_model.dropDownValue == '') {
|
||||
if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_model.textController2.text.isEmpty ||
|
||||
_model.textController2.text == '') {
|
||||
if (_model.textController2.text.isEmpty || _model.textController2.text == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -145,26 +137,23 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 0.0, 0.0, 15.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 15.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'zazj5d8b' /* Preencha o formulário com os d... */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Column(children: [
|
||||
TextFormField(
|
||||
controller: _model.textController2,
|
||||
|
@ -183,26 +172,19 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'rl8tvwnr' /* Documento */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle:
|
||||
FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
|
@ -237,24 +219,21 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
onChanged: (value) {
|
||||
_model.debounce(() async {
|
||||
var data = await _model.getVisitanteByDocument(
|
||||
value, context);
|
||||
var data = await _model.getVisitanteByDocument(value, context);
|
||||
setState(() {
|
||||
_isVisitorRegistered = data;
|
||||
});
|
||||
}, const Duration(milliseconds: 500));
|
||||
},
|
||||
validator:
|
||||
_model.textController2Validator.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(20)
|
||||
|
@ -268,29 +247,17 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
top: 5, start: 12),
|
||||
padding: const EdgeInsetsDirectional.only(top: 5, start: 12),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Visitor already registered',
|
||||
ptText: 'Visitante já cadastrado',
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.labelSmall
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).labelSmall.override(
|
||||
fontFamily: 'Nunito',
|
||||
color: Theme.of(context)
|
||||
.brightness ==
|
||||
Brightness.dark
|
||||
? Color.alphaBlend(
|
||||
Colors.white
|
||||
.withOpacity(0.7),
|
||||
Colors.red)
|
||||
: Color.alphaBlend(
|
||||
Colors.black
|
||||
.withOpacity(0.25),
|
||||
Colors.red),
|
||||
color: Theme.of(context).brightness == Brightness.dark
|
||||
? Color.alphaBlend(Colors.white.withOpacity(0.7), Colors.red)
|
||||
: Color.alphaBlend(Colors.black.withOpacity(0.25), Colors.red),
|
||||
fontSize: 13.0,
|
||||
letterSpacing: 0.0,
|
||||
)),
|
||||
|
@ -301,8 +268,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
]),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
|
@ -321,25 +287,19 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'v7g73yik' /* Nome */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -375,29 +335,25 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
maxLines: null,
|
||||
maxLength: 80,
|
||||
keyboardType: TextInputType.name,
|
||||
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||
validator:
|
||||
_model.textController1Validator.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
FlutterFlowDropDown<String>(
|
||||
controller: _model.dropDownValueController ??=
|
||||
FormFieldController<String>(null),
|
||||
controller: _model.dropDownValueController ??= FormFieldController<String>(null),
|
||||
options: [
|
||||
FFLocalizations.of(context).getText(
|
||||
'n8vddmcq' /* Visitante */,
|
||||
|
@ -406,20 +362,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
'9luaa09e' /* Prestador de Serviço */,
|
||||
)
|
||||
],
|
||||
onChanged: (val) =>
|
||||
setState(() => _model.dropDownValue = val),
|
||||
onChanged: (val) => setState(() => _model.dropDownValue = val),
|
||||
width: MediaQuery.sizeOf(context).width * 0.9,
|
||||
// height: 44.0,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'pmezihb4' /* Selecione... */,
|
||||
|
@ -433,39 +384,30 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
borderColor: FlutterFlowTheme.of(context).customColor6,
|
||||
borderWidth: 0.5,
|
||||
borderRadius: 8.0,
|
||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
||||
16.0, 0.0, 16.0, 0.0),
|
||||
margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0),
|
||||
hidesUnderline: true,
|
||||
isOverButton: true,
|
||||
isSearchable: false,
|
||||
isMultiSelect: false,
|
||||
),
|
||||
if (_model.dropDownValue == null ||
|
||||
_model.dropDownValue == '')
|
||||
if (_model.dropDownValue == null || _model.dropDownValue == '')
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
top: 5, start: 15),
|
||||
padding: const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodySmall
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodySmallFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.customColor6,
|
||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodySmallFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||
)),
|
||||
),
|
||||
],
|
||||
|
@ -474,12 +416,10 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
||||
false)) {
|
||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -488,15 +428,13 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
onTap: () async {
|
||||
setState(() {
|
||||
_model.isDataUploading = false;
|
||||
_model.uploadedLocalFile =
|
||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Image.memory(
|
||||
_model.uploadedLocalFile.bytes ??
|
||||
Uint8List.fromList([]),
|
||||
_model.uploadedLocalFile.bytes ?? Uint8List.fromList([]),
|
||||
width: 300.0,
|
||||
height: 200.0,
|
||||
fit: BoxFit.cover,
|
||||
|
@ -510,8 +448,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () async {
|
||||
final selectedMedia =
|
||||
await selectMediaWithSourceBottomSheetandFaceDetection(
|
||||
final selectedMedia = await selectMediaWithSourceBottomSheetandFaceDetection(
|
||||
context: context,
|
||||
// maxWidth: 300.00,
|
||||
// maxHeight: 300.00,
|
||||
|
@ -524,15 +461,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
// selectedMedia.every((m) =>
|
||||
// validateFileFormat(
|
||||
// m.storagePath, context))) {
|
||||
setState(
|
||||
() => _model.isDataUploading = true);
|
||||
var selectedUploadedFiles =
|
||||
<FFUploadedFile>[];
|
||||
setState(() => _model.isDataUploading = true);
|
||||
var selectedUploadedFiles = <FFUploadedFile>[];
|
||||
|
||||
try {
|
||||
final message =
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
final message = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Uploading file...',
|
||||
ptText: 'Enviando arquivo...',
|
||||
);
|
||||
|
@ -543,9 +476,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
);
|
||||
selectedUploadedFiles = selectedMedia
|
||||
.map((m) => FFUploadedFile(
|
||||
name: m.storagePath
|
||||
.split('/')
|
||||
.last,
|
||||
name: m.storagePath.split('/').last,
|
||||
bytes: m.bytes,
|
||||
height: m.dimensions?.height,
|
||||
width: m.dimensions?.width,
|
||||
|
@ -553,28 +484,21 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
))
|
||||
.toList();
|
||||
} finally {
|
||||
ScaffoldMessenger.of(context)
|
||||
.hideCurrentSnackBar();
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
_model.isDataUploading = false;
|
||||
}
|
||||
if (selectedUploadedFiles.length ==
|
||||
selectedMedia.length) {
|
||||
if (selectedUploadedFiles.length == selectedMedia.length) {
|
||||
setState(() {
|
||||
_model.uploadedLocalFile =
|
||||
selectedUploadedFiles.first;
|
||||
_model.uploadedLocalFile = selectedUploadedFiles.first;
|
||||
});
|
||||
final String message =
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
final String message = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'File uploaded successfully',
|
||||
ptText: 'Arquivo enviado com sucesso',
|
||||
);
|
||||
showUploadMessage(context, message);
|
||||
} else {
|
||||
setState(() {});
|
||||
final String message =
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
final String message = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Failed to upload data',
|
||||
ptText: 'Falha ao enviar os dados',
|
||||
);
|
||||
|
@ -592,26 +516,16 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 120.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 20.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(
|
||||
14.0, 0.0, 0.0, 20.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(14.0, 0.0, 0.0, 20.0),
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.titleSmallFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
|
@ -624,24 +538,17 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 65.0, 10.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 65.0, 10.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'p4ftwxcy' /* Clique para adicionar a foto p... */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -655,26 +562,23 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 10.0, 0.0, 15.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 10.0, 0.0, 15.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'bqpucwh0' /* Contatos */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -686,8 +590,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
maxLength: 25,
|
||||
keyboardType: TextInputType.phone,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9, +, -, (, )]')),
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')),
|
||||
LengthLimitingTextInputFormatter(25)
|
||||
],
|
||||
obscureText: false,
|
||||
|
@ -697,25 +600,19 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'h84ls2r6' /* Telefone */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -751,20 +648,18 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
// validator:
|
||||
// _model.textController3Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController4,
|
||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -784,25 +679,19 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'fqp7qmka' /* Email */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -838,32 +727,27 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||
validator:
|
||||
_model.textController4Validator.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: _isFormValid(context)
|
||||
? () async {
|
||||
_model.imgBase64 =
|
||||
await ImageUtils.convertImageFileToBase64(
|
||||
_model.imgBase64 = await ImageUtils.convertImageFileToBase64(
|
||||
_model.uploadedLocalFile,
|
||||
);
|
||||
_model.scheduleVisitor =
|
||||
await PhpGroup.postScheduleVisitorCall
|
||||
.call(
|
||||
_model.scheduleVisitor = await PhpGroup.postScheduleVisitorCall
|
||||
.call(
|
||||
documento: _model.textController2.text,
|
||||
nome: _model.textController1.text,
|
||||
tipo: _model.dropDownValue ==
|
||||
|
@ -874,7 +758,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
: 'P',
|
||||
foto: 'base64;jpeg,${_model.imgBase64}',
|
||||
)
|
||||
.onError((e, s) async {
|
||||
.onError((e, s) async {
|
||||
return await DialogUtil.errorDefault(context);
|
||||
});
|
||||
if (PhpGroup.postScheduleVisitorCall.error(
|
||||
|
@ -887,21 +771,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
_model.textController3?.clear();
|
||||
_model.textController4?.clear();
|
||||
_model.dropDownValueController?.reset();
|
||||
_model.uploadedLocalFile = FFUploadedFile(
|
||||
bytes: Uint8List.fromList([]));
|
||||
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Visitante cadastrado com sucesso.',
|
||||
enText:
|
||||
'Visitor successfully registered.'),
|
||||
style: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.info)),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
ptText: 'Visitante cadastrado com sucesso.',
|
||||
enText: 'Visitor successfully registered.'),
|
||||
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
duration: const Duration(seconds: 3),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
|
@ -914,27 +792,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
);
|
||||
_formKey.currentState?.reset();
|
||||
if (widget.source ==
|
||||
'VisitorNotFoundComponent') {
|
||||
if (widget.source == 'VisitorNotFoundComponent') {
|
||||
Navigator.pop(context, true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return DialogUtil.error(
|
||||
context,
|
||||
PhpGroup.postScheduleVisitorCall.errorMsg(
|
||||
_model
|
||||
.scheduleVisitor?.jsonBody) ==
|
||||
null
|
||||
? FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText:
|
||||
'Erro ao se conectar com o servidor',
|
||||
PhpGroup.postScheduleVisitorCall.errorMsg(_model.scheduleVisitor?.jsonBody) == null
|
||||
? FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao se conectar com o servidor',
|
||||
enText: 'Error connecting to server',
|
||||
)
|
||||
: PhpGroup.postScheduleVisitorCall
|
||||
.errorMsg(
|
||||
_model.scheduleVisitor?.jsonBody)
|
||||
.errorMsg(_model.scheduleVisitor?.jsonBody)
|
||||
.toString());
|
||||
}
|
||||
}
|
||||
|
@ -946,20 +817,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
width: 250.0,
|
||||
height: 36.0,
|
||||
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
80.0, 0.0, 80.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(80.0, 0.0, 80.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'sign_in_template_component_widget.dart'
|
||||
show SignInTemplateComponentWidget;
|
||||
|
||||
class SignInTemplateComponentModel
|
||||
extends FlutterFlowModel<SignInTemplateComponentWidget> {
|
||||
import 'sign_in_template_component_widget.dart' show SignInTemplateComponentWidget;
|
||||
|
||||
class SignInTemplateComponentModel extends FlutterFlowModel<SignInTemplateComponentWidget> {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final unfocusNode = FocusNode();
|
||||
FocusNode? emailAddressFocusNode;
|
||||
|
@ -27,6 +24,7 @@ class SignInTemplateComponentModel
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
FocusNode? passwordFocusNode;
|
||||
TextEditingController? passwordTextController;
|
||||
late bool passwordVisibility;
|
||||
|
@ -41,11 +39,6 @@ class SignInTemplateComponentModel
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {
|
||||
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
||||
|
|
|
@ -27,12 +27,10 @@ class SignInTemplateComponentWidget extends StatefulWidget {
|
|||
final Future Function()? toggleSignUpPage;
|
||||
|
||||
@override
|
||||
State<SignInTemplateComponentWidget> createState() =>
|
||||
_SignInTemplateComponentWidgetState();
|
||||
State<SignInTemplateComponentWidget> createState() => _SignInTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _SignInTemplateComponentWidgetState
|
||||
extends State<SignInTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
late SignInTemplateComponentModel _model;
|
||||
|
||||
final animationsMap = <String, AnimationInfo>{};
|
||||
|
@ -148,9 +146,7 @@ class _SignInTemplateComponentWidgetState
|
|||
enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.displaySmall
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 24.0,
|
||||
|
@ -185,7 +181,9 @@ class _SignInTemplateComponentWidgetState
|
|||
padding: const EdgeInsetsDirectional.fromSTEB(34.0, 0.0, 34.0, 0.0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: const BoxConstraints(maxWidth: 570.0,),
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 570.0,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
|
@ -201,162 +199,94 @@ class _SignInTemplateComponentWidgetState
|
|||
children: [
|
||||
Form(
|
||||
key: _model.formKey,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
key: const ValueKey<String>(
|
||||
'emailTextFormField'),
|
||||
controller: _model
|
||||
.emailAddressTextController,
|
||||
focusNode: _model
|
||||
.emailAddressFocusNode,
|
||||
cursorColor:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primary,
|
||||
onChanged: (_) =>
|
||||
EasyDebounce.debounce(
|
||||
key: const ValueKey<String>('emailTextFormField'),
|
||||
controller: _model.emailAddressTextController,
|
||||
focusNode: _model.emailAddressFocusNode,
|
||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.emailAddressTextController',
|
||||
const Duration(
|
||||
milliseconds: 500),
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
),
|
||||
autofocus: true,
|
||||
autofillHints: const [
|
||||
AutofillHints.email
|
||||
],
|
||||
textCapitalization:
|
||||
TextCapitalization.none,
|
||||
textInputAction:
|
||||
TextInputAction.next,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
textCapitalization: TextCapitalization.none,
|
||||
textInputAction: TextInputAction.next,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'1ltg0ylb' /* Email */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme
|
||||
.of(context)
|
||||
.labelLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme
|
||||
.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.customColor1,
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder:
|
||||
OutlineInputBorder(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.success,
|
||||
color: FlutterFlowTheme.of(context).success,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
errorBorder:
|
||||
OutlineInputBorder(
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
suffixIcon: Icon(
|
||||
Icons.email,
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 22.0,
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
keyboardType: TextInputType
|
||||
.emailAddress,
|
||||
validator: _model
|
||||
.emailAddressTextControllerValidator
|
||||
.asValidator(context),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
validator:
|
||||
_model.emailAddressTextControllerValidator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
|
@ -365,79 +295,76 @@ class _SignInTemplateComponentWidgetState
|
|||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
focusNode: _model.passwordFocusNode,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.passwordTextController',
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {})
|
||||
),
|
||||
'_model.passwordTextController',
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {})),
|
||||
autofocus: true,
|
||||
autofillHints: const [AutofillHints.password],
|
||||
textInputAction: TextInputAction.send,
|
||||
obscureText: !_model.passwordVisibility,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelLarge
|
||||
.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color:Color(0xFF1AAB5F),
|
||||
width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFFFF5963),
|
||||
width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFFFF5963),
|
||||
width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => setState(() => _model.passwordVisibility = !_model.passwordVisibility),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
_model.passwordVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||
color:FlutterFlowTheme.of(context).accent1,
|
||||
size: 24.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
labelText:
|
||||
FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
|
||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(color: Color(0xFF1AAB5F), width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(color: Color(0xFFFF5963), width: 0.25),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => setState(
|
||||
() => _model.passwordVisibility = !_model.passwordVisibility),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
_model.passwordVisibility
|
||||
? Icons.visibility_outlined
|
||||
: Icons.visibility_off_outlined,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 24.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
validator: _model.passwordTextControllerValidator.asValidator(context),
|
||||
validator:
|
||||
_model.passwordTextControllerValidator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
Builder(
|
||||
builder: (context) {
|
||||
if (MediaQuery.sizeOf(context).width < kBreakpointSmall ? true : false) {
|
||||
|
@ -451,9 +378,11 @@ class _SignInTemplateComponentWidgetState
|
|||
onPressed: _isFormInvalid()
|
||||
? null
|
||||
: () async {
|
||||
await AuthenticationService.signIn(context, _model,
|
||||
emailAdress: _model.emailAddressTextController.text,
|
||||
password: _model.passwordTextController.text,
|
||||
await AuthenticationService.signIn(
|
||||
context,
|
||||
_model,
|
||||
emailAdress: _model.emailAddressTextController.text,
|
||||
password: _model.passwordTextController.text,
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
|
@ -461,20 +390,21 @@ class _SignInTemplateComponentWidgetState
|
|||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.transparent, width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||
disabledTextColor: Colors.white,
|
||||
|
@ -487,27 +417,28 @@ class _SignInTemplateComponentWidgetState
|
|||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('toggleSignUpPage'),
|
||||
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
||||
text: FFLocalizations.of(context).getText('14u7ipws' /* Cadastrar */,
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'14u7ipws' /* Cadastrar */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
textStyle:
|
||||
FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.transparent, width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
|
@ -517,105 +448,107 @@ class _SignInTemplateComponentWidgetState
|
|||
);
|
||||
} else {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0,0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('SubmitButtonWidget'),
|
||||
onPressed: _isFormInvalid() ? null : () async {
|
||||
try {
|
||||
await AuthenticationService.signIn(
|
||||
context,
|
||||
_model,
|
||||
emailAdress: _model.emailAddressTextController.text,
|
||||
password: _model.passwordTextController.text,
|
||||
);
|
||||
setState(() {});
|
||||
} catch (e, s) {
|
||||
await DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed(
|
||||
'login.php',
|
||||
_model.emailAddressTextController.text,
|
||||
"Login",
|
||||
e, s);
|
||||
}
|
||||
},
|
||||
text: FFLocalizations.of(context).getText('1x926nsn'),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('SubmitButtonWidget'),
|
||||
onPressed: _isFormInvalid()
|
||||
? null
|
||||
: () async {
|
||||
try {
|
||||
await AuthenticationService.signIn(
|
||||
context,
|
||||
_model,
|
||||
emailAdress: _model.emailAddressTextController.text,
|
||||
password: _model.passwordTextController.text,
|
||||
);
|
||||
setState(() {});
|
||||
} catch (e, s) {
|
||||
await DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed(
|
||||
'login.php',
|
||||
_model.emailAddressTextController.text,
|
||||
"Login",
|
||||
e,
|
||||
s);
|
||||
}
|
||||
},
|
||||
text: FFLocalizations.of(context).getText('1x926nsn'),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
disabledColor: const Color(0xE81AAB5F),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
disabledColor: const Color(0xE81AAB5F),
|
||||
showLoadingIndicator: true,
|
||||
),
|
||||
showLoadingIndicator: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0,
|
||||
0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('toggleSignUpPage'),
|
||||
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
||||
text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
textStyle:
|
||||
FlutterFlowTheme
|
||||
.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(color: Colors.transparent,width: 1.0,),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('toggleSignUpPage'),
|
||||
onPressed: () async => await widget.toggleSignUpPage?.call(),
|
||||
text: FFLocalizations.of(context)
|
||||
.getText('jwvd4ai1' /* Cadastrar */),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(const SizedBox(width: 7.0)));
|
||||
].divide(const SizedBox(width: 7.0)));
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
child: InkWell(
|
||||
|
@ -626,43 +559,46 @@ class _SignInTemplateComponentWidgetState
|
|||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
await showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const ForgotPasswordTemplateComponentWidget(),
|
||||
);
|
||||
}).then((value) => safeSetState(() {}));
|
||||
},
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const ForgotPasswordTemplateComponentWidget(),
|
||||
);
|
||||
}).then((value) => safeSetState(() {}));
|
||||
},
|
||||
child: RichText(
|
||||
textScaler: MediaQuery.of(context).textScaler,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: FFLocalizations.of(context).getText('05dx91ku' /* Você esqueceu a sua senha? */,),
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'05dx91ku' /* Você esqueceu a sua senha? */,
|
||||
),
|
||||
style: TextStyle(color: FlutterFlowTheme.of(context).primaryText),
|
||||
),
|
||||
TextSpan(
|
||||
text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */),
|
||||
text: FFLocalizations.of(context)
|
||||
.getText('p5c6d54y' /* Recupere aqui */),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.normal,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
)
|
||||
],
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily)),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -672,8 +608,7 @@ class _SignInTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
),
|
||||
).animateOnPageLoad(
|
||||
animationsMap['containerOnPageLoadAnimation']!),
|
||||
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'sign_up_template_component_widget.dart'
|
||||
show SignUpTemplateComponentWidget;
|
||||
|
||||
class SignUpTemplateComponentModel
|
||||
extends FlutterFlowModel<SignUpTemplateComponentWidget> {
|
||||
import 'sign_up_template_component_widget.dart' show SignUpTemplateComponentWidget;
|
||||
|
||||
class SignUpTemplateComponentModel extends FlutterFlowModel<SignUpTemplateComponentWidget> {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
FocusNode? nameRegisterFormFocusNode;
|
||||
TextEditingController? nameRegisterFormTextController;
|
||||
|
@ -80,7 +77,4 @@ class SignUpTemplateComponentModel
|
|||
passwordRegisterFormFocusNode?.dispose();
|
||||
passwordRegisterFormTextController?.dispose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ export 'sign_up_template_component_model.dart';
|
|||
class SignUpTemplateComponentWidget extends StatefulWidget {
|
||||
const SignUpTemplateComponentWidget({super.key, required this.toggleSignInPage});
|
||||
final Future Function()? toggleSignInPage;
|
||||
@override State<SignUpTemplateComponentWidget> createState() => _SignUpTemplateComponentWidgetState();
|
||||
@override
|
||||
State<SignUpTemplateComponentWidget> createState() => _SignUpTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
|
@ -104,13 +105,11 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!ValidatorUtil.isValidEmail(
|
||||
_model.emailRegisterFormTextController.text)) {
|
||||
if (!ValidatorUtil.isValidEmail(_model.emailRegisterFormTextController.text)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!ValidatorUtil.isValidPassword(
|
||||
_model.passwordRegisterFormTextController.text)) {
|
||||
if (!ValidatorUtil.isValidPassword(_model.passwordRegisterFormTextController.text)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -152,8 +151,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
children: [
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(0.0, -1.0),
|
||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Text(
|
||||
|
@ -161,18 +159,13 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
'49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.displaySmall
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: screenWidth * 0.06,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -209,8 +202,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
maxWidth: 570.0,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: Align(
|
||||
|
@ -219,459 +211,261 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
padding: const EdgeInsets.all(32.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Form(
|
||||
key: _model.formKey,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
key: const ValueKey<String>(
|
||||
'nameTextFormField'),
|
||||
controller: _model
|
||||
.nameRegisterFormTextController,
|
||||
focusNode: _model
|
||||
.nameRegisterFormFocusNode,
|
||||
onChanged: (_) =>
|
||||
EasyDebounce.debounce(
|
||||
key: const ValueKey<String>('nameTextFormField'),
|
||||
controller: _model.nameRegisterFormTextController,
|
||||
focusNode: _model.nameRegisterFormFocusNode,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.nameRegisterFormTextController',
|
||||
const Duration(
|
||||
milliseconds: 500),
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
),
|
||||
autofocus: false,
|
||||
autofillHints: const [
|
||||
AutofillHints.name
|
||||
],
|
||||
autofillHints: const [AutofillHints.name],
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'3corpwhd' /* Nome */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme
|
||||
.of(context)
|
||||
.labelLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme
|
||||
.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.customColor1,
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder:
|
||||
OutlineInputBorder(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.success,
|
||||
color: FlutterFlowTheme.of(context).success,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
errorBorder:
|
||||
OutlineInputBorder(
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryBackground,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
suffixIcon: Icon(
|
||||
Icons.person,
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 22.0,
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
validator: _model
|
||||
.nameRegisterFormTextControllerValidator
|
||||
validator: _model.nameRegisterFormTextControllerValidator
|
||||
.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
key: const ValueKey<String>(
|
||||
'emailTextFormField'),
|
||||
controller: _model
|
||||
.emailRegisterFormTextController,
|
||||
focusNode: _model
|
||||
.emailRegisterFormFocusNode,
|
||||
onChanged: (_) =>
|
||||
EasyDebounce.debounce(
|
||||
key: const ValueKey<String>('emailTextFormField'),
|
||||
controller: _model.emailRegisterFormTextController,
|
||||
focusNode: _model.emailRegisterFormFocusNode,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.emailRegisterFormTextController',
|
||||
const Duration(
|
||||
milliseconds: 500),
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
),
|
||||
autofocus: false,
|
||||
autofillHints: const [
|
||||
AutofillHints.email
|
||||
],
|
||||
autofillHints: const [AutofillHints.email],
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'80wonb69' /* Email */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme
|
||||
.of(context)
|
||||
.labelLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme
|
||||
.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder:
|
||||
OutlineInputBorder(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.success,
|
||||
color: FlutterFlowTheme.of(context).success,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
errorBorder:
|
||||
OutlineInputBorder(
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryBackground,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
suffixIcon: Icon(
|
||||
Icons.email,
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.accent1,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 22.0,
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.customColor1,
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
keyboardType: TextInputType
|
||||
.emailAddress,
|
||||
validator: _model
|
||||
.emailRegisterFormTextControllerValidator
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
validator: _model.emailRegisterFormTextControllerValidator
|
||||
.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
key: const ValueKey<String>(
|
||||
'passwordTextFormField'),
|
||||
controller: _model
|
||||
.passwordRegisterFormTextController,
|
||||
focusNode: _model
|
||||
.passwordRegisterFormFocusNode,
|
||||
onChanged: (_) =>
|
||||
EasyDebounce.debounce(
|
||||
key: const ValueKey<String>('passwordTextFormField'),
|
||||
controller: _model.passwordRegisterFormTextController,
|
||||
focusNode: _model.passwordRegisterFormFocusNode,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.passwordRegisterFormTextController',
|
||||
const Duration(
|
||||
milliseconds: 500),
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
),
|
||||
autofocus: false,
|
||||
autofillHints: const [
|
||||
AutofillHints.password
|
||||
],
|
||||
obscureText: !_model
|
||||
.passwordRegisterFormVisibility,
|
||||
autofillHints: const [AutofillHints.password],
|
||||
obscureText: !_model.passwordRegisterFormVisibility,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText:
|
||||
FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'0firji8l' /* Senha */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme
|
||||
.of(context)
|
||||
.labelLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme
|
||||
.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.customColor1,
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(
|
||||
color:
|
||||
Color(0xFF1AAB5F),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFF1AAB5F),
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
errorBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(
|
||||
color:
|
||||
Color(0xFFFF5963),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFFFF5963),
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide:
|
||||
const BorderSide(
|
||||
color:
|
||||
Color(0xFFFF5963),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFFFF5963),
|
||||
width: 0.25,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
filled: true,
|
||||
fillColor:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryBackground,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
suffixIcon: InkWell(
|
||||
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
||||
onTap: () => setState(
|
||||
() => _model
|
||||
.passwordRegisterFormVisibility =
|
||||
!_model
|
||||
.passwordRegisterFormVisibility,
|
||||
() => _model.passwordRegisterFormVisibility =
|
||||
!_model.passwordRegisterFormVisibility,
|
||||
),
|
||||
focusNode: FocusNode(
|
||||
skipTraversal: true),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
_model.passwordRegisterFormVisibility
|
||||
? Icons
|
||||
.visibility_outlined
|
||||
: Icons
|
||||
.visibility_off_outlined,
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.accent1,
|
||||
? Icons.visibility_outlined
|
||||
: Icons.visibility_off_outlined,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 24.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
validator: _model
|
||||
.passwordRegisterFormTextControllerValidator
|
||||
validator: _model.passwordRegisterFormTextControllerValidator
|
||||
.asValidator(context),
|
||||
),
|
||||
),
|
||||
|
@ -680,70 +474,53 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('SubmitButtonWidget'),
|
||||
onPressed: isFormInvalid()
|
||||
? null
|
||||
: () async {
|
||||
var shouldSetState = false;
|
||||
_model.register = await AuthenticationService.signUp(context,
|
||||
_model.register = await AuthenticationService.signUp(
|
||||
context,
|
||||
email: _model.emailRegisterFormTextController.text,
|
||||
name: _model.nameRegisterFormTextController.text,
|
||||
passwd: _model.passwordRegisterFormTextController.text,
|
||||
device: StorageUtil().deviceType,
|
||||
);
|
||||
shouldSetState = true;
|
||||
if (_model.register == true) await widget.toggleSignInPage?.call();
|
||||
if (_model.register == true)
|
||||
await widget.toggleSignInPage?.call();
|
||||
else {
|
||||
if (shouldSetState) setState(() {});
|
||||
return;
|
||||
}
|
||||
if (shouldSetState) setState(() {});
|
||||
},
|
||||
text: FFLocalizations.of(context)
|
||||
.getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'rnvdwzei' /* Cadastrar-se */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.accent1,
|
||||
textStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.secondaryText,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12.0),
|
||||
disabledColor:
|
||||
FlutterFlowTheme.of(context)
|
||||
.customColor5,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||
disabledTextColor: Colors.white,
|
||||
),
|
||||
showLoadingIndicator: true,
|
||||
|
@ -752,8 +529,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
|
||||
// You will have to add an action on this rich text to go to your login page.
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||
child: InkWell(
|
||||
key: const ValueKey<String>('toggleSignInPage'),
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -762,65 +538,38 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
highlightColor: Colors.transparent,
|
||||
onTap: () async => await widget.toggleSignInPage?.call(),
|
||||
child: RichText(
|
||||
textScaler: MediaQuery.of(context)
|
||||
.textScaler,
|
||||
textScaler: MediaQuery.of(context).textScaler,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'a9smhn5b' /* Você já tem uma conta? */,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'09xv5ctc' /* Clique aqui */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.primary,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
)
|
||||
],
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -830,8 +579,7 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
|||
),
|
||||
),
|
||||
),
|
||||
).animateOnPageLoad(
|
||||
animationsMap['containerOnPageLoadAnimation']!),
|
||||
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -85,23 +85,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
// }
|
||||
// });
|
||||
|
||||
_model.textController1 = TextEditingController(
|
||||
text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||
_model.textController1 =
|
||||
TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
||||
_model.textController2 ??=
|
||||
TextEditingController(text: widget.visitStartDate);
|
||||
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||
_model.textFieldFocusNode2 ??= FocusNode();
|
||||
|
||||
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||
_model.textFieldFocusNode3 ??= FocusNode();
|
||||
|
||||
_model.textController4 ??=
|
||||
TextEditingController(text: widget.visitReasonStr);
|
||||
_model.textController4 ??= TextEditingController(text: widget.visitReasonStr);
|
||||
_model.textFieldFocusNode4 ??= FocusNode();
|
||||
|
||||
_model.textController5 ??=
|
||||
TextEditingController(text: widget.visitLevelStr);
|
||||
_model.textController5 ??= TextEditingController(text: widget.visitLevelStr);
|
||||
_model.textFieldFocusNode5 ??= FocusNode();
|
||||
|
||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||
|
@ -117,8 +114,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var filteredVisitorJsonList =
|
||||
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
||||
var filteredVisitorJsonList = findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
||||
|
@ -154,8 +150,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
child: Align(
|
||||
alignment: const AlignmentDirectional(1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
15.0, 0.0, 15.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 15.0, 0.0),
|
||||
child: FlutterFlowIconButton(
|
||||
borderRadius: 20.0,
|
||||
borderWidth: 1.0,
|
||||
|
@ -184,8 +179,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 20.0, 20.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 20.0),
|
||||
child: Container(
|
||||
width: 100.0,
|
||||
decoration: const BoxDecoration(),
|
||||
|
@ -225,10 +219,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
child: CachedNetworkImage(
|
||||
fadeInDuration:
|
||||
const Duration(milliseconds: 500),
|
||||
fadeOutDuration:
|
||||
const Duration(milliseconds: 500),
|
||||
fadeInDuration: const Duration(milliseconds: 500),
|
||||
fadeOutDuration: const Duration(milliseconds: 500),
|
||||
imageUrl: valueOrDefault<String>(
|
||||
widget.visitorImgPath,
|
||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||
|
@ -247,8 +239,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController1,
|
||||
focusNode: _model.textFieldFocusNode1,
|
||||
|
@ -262,27 +253,19 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'9yu35pzg' /* Encerramento da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -314,29 +297,24 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController1Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController2,
|
||||
focusNode: _model.textFieldFocusNode2,
|
||||
|
@ -350,34 +328,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'aj6scczp' /* Início */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ub084nhy' /* dd/mm/yyyy */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -408,27 +374,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController2Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController3,
|
||||
focusNode: _model.textFieldFocusNode3,
|
||||
|
@ -442,34 +401,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'rvi5z7wg' /* Término */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ixs67mrz' /* dd/mm/yyyy */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -500,20 +447,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController3Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -521,16 +462,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 10.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController4,
|
||||
focusNode: _model.textFieldFocusNode4,
|
||||
|
@ -544,34 +483,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'yxilg7ek' /* Motivo da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ypeydbem' /* Motivo */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -602,27 +529,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController4Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController5,
|
||||
focusNode: _model.textFieldFocusNode5,
|
||||
|
@ -636,34 +556,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'dgr3pk3a' /* Nível de Acesso */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'rs3d4gb8' /* Nível de Acesso */,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -694,20 +602,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController5Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController5Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -717,8 +619,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
8.0, 0.0, 8.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||
child: TextFormField(
|
||||
controller: _model.textController6,
|
||||
focusNode: _model.textFieldFocusNode6,
|
||||
|
@ -732,27 +633,19 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
labelText: FFLocalizations.of(context).getText(
|
||||
'lppn9rxa' /* Observações da Visita */,
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -784,15 +677,12 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController6Validator
|
||||
.asValidator(context),
|
||||
validator: _model.textController6Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -817,8 +707,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
size: 24.0,
|
||||
),
|
||||
onPressed: () async {
|
||||
_model.deleteVisit =
|
||||
await PhpGroup.deleteVisitCall.call(
|
||||
_model.deleteVisit = await PhpGroup.deleteVisitCall.call(
|
||||
idVisita: widget.visitIdStr,
|
||||
);
|
||||
|
||||
|
@ -828,8 +717,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
false) {
|
||||
context.pop();
|
||||
} else {
|
||||
final error =
|
||||
await DialogUtil.errorDefault(context);
|
||||
final error = await DialogUtil.errorDefault(context);
|
||||
await showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart';
|
||||
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart';
|
||||
import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart';
|
||||
|
@ -7,8 +5,7 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VisitDetailsModalTemplateComponentModel
|
||||
extends FlutterFlowModel<VisitDetailsModalTemplateComponentWidget> {
|
||||
class VisitDetailsModalTemplateComponentModel extends FlutterFlowModel<VisitDetailsModalTemplateComponentWidget> {
|
||||
/// Local state fields for this component.
|
||||
|
||||
Color statusColor = const Color(0xff000000);
|
||||
|
@ -23,8 +20,7 @@ class VisitDetailsModalTemplateComponentModel
|
|||
@override
|
||||
void initState(BuildContext context) {
|
||||
viewVisitDetailModel = createModel(context, () => ViewVisitDetailModel());
|
||||
scheduleVisitDetailModel =
|
||||
createModel(context, () => ScheduleVisitDetailModel());
|
||||
scheduleVisitDetailModel = createModel(context, () => ScheduleVisitDetailModel());
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -32,4 +28,4 @@ class VisitDetailsModalTemplateComponentModel
|
|||
viewVisitDetailModel.dispose();
|
||||
scheduleVisitDetailModel.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
||||
|
@ -42,12 +41,10 @@ class VisitDetailsModalTemplateComponentWidget extends StatefulWidget {
|
|||
final Color? visitStatusColor;
|
||||
|
||||
@override
|
||||
State<VisitDetailsModalTemplateComponentWidget> createState() =>
|
||||
_VisitDetailsModalTemplateComponentWidgetState();
|
||||
State<VisitDetailsModalTemplateComponentWidget> createState() => _VisitDetailsModalTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _VisitDetailsModalTemplateComponentWidgetState
|
||||
extends State<VisitDetailsModalTemplateComponentWidget> {
|
||||
class _VisitDetailsModalTemplateComponentWidgetState extends State<VisitDetailsModalTemplateComponentWidget> {
|
||||
late VisitDetailsModalTemplateComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -59,8 +56,7 @@ class _VisitDetailsModalTemplateComponentWidgetState
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model =
|
||||
createModel(context, () => VisitDetailsModalTemplateComponentModel());
|
||||
_model = createModel(context, () => VisitDetailsModalTemplateComponentModel());
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'visitor_details_modal_template_component_widget.dart'
|
||||
show VisitorDetailsModalTemplateComponentWidget;
|
||||
import 'visitor_details_modal_template_component_widget.dart' show VisitorDetailsModalTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VisitorDetailsModalTemplateComponentModel
|
||||
extends FlutterFlowModel<VisitorDetailsModalTemplateComponentWidget> {
|
||||
class VisitorDetailsModalTemplateComponentModel extends FlutterFlowModel<VisitorDetailsModalTemplateComponentWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
|
|
|
@ -25,12 +25,10 @@ class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
|||
final String? visitorEmail;
|
||||
|
||||
@override
|
||||
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
||||
_VisitorDetailsModalTemplateComponentWidgetState();
|
||||
State<VisitorDetailsModalTemplateComponentWidget> createState() => _VisitorDetailsModalTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _VisitorDetailsModalTemplateComponentWidgetState
|
||||
extends State<VisitorDetailsModalTemplateComponentWidget> {
|
||||
class _VisitorDetailsModalTemplateComponentWidgetState extends State<VisitorDetailsModalTemplateComponentWidget> {
|
||||
late VisitorDetailsModalTemplateComponentModel _model;
|
||||
|
||||
@override
|
||||
|
@ -42,8 +40,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model =
|
||||
createModel(context, () => VisitorDetailsModalTemplateComponentModel());
|
||||
_model = createModel(context, () => VisitorDetailsModalTemplateComponentModel());
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -85,8 +82,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
child: Align(
|
||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 5.0, 15.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0),
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -107,21 +103,18 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 40.0, 20.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 10.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (widget.visitorImageURL != '' &&
|
||||
widget.visitorImageURL != null)
|
||||
if (widget.visitorImageURL != '' && widget.visitorImageURL != null)
|
||||
Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
|
@ -137,23 +130,17 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 0.0, 20.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||
child: Text(
|
||||
widget.visitorName ?? '',
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
fontSize: 24.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -161,24 +148,18 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 0.0, 20.0, 30.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 30.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'hz7ivuqn' /* Tipo de Visitante */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -192,28 +173,20 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
size: 24.0,
|
||||
),
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(-1.0, 0.0),
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 0.0, 20.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'rwqn0det' /* (00) 0 0000-0000 */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -229,28 +202,20 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
|||
size: 24.0,
|
||||
),
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(-1.0, 0.0),
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 0.0, 20.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'0wqbiekp' /* email@provider.etc */,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -29,7 +29,8 @@ class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
|
|||
State<VisitorSearchModalTemplateComponentWidget> createState() => _VisitorSearchModalTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget>
|
||||
with TickerProviderStateMixin {
|
||||
late VisitorSearchModalTemplateComponentModel _model;
|
||||
|
||||
safeSetState(VoidCallback callback) {
|
||||
|
@ -103,19 +104,35 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).accent1, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).primary, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
|
@ -144,7 +161,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -155,7 +173,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -201,7 +220,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
child: CachedNetworkImage(
|
||||
fadeInDuration: const Duration(milliseconds: 500),
|
||||
fadeOutDuration: const Duration(milliseconds: 500),
|
||||
imageUrl: "https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||
imageUrl:
|
||||
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||
visitorItem,
|
||||
r'''$.VTE_DOCUMENTO''',
|
||||
).toString()}&tipo=E",
|
||||
|
@ -226,7 +246,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -237,7 +258,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
borderRadius: 20.0,
|
||||
borderWidth: 1.0,
|
||||
buttonSize: 40.0,
|
||||
icon: Icon(Icons.close, color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||
icon: Icon(Icons.close,
|
||||
color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||
onPressed: () async {
|
||||
_model.removeFromVisitors(visitorItem);
|
||||
_model.removeFromDocs(docItem);
|
||||
|
@ -270,7 +292,9 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
FFButtonWidget(
|
||||
onPressed: MediaQuery.of(context).viewInsets.bottom > 0 ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) : () async => await sendVisitors(context),
|
||||
onPressed: MediaQuery.of(context).viewInsets.bottom > 0
|
||||
? () async => await addVisitor(context).whenComplete(safeSetState(() {}))
|
||||
: () async => await sendVisitors(context),
|
||||
text: MediaQuery.of(context).viewInsets.bottom > 0
|
||||
? FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Add',
|
||||
|
@ -290,11 +314,16 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(15), bottomRight: Radius.circular(15), topLeft: Radius.circular(15), topRight: Radius.circular(15)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15),
|
||||
bottomRight: Radius.circular(15),
|
||||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -318,9 +347,12 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
_model.textController?.text = _model.textController.text;
|
||||
_model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length);
|
||||
});
|
||||
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||
_model.getVisitorByDoc =
|
||||
await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||
|
||||
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' && PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false && PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != null) {
|
||||
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' &&
|
||||
PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false &&
|
||||
PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != null) {
|
||||
String newDoc = _model.textController.text;
|
||||
bool existDoc = _model.docs.contains(newDoc);
|
||||
if (existDoc == false) {
|
||||
|
@ -329,7 +361,11 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
_model.addToDocs(_model.textController.text);
|
||||
safeSetState(() {});
|
||||
} else if (existDoc == true) {
|
||||
ToastUtil.showToast(message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'), gravity: ToastGravity.TOP, backgroundColor: Colors.red);
|
||||
ToastUtil.showToast(
|
||||
message: FFLocalizations.of(context)
|
||||
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||
gravity: ToastGravity.TOP,
|
||||
backgroundColor: Colors.red);
|
||||
}
|
||||
} else {
|
||||
await showAdaptiveDialog(
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'welcome_template_component_widget.dart'
|
||||
show WelcomeTemplateComponentWidget;
|
||||
import 'welcome_template_component_widget.dart' show WelcomeTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class WelcomeTemplateComponentModel
|
||||
extends FlutterFlowModel<WelcomeTemplateComponentWidget> {
|
||||
class WelcomeTemplateComponentModel extends FlutterFlowModel<WelcomeTemplateComponentWidget> {
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ class WelcomeTemplateComponentWidget extends StatefulWidget {
|
|||
final Future Function()? toggleSignInPage;
|
||||
|
||||
@override
|
||||
State<WelcomeTemplateComponentWidget> createState() =>
|
||||
_WelcomeTemplateComponentWidgetState();
|
||||
State<WelcomeTemplateComponentWidget> createState() => _WelcomeTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
|
@ -41,39 +40,38 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
super.initState();
|
||||
_model = createModel(context, () => WelcomeTemplateComponentModel());
|
||||
|
||||
animationsMap.addAll(
|
||||
<String, AnimationInfo>{
|
||||
'containerOnPageLoadAnimation': AnimationInfo(
|
||||
trigger: AnimationTrigger.onPageLoad,
|
||||
effectsBuilder: () => [
|
||||
VisibilityEffect(duration: 1.ms),
|
||||
FadeEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: 0.0,
|
||||
end: 1.0,
|
||||
),
|
||||
MoveEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(0.0, 140.0),
|
||||
end: const Offset(0.0, 0.0),
|
||||
),
|
||||
ScaleEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(0.9, 0.9),
|
||||
end: const Offset(1.0, 1.0),
|
||||
),
|
||||
TiltEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(-0.349, 0),
|
||||
end: const Offset(0, 0),
|
||||
animationsMap.addAll(<String, AnimationInfo>{
|
||||
'containerOnPageLoadAnimation': AnimationInfo(
|
||||
trigger: AnimationTrigger.onPageLoad,
|
||||
effectsBuilder: () => [
|
||||
VisibilityEffect(duration: 1.ms),
|
||||
FadeEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: 0.0,
|
||||
end: 1.0,
|
||||
),
|
||||
MoveEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(0.0, 140.0),
|
||||
end: const Offset(0.0, 0.0),
|
||||
),
|
||||
ScaleEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(0.9, 0.9),
|
||||
end: const Offset(1.0, 1.0),
|
||||
),
|
||||
TiltEffect(
|
||||
curve: Curves.easeInOut,
|
||||
delay: 0.0.ms,
|
||||
duration: 300.0.ms,
|
||||
begin: const Offset(-0.349, 0),
|
||||
end: const Offset(0, 0),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -112,11 +110,10 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text( FFLocalizations.of(context).getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */),
|
||||
Text(
|
||||
FFLocalizations.of(context).getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.displaySmall
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
fontSize: 24.0,
|
||||
|
@ -127,11 +124,10 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
),
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||
child: Text(FFLocalizations.of(context).getText('5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText('5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */),
|
||||
textAlign: TextAlign.start,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.displaySmall
|
||||
.override(
|
||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: 15.0,
|
||||
|
@ -171,7 +167,7 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
BoxShadow(
|
||||
blurRadius: 0.0,
|
||||
color: Colors.transparent,
|
||||
offset: Offset(0.0,0.0),
|
||||
offset: Offset(0.0, 0.0),
|
||||
)
|
||||
],
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
|
@ -198,88 +194,61 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
onPressed: () async {
|
||||
await widget.toggleSignInPage?.call();
|
||||
},
|
||||
text: FFLocalizations.of(context).getText( 'dynet730' /* Entrar */),
|
||||
text: FFLocalizations.of(context).getText('dynet730' /* Entrar */),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
textStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleSmall
|
||||
.override(
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.info,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>(
|
||||
'toggleSignUpPage'),
|
||||
key: const ValueKey<String>('toggleSignUpPage'),
|
||||
onPressed: () async {
|
||||
await widget.toggleSignUpPage?.call();
|
||||
},
|
||||
text:
|
||||
FFLocalizations.of(context).getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'hha60cg7' /* Cadastrar */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.customColor1,
|
||||
textStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleSmall
|
||||
.override(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).customColor1,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
|
@ -289,60 +258,39 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
} else {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('toggleSignInPage'),
|
||||
|
||||
key: const ValueKey<String>('toggleSignInPage'),
|
||||
onPressed: () async {
|
||||
|
||||
await widget.toggleSignInPage
|
||||
?.call();
|
||||
await widget.toggleSignInPage?.call();
|
||||
},
|
||||
text: FFLocalizations.of(context)
|
||||
.getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'zvtay8ee' /* Entrar */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
textStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.info,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
|
@ -350,53 +298,35 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('toggleSignUpPage'),
|
||||
onPressed: () async {
|
||||
await widget.toggleSignUpPage
|
||||
?.call();
|
||||
await widget.toggleSignUpPage?.call();
|
||||
},
|
||||
text: FFLocalizations.of(context)
|
||||
.getText(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'o6zob50a' /* Cadastrar */,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: double.infinity,
|
||||
height: 44.0,
|
||||
padding: const EdgeInsetsDirectional
|
||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
textStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily:
|
||||
'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.info,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts
|
||||
.asMap()
|
||||
.containsKey(
|
||||
'Plus Jakarta Sans'),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12.0),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
),
|
||||
|
@ -411,8 +341,7 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
|||
),
|
||||
),
|
||||
),
|
||||
).animateOnPageLoad(
|
||||
animationsMap['containerOnPageLoadAnimation']!),
|
||||
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// File generated by FlutterFire CLI.
|
||||
// ignore_for_file: type=lint
|
||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
|
||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||
///
|
||||
|
@ -73,10 +72,8 @@ class DefaultFirebaseOptions {
|
|||
projectId: 'accessmoblie-da839',
|
||||
databaseURL: 'https://accessmoblie-da839.firebaseio.com',
|
||||
storageBucket: 'accessmoblie-da839.appspot.com',
|
||||
androidClientId:
|
||||
'187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com',
|
||||
iosClientId:
|
||||
'187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com',
|
||||
androidClientId: '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com',
|
||||
iosClientId: '187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com',
|
||||
iosBundleId: 'br.com.freaccess.hub',
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ class FFIcons {
|
|||
static const IconData kvector1 = IconData(0xe902, fontFamily: _iconsFamily);
|
||||
|
||||
// menu
|
||||
static const IconData kiconFastPass =
|
||||
IconData(0xe900, fontFamily: _menuFamily);
|
||||
static const IconData kiconFastPass = IconData(0xe900, fontFamily: _menuFamily);
|
||||
static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily);
|
||||
static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
|
||||
|
||||
enum AnimationTrigger {
|
||||
onPageLoad,
|
||||
onActionTrigger,
|
||||
|
@ -52,12 +51,8 @@ extension AnimatedWidgetExtension on Widget {
|
|||
return Animate(
|
||||
effects: animationInfo.effects,
|
||||
child: this,
|
||||
onPlay: (controller) => animationInfo.loop
|
||||
? controller.repeat(reverse: animationInfo.reverse)
|
||||
: null,
|
||||
onComplete: (controller) => !animationInfo.loop && animationInfo.reverse
|
||||
? controller.reverse()
|
||||
: null,
|
||||
onPlay: (controller) => animationInfo.loop ? controller.repeat(reverse: animationInfo.reverse) : null,
|
||||
onComplete: (controller) => !animationInfo.loop && animationInfo.reverse ? controller.reverse() : null,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -68,11 +63,7 @@ extension AnimatedWidgetExtension on Widget {
|
|||
}) {
|
||||
animationInfo.maybeUpdateEffects(effects);
|
||||
return hasBeenTriggered || animationInfo.applyInitialState
|
||||
? Animate(
|
||||
controller: animationInfo.controller,
|
||||
autoPlay: false,
|
||||
effects: animationInfo.effects,
|
||||
child: this)
|
||||
? Animate(controller: animationInfo.controller, autoPlay: false, effects: animationInfo.effects, child: this)
|
||||
: this;
|
||||
}
|
||||
}
|
||||
|
@ -109,4 +100,4 @@ class TiltEffect extends Effect<Offset> {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,12 +6,9 @@ import 'package:flutter/gestures.dart' show DragStartBehavior;
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
|
||||
|
||||
const double _kTabHeight = 46.0;
|
||||
|
||||
typedef _LayoutCallback = void Function(
|
||||
List<double> xOffsets, TextDirection textDirection, double width);
|
||||
typedef _LayoutCallback = void Function(List<double> xOffsets, TextDirection textDirection, double width);
|
||||
|
||||
class _TabLabelBarRenderer extends RenderFlex {
|
||||
_TabLabelBarRenderer({
|
||||
|
@ -36,8 +33,7 @@ class _TabLabelBarRenderer extends RenderFlex {
|
|||
RenderBox? child = firstChild;
|
||||
final List<double> xOffsets = <double>[];
|
||||
while (child != null) {
|
||||
final FlexParentData childParentData =
|
||||
child.parentData! as FlexParentData;
|
||||
final FlexParentData childParentData = child.parentData! as FlexParentData;
|
||||
xOffsets.add(childParentData.offset.dx);
|
||||
assert(child.parentData == childParentData);
|
||||
child = childParentData.nextSibling;
|
||||
|
@ -86,8 +82,7 @@ class _TabLabelBar extends Flex {
|
|||
}
|
||||
|
||||
@override
|
||||
void updateRenderObject(
|
||||
BuildContext context, _TabLabelBarRenderer renderObject) {
|
||||
void updateRenderObject(BuildContext context, _TabLabelBarRenderer renderObject) {
|
||||
super.updateRenderObject(context, renderObject);
|
||||
renderObject.onPerformLayout = onPerformLayout;
|
||||
}
|
||||
|
@ -138,8 +133,7 @@ class _IndicatorPainter extends CustomPainter {
|
|||
assert(_currentTabOffsets!.isNotEmpty);
|
||||
assert(tabIndex >= 0);
|
||||
assert(tabIndex <= maxTabIndex);
|
||||
return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) /
|
||||
2.0;
|
||||
return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) / 2.0;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -194,12 +188,10 @@ class _TabBarScrollPosition extends ScrollPositionWithSingleContext {
|
|||
// ballistic scroll activity.
|
||||
if (!_viewportDimensionWasNonZero || _needsPixelsCorrection) {
|
||||
_needsPixelsCorrection = false;
|
||||
correctPixels(tabBar._initialScrollOffset(
|
||||
viewportDimension, minScrollExtent, maxScrollExtent));
|
||||
correctPixels(tabBar._initialScrollOffset(viewportDimension, minScrollExtent, maxScrollExtent));
|
||||
result = false;
|
||||
}
|
||||
return super.applyContentDimensions(minScrollExtent, maxScrollExtent) &&
|
||||
result;
|
||||
return super.applyContentDimensions(minScrollExtent, maxScrollExtent) && result;
|
||||
}
|
||||
|
||||
void markNeedsPixelsCorrection() {
|
||||
|
@ -215,8 +207,7 @@ class _TabBarScrollController extends ScrollController {
|
|||
final _FlutterFlowButtonTabBarState tabBar;
|
||||
|
||||
@override
|
||||
ScrollPosition createScrollPosition(ScrollPhysics physics,
|
||||
ScrollContext context, ScrollPosition? oldPosition) {
|
||||
ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) {
|
||||
return _TabBarScrollPosition(
|
||||
physics: physics,
|
||||
context: context,
|
||||
|
@ -227,8 +218,7 @@ class _TabBarScrollController extends ScrollController {
|
|||
}
|
||||
|
||||
/// A Flutterflow Design widget that displays a horizontal row of tabs.
|
||||
class FlutterFlowButtonTabBar extends StatefulWidget
|
||||
implements PreferredSizeWidget {
|
||||
class FlutterFlowButtonTabBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
/// The [tabs] argument must not be null and its length must match the [controller]'s
|
||||
/// [TabController.length].
|
||||
///
|
||||
|
@ -362,17 +352,14 @@ class FlutterFlowButtonTabBar extends StatefulWidget
|
|||
maxHeight = math.max(itemHeight, maxHeight);
|
||||
}
|
||||
}
|
||||
return Size.fromHeight(
|
||||
maxHeight + labelPadding.vertical + buttonMargin.vertical);
|
||||
return Size.fromHeight(maxHeight + labelPadding.vertical + buttonMargin.vertical);
|
||||
}
|
||||
|
||||
@override
|
||||
State<FlutterFlowButtonTabBar> createState() =>
|
||||
_FlutterFlowButtonTabBarState();
|
||||
State<FlutterFlowButtonTabBar> createState() => _FlutterFlowButtonTabBarState();
|
||||
}
|
||||
|
||||
class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||
with TickerProviderStateMixin {
|
||||
class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar> with TickerProviderStateMixin {
|
||||
ScrollController? _scrollController;
|
||||
TabController? _controller;
|
||||
_IndicatorPainter? _indicatorPainter;
|
||||
|
@ -396,8 +383,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
|
||||
/// The animation duration is 2/3 of the tab scroll animation duration in
|
||||
/// Material design (kTabScrollDuration).
|
||||
_animationController = AnimationController(
|
||||
vsync: this, duration: const Duration(milliseconds: 200));
|
||||
_animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 200));
|
||||
|
||||
// so the buttons start in their "final" state (color)
|
||||
_animationController
|
||||
|
@ -415,8 +401,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
bool get _controllerIsValid => _controller?.animation != null;
|
||||
|
||||
void _updateTabController() {
|
||||
final TabController? newController =
|
||||
widget.controller ?? DefaultTabController.maybeOf(context);
|
||||
final TabController? newController = widget.controller ?? DefaultTabController.maybeOf(context);
|
||||
assert(() {
|
||||
if (newController == null) {
|
||||
throw FlutterError(
|
||||
|
@ -501,8 +486,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
|
||||
int get maxTabIndex => _indicatorPainter!.maxTabIndex;
|
||||
|
||||
double _tabScrollOffset(
|
||||
int index, double viewportWidth, double minExtent, double maxExtent) {
|
||||
double _tabScrollOffset(int index, double viewportWidth, double minExtent, double maxExtent) {
|
||||
if (!widget.isScrollable) {
|
||||
return 0.0;
|
||||
}
|
||||
|
@ -518,34 +502,27 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
break;
|
||||
}
|
||||
|
||||
return clampDouble(
|
||||
tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent);
|
||||
return clampDouble(tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent);
|
||||
}
|
||||
|
||||
double _tabCenteredScrollOffset(int index) {
|
||||
final ScrollPosition position = _scrollController!.position;
|
||||
return _tabScrollOffset(index, position.viewportDimension,
|
||||
position.minScrollExtent, position.maxScrollExtent);
|
||||
return _tabScrollOffset(index, position.viewportDimension, position.minScrollExtent, position.maxScrollExtent);
|
||||
}
|
||||
|
||||
double _initialScrollOffset(
|
||||
double viewportWidth, double minExtent, double maxExtent) {
|
||||
double _initialScrollOffset(double viewportWidth, double minExtent, double maxExtent) {
|
||||
return _tabScrollOffset(_currentIndex, viewportWidth, minExtent, maxExtent);
|
||||
}
|
||||
|
||||
void _scrollToCurrentIndex() {
|
||||
final double offset = _tabCenteredScrollOffset(_currentIndex);
|
||||
_scrollController!
|
||||
.animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease);
|
||||
_scrollController!.animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease);
|
||||
}
|
||||
|
||||
void _scrollToControllerValue() {
|
||||
final double? leadingPosition =
|
||||
_currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null;
|
||||
final double? leadingPosition = _currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null;
|
||||
final double middlePosition = _tabCenteredScrollOffset(_currentIndex);
|
||||
final double? trailingPosition = _currentIndex < maxTabIndex
|
||||
? _tabCenteredScrollOffset(_currentIndex + 1)
|
||||
: null;
|
||||
final double? trailingPosition = _currentIndex < maxTabIndex ? _tabCenteredScrollOffset(_currentIndex + 1) : null;
|
||||
|
||||
final double index = _controller!.index.toDouble();
|
||||
final double value = _controller!.animation!.value;
|
||||
|
@ -557,13 +534,9 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
} else if (value == index) {
|
||||
offset = middlePosition;
|
||||
} else if (value < index) {
|
||||
offset = leadingPosition == null
|
||||
? middlePosition
|
||||
: lerpDouble(middlePosition, leadingPosition, index - value)!;
|
||||
offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value)!;
|
||||
} else {
|
||||
offset = trailingPosition == null
|
||||
? middlePosition
|
||||
: lerpDouble(middlePosition, trailingPosition, value - index)!;
|
||||
offset = trailingPosition == null ? middlePosition : lerpDouble(middlePosition, trailingPosition, value - index)!;
|
||||
}
|
||||
|
||||
_scrollController!.jumpTo(offset);
|
||||
|
@ -601,8 +574,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
}
|
||||
|
||||
// Called each time layout completes.
|
||||
void _saveTabOffsets(
|
||||
List<double> tabOffsets, TextDirection textDirection, double width) {
|
||||
void _saveTabOffsets(List<double> tabOffsets, TextDirection textDirection, double width) {
|
||||
_tabStripWidth = width;
|
||||
_indicatorPainter?.saveTabOffsets(tabOffsets, textDirection);
|
||||
}
|
||||
|
@ -626,52 +598,34 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
}
|
||||
|
||||
final TextStyle? textStyle = TextStyle.lerp(
|
||||
(widget.unselectedLabelStyle ??
|
||||
tabBarTheme.labelStyle ??
|
||||
DefaultTextStyle.of(context).style)
|
||||
.copyWith(
|
||||
(widget.unselectedLabelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith(
|
||||
color: widget.unselectedLabelColor,
|
||||
),
|
||||
(widget.labelStyle ??
|
||||
tabBarTheme.labelStyle ??
|
||||
DefaultTextStyle.of(context).style)
|
||||
.copyWith(
|
||||
(widget.labelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith(
|
||||
color: widget.labelColor,
|
||||
),
|
||||
animationValue);
|
||||
|
||||
final Color? textColor = Color.lerp(
|
||||
widget.unselectedLabelColor, widget.labelColor, animationValue);
|
||||
final Color? textColor = Color.lerp(widget.unselectedLabelColor, widget.labelColor, animationValue);
|
||||
|
||||
final Color? borderColor = Color.lerp(
|
||||
widget.unselectedBorderColor, widget.borderColor, animationValue);
|
||||
final Color? borderColor = Color.lerp(widget.unselectedBorderColor, widget.borderColor, animationValue);
|
||||
|
||||
BoxDecoration? boxDecoration = BoxDecoration.lerp(
|
||||
BoxDecoration(
|
||||
color: widget.unselectedDecoration?.color ??
|
||||
widget.unselectedBackgroundColor ??
|
||||
Colors.transparent,
|
||||
color: widget.unselectedDecoration?.color ?? widget.unselectedBackgroundColor ?? Colors.transparent,
|
||||
boxShadow: widget.unselectedDecoration?.boxShadow,
|
||||
gradient: widget.unselectedDecoration?.gradient,
|
||||
borderRadius: widget.useToggleButtonStyle
|
||||
? null
|
||||
: BorderRadius.circular(widget.borderRadius),
|
||||
borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius),
|
||||
),
|
||||
BoxDecoration(
|
||||
color: widget.decoration?.color ??
|
||||
widget.backgroundColor ??
|
||||
Colors.transparent,
|
||||
color: widget.decoration?.color ?? widget.backgroundColor ?? Colors.transparent,
|
||||
boxShadow: widget.decoration?.boxShadow,
|
||||
gradient: widget.decoration?.gradient,
|
||||
borderRadius: widget.useToggleButtonStyle
|
||||
? null
|
||||
: BorderRadius.circular(widget.borderRadius),
|
||||
borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius),
|
||||
),
|
||||
animationValue);
|
||||
|
||||
if (widget.useToggleButtonStyle &&
|
||||
widget.borderWidth > 0 &&
|
||||
boxDecoration != null) {
|
||||
if (widget.useToggleButtonStyle && widget.borderWidth > 0 && boxDecoration != null) {
|
||||
if (index == 0) {
|
||||
boxDecoration = boxDecoration.copyWith(
|
||||
border: Border(
|
||||
|
@ -705,13 +659,11 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
return Padding(
|
||||
key: _tabKeys[index],
|
||||
// padding for the buttons
|
||||
padding:
|
||||
widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin,
|
||||
padding: widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin,
|
||||
child: TextButton(
|
||||
onPressed: () => _handleTap(index),
|
||||
style: ButtonStyle(
|
||||
elevation: WidgetStateProperty.all(
|
||||
widget.useToggleButtonStyle ? 0 : widget.elevation),
|
||||
elevation: WidgetStateProperty.all(widget.useToggleButtonStyle ? 0 : widget.elevation),
|
||||
|
||||
/// give a pretty small minimum size
|
||||
minimumSize: WidgetStateProperty.all(const Size(10, 10)),
|
||||
|
@ -777,14 +729,11 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
|
||||
if (_controller!.length == 0) {
|
||||
return Container(
|
||||
height: _kTabHeight +
|
||||
widget.labelPadding.vertical +
|
||||
widget.buttonMargin.vertical,
|
||||
height: _kTabHeight + widget.labelPadding.vertical + widget.buttonMargin.vertical,
|
||||
);
|
||||
}
|
||||
|
||||
final List<Widget> wrappedTabs =
|
||||
List<Widget>.generate(widget.tabs.length, (int index) {
|
||||
final List<Widget> wrappedTabs = List<Widget>.generate(widget.tabs.length, (int index) {
|
||||
return _buildStyledTab(widget.tabs[index], index);
|
||||
});
|
||||
|
||||
|
@ -853,4 +802,4 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
|||
|
||||
return tabBar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import 'package:flutter/scheduler.dart';
|
|||
|
||||
////
|
||||
|
||||
|
||||
class FlutterFlowCheckboxGroup extends StatefulWidget {
|
||||
const FlutterFlowCheckboxGroup({
|
||||
super.key,
|
||||
|
@ -38,8 +37,7 @@ class FlutterFlowCheckboxGroup extends StatefulWidget {
|
|||
final TextStyle? unselectedTextStyle;
|
||||
|
||||
@override
|
||||
State<FlutterFlowCheckboxGroup> createState() =>
|
||||
_FlutterFlowCheckboxGroupState();
|
||||
State<FlutterFlowCheckboxGroup> createState() => _FlutterFlowCheckboxGroupState();
|
||||
}
|
||||
|
||||
class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||
|
@ -87,8 +85,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
|||
itemBuilder: (context, index) {
|
||||
final option = widget.options[index];
|
||||
final selected = selectedValues.contains(option);
|
||||
final unselectedTextStyle =
|
||||
widget.unselectedTextStyle ?? widget.textStyle;
|
||||
final unselectedTextStyle = widget.unselectedTextStyle ?? widget.textStyle;
|
||||
return Theme(
|
||||
data: ThemeData(unselectedWidgetColor: widget.checkboxBorderColor),
|
||||
child: Padding(
|
||||
|
@ -102,9 +99,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
|||
if (isSelected == null) {
|
||||
return;
|
||||
}
|
||||
isSelected
|
||||
? checkboxValues.add(option)
|
||||
: checkboxValues.remove(option);
|
||||
isSelected ? checkboxValues.add(option) : checkboxValues.remove(option);
|
||||
widget.controller.value = List.from(checkboxValues);
|
||||
setState(() {});
|
||||
}
|
||||
|
@ -112,8 +107,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
|||
activeColor: widget.activeColor,
|
||||
checkColor: widget.checkColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
widget.checkboxBorderRadius ?? BorderRadius.zero,
|
||||
borderRadius: widget.checkboxBorderRadius ?? BorderRadius.zero,
|
||||
),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
|
@ -123,8 +117,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
|||
padding: widget.labelPadding ?? EdgeInsets.zero,
|
||||
child: Text(
|
||||
widget.options[index],
|
||||
style:
|
||||
selected ? widget.textStyle : unselectedTextStyle,
|
||||
style: selected ? widget.textStyle : unselectedTextStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -134,4 +127,4 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
|||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'form_field_controller.dart';
|
||||
|
||||
|
||||
class FlutterFlowDropDown<T> extends StatefulWidget {
|
||||
const FlutterFlowDropDown({
|
||||
super.key,
|
||||
|
@ -87,13 +86,10 @@ class FlutterFlowDropDown<T> extends StatefulWidget {
|
|||
class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||
bool get isMultiSelect => widget.isMultiSelect;
|
||||
FormFieldController<T?> get controller => widget.controller!;
|
||||
FormFieldController<List<T>?> get multiSelectController =>
|
||||
widget.multiSelectController!;
|
||||
FormFieldController<List<T>?> get multiSelectController => widget.multiSelectController!;
|
||||
|
||||
T? get currentValue {
|
||||
final value = isMultiSelect
|
||||
? multiSelectController.value?.firstOrNull
|
||||
: controller.value;
|
||||
final value = isMultiSelect ? multiSelectController.value?.firstOrNull : controller.value;
|
||||
return widget.options.contains(value) ? value : null;
|
||||
}
|
||||
|
||||
|
@ -101,17 +97,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
if (!isMultiSelect || multiSelectController.value == null) {
|
||||
return {};
|
||||
}
|
||||
return widget.options
|
||||
.toSet()
|
||||
.intersection(multiSelectController.value!.toSet());
|
||||
return widget.options.toSet().intersection(multiSelectController.value!.toSet());
|
||||
}
|
||||
|
||||
Map<T, String> get optionLabels => Map.fromEntries(
|
||||
widget.options.asMap().entries.map(
|
||||
(option) => MapEntry(
|
||||
option.value,
|
||||
widget.optionLabels == null ||
|
||||
widget.optionLabels!.length < option.key + 1
|
||||
widget.optionLabels == null || widget.optionLabels!.length < option.key + 1
|
||||
? option.value.toString()
|
||||
: widget.optionLabels![option.key],
|
||||
),
|
||||
|
@ -130,8 +123,7 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
if (isMultiSelect) {
|
||||
_listener =
|
||||
() => widget.onMultiSelectChanged!(multiSelectController.value);
|
||||
_listener = () => widget.onMultiSelectChanged!(multiSelectController.value);
|
||||
multiSelectController.addListener(_listener);
|
||||
} else {
|
||||
_listener = () => widget.onChanged!(controller.value);
|
||||
|
@ -166,22 +158,16 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
),
|
||||
child: Padding(
|
||||
padding: _useDropdown2() ? EdgeInsets.zero : widget.margin,
|
||||
child: widget.hidesUnderline
|
||||
? DropdownButtonHideUnderline(child: dropdownWidget)
|
||||
: dropdownWidget,
|
||||
child: widget.hidesUnderline ? DropdownButtonHideUnderline(child: dropdownWidget) : dropdownWidget,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
bool _useDropdown2() =>
|
||||
widget.isMultiSelect ||
|
||||
widget.isSearchable ||
|
||||
!widget.isOverButton ||
|
||||
widget.maxHeight != null;
|
||||
widget.isMultiSelect || widget.isSearchable || !widget.isOverButton || widget.maxHeight != null;
|
||||
|
||||
Widget _buildDropdownWidget() =>
|
||||
_useDropdown2() ? _buildDropdown() : _buildLegacyDropdown();
|
||||
Widget _buildDropdownWidget() => _useDropdown2() ? _buildDropdown() : _buildLegacyDropdown();
|
||||
|
||||
Widget _buildLegacyDropdown() {
|
||||
return DropdownButtonFormField<T>(
|
||||
|
@ -195,20 +181,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
dropdownColor: widget.fillColor,
|
||||
focusColor: Colors.transparent,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText == null || widget.labelText!.isEmpty
|
||||
? null
|
||||
: widget.labelText,
|
||||
labelText: widget.labelText == null || widget.labelText!.isEmpty ? null : widget.labelText,
|
||||
labelStyle: widget.labelTextStyle,
|
||||
border: widget.hidesUnderline
|
||||
? InputBorder.none
|
||||
: const UnderlineInputBorder(),
|
||||
border: widget.hidesUnderline ? InputBorder.none : const UnderlineInputBorder(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Text? _createHintText() => widget.hintText != null
|
||||
? Text(widget.hintText!, style: widget.textStyle)
|
||||
: null;
|
||||
Text? _createHintText() => widget.hintText != null ? Text(widget.hintText!, style: widget.textStyle) : null;
|
||||
|
||||
List<DropdownMenuItem<T>> _createMenuItems() => widget.options
|
||||
.map(
|
||||
|
@ -229,14 +209,11 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
enabled: false,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, menuSetState) {
|
||||
final isSelected =
|
||||
multiSelectController.value?.contains(item) ?? false;
|
||||
final isSelected = multiSelectController.value?.contains(item) ?? false;
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
multiSelectController.value ??= [];
|
||||
isSelected
|
||||
? multiSelectController.value!.remove(item)
|
||||
: multiSelectController.value!.add(item);
|
||||
isSelected ? multiSelectController.value!.remove(item) : multiSelectController.value!.add(item);
|
||||
multiSelectController.update();
|
||||
// This rebuilds the StatefulWidget to update the button's text.
|
||||
setState(() {});
|
||||
|
@ -269,11 +246,9 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
.toList();
|
||||
|
||||
Widget _buildDropdown() {
|
||||
final overlayColor = WidgetStateProperty.resolveWith<Color?>((states) =>
|
||||
states.contains(WidgetState.focused) ? Colors.transparent : null);
|
||||
final iconStyleData = widget.icon != null
|
||||
? IconStyleData(icon: widget.icon!)
|
||||
: const IconStyleData();
|
||||
final overlayColor = WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) => states.contains(WidgetState.focused) ? Colors.transparent : null);
|
||||
final iconStyleData = widget.icon != null ? IconStyleData(icon: widget.icon!) : const IconStyleData();
|
||||
return DropdownButton2<T>(
|
||||
value: currentValue,
|
||||
hint: _createHintText(),
|
||||
|
@ -299,19 +274,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
maxHeight: widget.maxHeight,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
onChanged: widget.disabled
|
||||
? null
|
||||
: (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val),
|
||||
onChanged: widget.disabled ? null : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val),
|
||||
isExpanded: true,
|
||||
selectedItemBuilder: (context) => widget.options
|
||||
.map((item) => Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
isMultiSelect
|
||||
? currentValues
|
||||
.where((v) => optionLabels.containsKey(v))
|
||||
.map((v) => optionLabels[v])
|
||||
.join(', ')
|
||||
? currentValues.where((v) => optionLabels.containsKey(v)).map((v) => optionLabels[v]).join(', ')
|
||||
: optionLabels[item]!,
|
||||
style: widget.textStyle,
|
||||
maxLines: 1,
|
||||
|
@ -351,9 +321,7 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
|||
),
|
||||
),
|
||||
searchMatchFn: (item, searchValue) {
|
||||
return (optionLabels[item.value] ?? '')
|
||||
.toLowerCase()
|
||||
.contains(searchValue.toLowerCase());
|
||||
return (optionLabels[item.value] ?? '').toLowerCase().contains(searchValue.toLowerCase());
|
||||
},
|
||||
)
|
||||
: null,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
|
||||
|
||||
class FlutterFlowIconButton extends StatefulWidget {
|
||||
const FlutterFlowIconButton({
|
||||
super.key,
|
||||
|
@ -92,12 +90,10 @@ class _FlutterFlowIconButtonState extends State<FlutterFlowIconButton> {
|
|||
),
|
||||
iconColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.disabled) &&
|
||||
widget.disabledIconColor != null) {
|
||||
if (states.contains(WidgetState.disabled) && widget.disabledIconColor != null) {
|
||||
return widget.disabledIconColor;
|
||||
}
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.hoverIconColor != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.hoverIconColor != null) {
|
||||
return widget.hoverIconColor;
|
||||
}
|
||||
return iconColor;
|
||||
|
@ -105,12 +101,10 @@ class _FlutterFlowIconButtonState extends State<FlutterFlowIconButton> {
|
|||
),
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.disabled) &&
|
||||
widget.disabledColor != null) {
|
||||
if (states.contains(WidgetState.disabled) && widget.disabledColor != null) {
|
||||
return widget.disabledColor;
|
||||
}
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.hoverColor != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.hoverColor != null) {
|
||||
return widget.hoverColor;
|
||||
}
|
||||
|
||||
|
@ -169,4 +163,4 @@ class _FlutterFlowIconButtonState extends State<FlutterFlowIconButton> {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
Widget wrapWithModel<T extends FlutterFlowModel>({
|
||||
required T model,
|
||||
required Widget child,
|
||||
|
@ -112,8 +111,7 @@ class FlutterFlowDynamicModels<T extends FlutterFlowModel> {
|
|||
}
|
||||
|
||||
S? getValueAtIndex<S>(int index, S? Function(T) getValue) {
|
||||
final uniqueKey =
|
||||
_childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key;
|
||||
final uniqueKey = _childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key;
|
||||
return getValueForKey(uniqueKey, getValue);
|
||||
}
|
||||
|
||||
|
@ -163,6 +161,5 @@ T? _getDefaultValue<T>() {
|
|||
}
|
||||
|
||||
extension TextValidationExtensions on String? Function(BuildContext, String?)? {
|
||||
String? Function(String?)? asValidator(BuildContext context) =>
|
||||
this != null ? (val) => this!(context, val) : null;
|
||||
}
|
||||
String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ enum DeviceSize {
|
|||
tablet,
|
||||
desktop,
|
||||
}
|
||||
|
||||
DeviceSize getDeviceSize(BuildContext context) {
|
||||
final width = MediaQuery.sizeOf(context).width;
|
||||
if (width < 479) {
|
||||
|
@ -27,8 +28,7 @@ DeviceSize getDeviceSize(BuildContext context) {
|
|||
abstract class FlutterFlowTheme {
|
||||
static DeviceSize deviceSize = DeviceSize.mobile;
|
||||
|
||||
static Future initialize() async =>
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
static Future initialize() async => _prefs = await SharedPreferences.getInstance();
|
||||
static ThemeMode get themeMode {
|
||||
final darkMode = _prefs?.getBool(kThemeModeKey);
|
||||
return darkMode == null
|
||||
|
@ -37,14 +37,12 @@ abstract class FlutterFlowTheme {
|
|||
? ThemeMode.dark
|
||||
: ThemeMode.light;
|
||||
}
|
||||
static void saveThemeMode(ThemeMode mode) => mode == ThemeMode.system
|
||||
? _prefs?.remove(kThemeModeKey)
|
||||
: _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark);
|
||||
|
||||
static void saveThemeMode(ThemeMode mode) =>
|
||||
mode == ThemeMode.system ? _prefs?.remove(kThemeModeKey) : _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark);
|
||||
static FlutterFlowTheme of(BuildContext context) {
|
||||
deviceSize = getDeviceSize(context);
|
||||
return Theme.of(context).brightness == Brightness.dark
|
||||
? DarkModeTheme()
|
||||
: LightModeTheme();
|
||||
return Theme.of(context).brightness == Brightness.dark ? DarkModeTheme() : LightModeTheme();
|
||||
}
|
||||
|
||||
@Deprecated('Use primary instead')
|
||||
|
@ -145,6 +143,7 @@ abstract class FlutterFlowTheme {
|
|||
DeviceSize.desktop: DesktopTypography(this),
|
||||
}[deviceSize]!;
|
||||
}
|
||||
|
||||
class LightModeTheme extends FlutterFlowTheme {
|
||||
@Deprecated('Use primary instead')
|
||||
Color get primaryColor => primary;
|
||||
|
@ -178,6 +177,7 @@ class LightModeTheme extends FlutterFlowTheme {
|
|||
late Color customColor5 = const Color(0xFF979595);
|
||||
late Color customColor6 = const Color(0xFF525252);
|
||||
}
|
||||
|
||||
class DarkModeTheme extends FlutterFlowTheme {
|
||||
@Deprecated('Use primary instead')
|
||||
Color get primaryColor => primary;
|
||||
|
@ -244,6 +244,7 @@ abstract class Typography {
|
|||
String get bodySmallFamily;
|
||||
TextStyle get bodySmall;
|
||||
}
|
||||
|
||||
class MobileTypography extends Typography {
|
||||
MobileTypography(this.theme);
|
||||
|
||||
|
@ -352,8 +353,8 @@ class MobileTypography extends Typography {
|
|||
fontWeight: FontWeight.normal,
|
||||
fontSize: 12.0,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
class TabletTypography extends Typography {
|
||||
TabletTypography(this.theme);
|
||||
final FlutterFlowTheme theme;
|
||||
|
@ -462,8 +463,8 @@ class TabletTypography extends Typography {
|
|||
fontSize: 12.0,
|
||||
);
|
||||
}
|
||||
class DesktopTypography extends Typography {
|
||||
|
||||
class DesktopTypography extends Typography {
|
||||
DesktopTypography(this.theme);
|
||||
final FlutterFlowTheme theme;
|
||||
String get displayLargeFamily => 'Nunito Sans';
|
||||
|
|
|
@ -68,8 +68,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
required double iconSize,
|
||||
}) {
|
||||
final baseTheme = Theme.of(context);
|
||||
final dateTimeMaterialStateForegroundColor =
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
final dateTimeMaterialStateForegroundColor = WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.disabled)) {
|
||||
return pickerForegroundColor.withOpacity(0.60);
|
||||
}
|
||||
|
@ -82,8 +81,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
return null;
|
||||
});
|
||||
|
||||
final dateTimeMaterialStateBackgroundColor =
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
final dateTimeMaterialStateBackgroundColor = WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return selectedDateTimeBackgroundColor;
|
||||
}
|
||||
|
@ -152,8 +150,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
if (states.contains(WidgetState.hovered)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.04);
|
||||
}
|
||||
if (states.contains(WidgetState.focused) ||
|
||||
states.contains(WidgetState.pressed)) {
|
||||
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.12);
|
||||
}
|
||||
return null;
|
||||
|
@ -252,8 +249,7 @@ Theme wrapInMaterialTimePickerTheme(
|
|||
if (states.contains(WidgetState.hovered)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.04);
|
||||
}
|
||||
if (states.contains(WidgetState.focused) ||
|
||||
states.contains(WidgetState.pressed)) {
|
||||
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.12);
|
||||
}
|
||||
return null;
|
||||
|
@ -265,20 +261,14 @@ Theme wrapInMaterialTimePickerTheme(
|
|||
hourMinuteTextColor: pickerForegroundColor,
|
||||
dialHandColor: selectedDateTimeBackgroundColor,
|
||||
dialTextColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeForegroundColor
|
||||
: pickerDialForegroundColor),
|
||||
states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerDialForegroundColor),
|
||||
dayPeriodBorderSide: BorderSide(
|
||||
color: pickerForegroundColor,
|
||||
),
|
||||
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeForegroundColor
|
||||
: pickerForegroundColor),
|
||||
dayPeriodColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeBackgroundColor
|
||||
: Colors.transparent),
|
||||
states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerForegroundColor),
|
||||
dayPeriodColor: WidgetStateColor.resolveWith(
|
||||
(states) => states.contains(WidgetState.selected) ? selectedDateTimeBackgroundColor : Colors.transparent),
|
||||
entryModeIconColor: pickerForegroundColor,
|
||||
),
|
||||
),
|
||||
|
@ -361,8 +351,7 @@ String formatNumber(
|
|||
break;
|
||||
case FormatType.custom:
|
||||
final hasLocale = locale != null && locale.isNotEmpty;
|
||||
formattedValue =
|
||||
NumberFormat(format, hasLocale ? locale : null).format(value);
|
||||
formattedValue = NumberFormat(format, hasLocale ? locale : null).format(value);
|
||||
}
|
||||
|
||||
if (formattedValue.isEmpty) {
|
||||
|
@ -370,9 +359,7 @@ String formatNumber(
|
|||
}
|
||||
|
||||
if (currency != null) {
|
||||
final currencySymbol = currency.isNotEmpty
|
||||
? currency
|
||||
: NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
||||
final currencySymbol = currency.isNotEmpty ? currency : NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
||||
formattedValue = '$currencySymbol$formattedValue';
|
||||
}
|
||||
|
||||
|
@ -430,9 +417,7 @@ dynamic getJsonField(
|
|||
}
|
||||
final value = field.first.value;
|
||||
if (isForList) {
|
||||
return value is! Iterable
|
||||
? [value]
|
||||
: (value is List ? value : value.toList());
|
||||
return value is! Iterable ? [value] : (value is List ? value : value.toList());
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -453,8 +438,7 @@ bool get isWeb => kIsWeb;
|
|||
const kBreakpointSmall = 479.0;
|
||||
const kBreakpointMedium = 767.0;
|
||||
const kBreakpointLarge = 991.0;
|
||||
bool isMobileWidth(BuildContext context) =>
|
||||
MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||
bool isMobileWidth(BuildContext context) => MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||
bool responsiveVisibility({
|
||||
required BuildContext context,
|
||||
bool phone = true,
|
||||
|
@ -487,28 +471,21 @@ extension FFTextEditingControllerExt on TextEditingController? {
|
|||
}
|
||||
|
||||
extension IterableExt<T> on Iterable<T> {
|
||||
List<T> sortedList<S extends Comparable>(
|
||||
{S Function(T)? keyOf, bool desc = false}) {
|
||||
final sortedAscending = toList()
|
||||
..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
||||
List<T> sortedList<S extends Comparable>({S Function(T)? keyOf, bool desc = false}) {
|
||||
final sortedAscending = toList()..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
||||
if (desc) {
|
||||
return sortedAscending.reversed.toList();
|
||||
}
|
||||
return sortedAscending;
|
||||
}
|
||||
|
||||
List<S> mapIndexed<S>(S Function(int, T) func) => toList()
|
||||
.asMap()
|
||||
.map((index, value) => MapEntry(index, func(index, value)))
|
||||
.values
|
||||
.toList();
|
||||
List<S> mapIndexed<S>(S Function(int, T) func) =>
|
||||
toList().asMap().map((index, value) => MapEntry(index, func(index, value))).values.toList();
|
||||
}
|
||||
|
||||
void setAppLanguage(BuildContext context, String language) =>
|
||||
App.of(context).setLocale(language);
|
||||
void setAppLanguage(BuildContext context, String language) => App.of(context).setLocale(language);
|
||||
|
||||
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) =>
|
||||
App.of(context).setThemeMode(themeMode);
|
||||
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => App.of(context).setThemeMode(themeMode);
|
||||
|
||||
void showSnackbar(
|
||||
BuildContext context,
|
||||
|
@ -542,9 +519,7 @@ void showSnackbar(
|
|||
],
|
||||
),
|
||||
duration: Duration(seconds: duration),
|
||||
backgroundColor: error
|
||||
? FlutterFlowTheme.of(context).error
|
||||
: FlutterFlowTheme.of(context).success,
|
||||
backgroundColor: error ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
|
@ -553,8 +528,7 @@ void showSnackbar(
|
|||
);
|
||||
}
|
||||
|
||||
void showAlertDialog(BuildContext context, String title, String content,
|
||||
Future<void> Function() action) {
|
||||
void showAlertDialog(BuildContext context, String title, String content, Future<void> Function() action) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
@ -620,9 +594,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
|||
|
||||
extension FFStringExt on String {
|
||||
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
||||
maxChars != null && length > maxChars
|
||||
? replaceRange(maxChars, null, replacement)
|
||||
: this;
|
||||
maxChars != null && length > maxChars ? replaceRange(maxChars, null, replacement) : this;
|
||||
}
|
||||
|
||||
extension ListFilterExt<T> on Iterable<T?> {
|
||||
|
@ -631,16 +603,13 @@ extension ListFilterExt<T> on Iterable<T?> {
|
|||
|
||||
extension MapFilterExtensions<T> on Map<String, T?> {
|
||||
Map<String, T> get withoutNulls => Map.fromEntries(
|
||||
entries
|
||||
.where((e) => e.value != null)
|
||||
.map((e) => MapEntry(e.key, e.value as T)),
|
||||
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value as T)),
|
||||
);
|
||||
}
|
||||
|
||||
extension MapListContainsExt on List<dynamic> {
|
||||
bool containsMap(dynamic map) => map is Map
|
||||
? any((e) => e is Map && const DeepCollectionEquality().equals(e, map))
|
||||
: contains(map);
|
||||
bool containsMap(dynamic map) =>
|
||||
map is Map ? any((e) => e is Map && const DeepCollectionEquality().equals(e, map)) : contains(map);
|
||||
}
|
||||
|
||||
extension ListDivideExt<T extends Widget> on Iterable<T> {
|
||||
|
@ -648,23 +617,17 @@ extension ListDivideExt<T extends Widget> on Iterable<T> {
|
|||
|
||||
List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty
|
||||
? []
|
||||
: (enumerate
|
||||
.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t])
|
||||
.expand((i) => i)
|
||||
.toList()
|
||||
: (enumerate.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t]).expand((i) => i).toList()
|
||||
..removeLast());
|
||||
|
||||
List<Widget> around(Widget t) => addToStart(t).addToEnd(t);
|
||||
|
||||
List<Widget> addToStart(Widget t) =>
|
||||
enumerate.map((e) => e.value).toList()..insert(0, t);
|
||||
List<Widget> addToStart(Widget t) => enumerate.map((e) => e.value).toList()..insert(0, t);
|
||||
|
||||
List<Widget> addToEnd(Widget t) =>
|
||||
enumerate.map((e) => e.value).toList()..add(t);
|
||||
List<Widget> addToEnd(Widget t) => enumerate.map((e) => e.value).toList()..add(t);
|
||||
|
||||
List<Padding> paddingTopEach(double val) =>
|
||||
map((w) => Padding(padding: EdgeInsets.only(top: val), child: w))
|
||||
.toList();
|
||||
map((w) => Padding(padding: EdgeInsets.only(top: val), child: w)).toList();
|
||||
}
|
||||
|
||||
extension StatefulWidgetExtensions on State<StatefulWidget> {
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
|
||||
|
||||
class FFButtonOptions {
|
||||
const FFButtonOptions({
|
||||
this.textAlign,
|
||||
|
@ -75,16 +74,13 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
bool loading = false;
|
||||
|
||||
int get maxLines => widget.options.maxLines ?? 1;
|
||||
String? get text =>
|
||||
widget.options.textStyle?.fontSize == 0 ? null : widget.text;
|
||||
String? get text => widget.options.textStyle?.fontSize == 0 ? null : widget.text;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget textWidget = loading
|
||||
? SizedBox(
|
||||
width: widget.options.width == null
|
||||
? _getTextWidth(text, widget.options.textStyle, maxLines)
|
||||
: null,
|
||||
width: widget.options.width == null ? _getTextWidth(text, widget.options.textStyle, maxLines) : null,
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 23,
|
||||
|
@ -99,8 +95,7 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
)
|
||||
: AutoSizeText(
|
||||
text ?? '',
|
||||
style:
|
||||
text == null ? null : widget.options.textStyle?.withoutColor(),
|
||||
style: text == null ? null : widget.options.textStyle?.withoutColor(),
|
||||
textAlign: widget.options.textAlign,
|
||||
maxLines: maxLines,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
@ -127,29 +122,24 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
ButtonStyle style = ButtonStyle(
|
||||
shape: WidgetStateProperty.resolveWith<OutlinedBorder>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.options.hoverBorderSide != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.options.hoverBorderSide != null) {
|
||||
return RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
side: widget.options.hoverBorderSide!,
|
||||
);
|
||||
}
|
||||
return RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
side: widget.options.borderSide ?? BorderSide.none,
|
||||
);
|
||||
},
|
||||
),
|
||||
foregroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.disabled) &&
|
||||
widget.options.disabledTextColor != null) {
|
||||
if (states.contains(WidgetState.disabled) && widget.options.disabledTextColor != null) {
|
||||
return widget.options.disabledTextColor;
|
||||
}
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.options.hoverTextColor != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.options.hoverTextColor != null) {
|
||||
return widget.options.hoverTextColor;
|
||||
}
|
||||
return widget.options.textStyle?.color ?? Colors.white;
|
||||
|
@ -157,12 +147,10 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
),
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.disabled) &&
|
||||
widget.options.disabledColor != null) {
|
||||
if (states.contains(WidgetState.disabled) && widget.options.disabledColor != null) {
|
||||
return widget.options.disabledColor;
|
||||
}
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.options.hoverColor != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.options.hoverColor != null) {
|
||||
return widget.options.hoverColor;
|
||||
}
|
||||
return widget.options.color;
|
||||
|
@ -174,12 +162,11 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
}
|
||||
return widget.options.hoverColor == null ? null : Colors.transparent;
|
||||
}),
|
||||
padding: WidgetStateProperty.all(widget.options.padding ??
|
||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)),
|
||||
padding: WidgetStateProperty.all(
|
||||
widget.options.padding ?? const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)),
|
||||
elevation: WidgetStateProperty.resolveWith<double?>(
|
||||
(states) {
|
||||
if (states.contains(WidgetState.hovered) &&
|
||||
widget.options.hoverElevation != null) {
|
||||
if (states.contains(WidgetState.hovered) && widget.options.hoverElevation != null) {
|
||||
return widget.options.hoverElevation!;
|
||||
}
|
||||
return widget.options.elevation ?? 2.0;
|
||||
|
@ -203,8 +190,7 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
|||
border: Border.fromBorderSide(
|
||||
widget.options.borderSide ?? BorderSide.none,
|
||||
),
|
||||
borderRadius:
|
||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||
),
|
||||
child: IconButton(
|
||||
splashRadius: 1.0,
|
||||
|
@ -277,13 +263,12 @@ extension _WithoutColorExtension on TextStyle {
|
|||
}
|
||||
|
||||
// Slightly hacky method of getting the layout width of the provided text.
|
||||
double? _getTextWidth(String? text, TextStyle? style, int maxLines) =>
|
||||
text != null
|
||||
? (TextPainter(
|
||||
text: TextSpan(text: text, style: style),
|
||||
textDirection: TextDirection.ltr,
|
||||
maxLines: maxLines,
|
||||
)..layout())
|
||||
.size
|
||||
.width
|
||||
: null;
|
||||
double? _getTextWidth(String? text, TextStyle? style, int maxLines) => text != null
|
||||
? (TextPainter(
|
||||
text: TextSpan(text: text, style: style),
|
||||
textDirection: TextDirection.ltr,
|
||||
maxLines: maxLines,
|
||||
)..layout())
|
||||
.size
|
||||
.width
|
||||
: null;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
|
||||
|
||||
class FormFieldController<T> extends ValueNotifier<T?> {
|
||||
FormFieldController(this.initialValue) : super(initialValue);
|
||||
|
||||
|
@ -16,9 +15,8 @@ class FormFieldController<T> extends ValueNotifier<T?> {
|
|||
class FormListFieldController<T> extends FormFieldController<List<T>> {
|
||||
final List<T>? _initialListValue;
|
||||
|
||||
FormListFieldController(super.initialValue)
|
||||
: _initialListValue = List<T>.from(initialValue ?? []);
|
||||
FormListFieldController(super.initialValue) : _initialListValue = List<T>.from(initialValue ?? []);
|
||||
|
||||
@override
|
||||
void reset() => value = List<T>.from(_initialListValue ?? []);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,16 +9,13 @@ class FFLocalizations {
|
|||
|
||||
final Locale locale;
|
||||
|
||||
static FFLocalizations of(BuildContext context) =>
|
||||
Localizations.of<FFLocalizations>(context, FFLocalizations)!;
|
||||
static FFLocalizations of(BuildContext context) => Localizations.of<FFLocalizations>(context, FFLocalizations)!;
|
||||
|
||||
static List<String> languages() => ['pt', 'en'];
|
||||
|
||||
static late SharedPreferences _prefs;
|
||||
static Future initialize() async =>
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
static Future storeLocale(String locale) =>
|
||||
_prefs.setString(_kLocaleStorageKey, locale);
|
||||
static Future initialize() async => _prefs = await SharedPreferences.getInstance();
|
||||
static Future storeLocale(String locale) => _prefs.setString(_kLocaleStorageKey, locale);
|
||||
static Locale? getStoredLocale() {
|
||||
final locale = _prefs.getString(_kLocaleStorageKey);
|
||||
return locale != null && locale.isNotEmpty ? createLocale(locale) : null;
|
||||
|
@ -26,15 +23,10 @@ class FFLocalizations {
|
|||
|
||||
String get languageCode => locale.toString();
|
||||
String? get languageShortCode =>
|
||||
_languagesWithShortCode.contains(locale.toString())
|
||||
? '${locale.toString()}_short'
|
||||
: null;
|
||||
int get languageIndex => languages().contains(languageCode)
|
||||
? languages().indexOf(languageCode)
|
||||
: 0;
|
||||
_languagesWithShortCode.contains(locale.toString()) ? '${locale.toString()}_short' : null;
|
||||
int get languageIndex => languages().contains(languageCode) ? languages().indexOf(languageCode) : 0;
|
||||
|
||||
String getText(String key) =>
|
||||
(kTranslationsMap[key] ?? {})[locale.toString()] ?? '';
|
||||
String getText(String key) => (kTranslationsMap[key] ?? {})[locale.toString()] ?? '';
|
||||
|
||||
String getVariableText({
|
||||
String? ptText = '',
|
||||
|
@ -83,15 +75,12 @@ class FFLocalizationsDelegate extends LocalizationsDelegate<FFLocalizations> {
|
|||
bool isSupported(Locale locale) {
|
||||
final language = locale.toString();
|
||||
return FFLocalizations.languages().contains(
|
||||
language.endsWith('_')
|
||||
? language.substring(0, language.length - 1)
|
||||
: language,
|
||||
language.endsWith('_') ? language.substring(0, language.length - 1) : language,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<FFLocalizations> load(Locale locale) =>
|
||||
SynchronousFuture<FFLocalizations>(FFLocalizations(locale));
|
||||
Future<FFLocalizations> load(Locale locale) => SynchronousFuture<FFLocalizations>(FFLocalizations(locale));
|
||||
|
||||
@override
|
||||
bool shouldReload(FFLocalizationsDelegate old) => false;
|
||||
|
@ -1062,10 +1051,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
|||
'en': 'FORGOT YOUR PASSWORD?',
|
||||
},
|
||||
'wu2f7yzo': {
|
||||
'pt':
|
||||
'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.',
|
||||
'en':
|
||||
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
||||
'pt': 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.',
|
||||
'en': 'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
||||
},
|
||||
'mtz8l7ft': {
|
||||
'pt': 'E-mail',
|
||||
|
@ -1180,10 +1167,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
|||
'en': 'ENTER YOUR PASSWORD',
|
||||
},
|
||||
'ujodm2ci': {
|
||||
'pt':
|
||||
'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.',
|
||||
'en':
|
||||
'To generate the QR Code, enter the password registered in the application and click send.',
|
||||
'pt': 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.',
|
||||
'en': 'To generate the QR Code, enter the password registered in the application and click send.',
|
||||
},
|
||||
'rfqrdet7': {
|
||||
'pt': 'Senha',
|
||||
|
|
|
@ -12,8 +12,7 @@ class KeepAliveWidgetWrapper extends StatefulWidget {
|
|||
State<KeepAliveWidgetWrapper> createState() => _KeepAliveWidgetWrapperState();
|
||||
}
|
||||
|
||||
class _KeepAliveWidgetWrapperState extends State<KeepAliveWidgetWrapper>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
class _KeepAliveWidgetWrapperState extends State<KeepAliveWidgetWrapper> with AutomaticKeepAliveClientMixin {
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
|
@ -22,4 +21,4 @@ class _KeepAliveWidgetWrapperState extends State<KeepAliveWidgetWrapper>
|
|||
super.build(context);
|
||||
return widget.builder(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,5 @@ class LatLng {
|
|||
int get hashCode => latitude.hashCode + longitude.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(other) =>
|
||||
other is LatLng &&
|
||||
latitude == other.latitude &&
|
||||
longitude == other.longitude;
|
||||
}
|
||||
bool operator ==(other) => other is LatLng && latitude == other.latitude && longitude == other.longitude;
|
||||
}
|
||||
|
|
|
@ -88,23 +88,65 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
|||
}
|
||||
},
|
||||
),
|
||||
FFRoute(name: 'forgotPassword', path: '/forgotPassword', builder: (context, params) => ForgotPasswordScreen(key: UniqueKey(), email: params.getParam('email', ParamType.String), token: params.getParam('token', ParamType.String))),
|
||||
FFRoute(
|
||||
name: 'forgotPassword',
|
||||
path: '/forgotPassword',
|
||||
builder: (context, params) => ForgotPasswordScreen(
|
||||
key: UniqueKey(),
|
||||
email: params.getParam('email', ParamType.String),
|
||||
token: params.getParam('token', ParamType.String))),
|
||||
FFRoute(name: 'homePage', path: '/homePage', builder: (context, params) => HomePageWidget(key: UniqueKey())),
|
||||
FFRoute(name: 'petsOnThePropertyPage', path: '/petsOnThePropertyPage', builder: (context, params) => Scaffold(body: const PetsHistoryScreen())),
|
||||
FFRoute(name: 'vehiclesOnThePropertyPage', path: '/vehiclesOnThePropertyPage', builder: (context, params) => const VehicleOnTheProperty()),
|
||||
FFRoute(name: 'visitsOnThePropertyPage', path: '/visitsOnThePropertyPage', builder: (context, params) => const VisitsOnTheProperty()),
|
||||
FFRoute(
|
||||
name: 'petsOnThePropertyPage',
|
||||
path: '/petsOnThePropertyPage',
|
||||
builder: (context, params) => Scaffold(body: const PetsHistoryScreen())),
|
||||
FFRoute(
|
||||
name: 'vehiclesOnThePropertyPage',
|
||||
path: '/vehiclesOnThePropertyPage',
|
||||
builder: (context, params) => const VehicleOnTheProperty()),
|
||||
FFRoute(
|
||||
name: 'visitsOnThePropertyPage',
|
||||
path: '/visitsOnThePropertyPage',
|
||||
builder: (context, params) => const VisitsOnTheProperty()),
|
||||
FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()),
|
||||
FFRoute(name: 'messageHistoryPage', path: '/messageHistoryPage', builder: (context, params) => const MessageHistoryPageWidget()),
|
||||
FFRoute(name: 'registerVisitorPage', path: '/registerVisitorPage', builder: (context, params) => const RegisterVisitorPageWidget()),
|
||||
FFRoute(name: 'scheduleCompleteVisitPage', path: '/scheduleCompleteVisitPage', builder: (context, params) => const ScheduleCompleteVisitPageWidget()),
|
||||
FFRoute(name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()),
|
||||
FFRoute(name: 'provisionalSchedule', path: '/provisionalSchedule', builder: (context, params) => const ProvisionalSchedule()),
|
||||
FFRoute(name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => /*const*/ FastPassPageWidget()),
|
||||
FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => PreferencesPageWidget()),
|
||||
FFRoute(
|
||||
name: 'messageHistoryPage',
|
||||
path: '/messageHistoryPage',
|
||||
builder: (context, params) => const MessageHistoryPageWidget()),
|
||||
FFRoute(
|
||||
name: 'registerVisitorPage',
|
||||
path: '/registerVisitorPage',
|
||||
builder: (context, params) => const RegisterVisitorPageWidget()),
|
||||
FFRoute(
|
||||
name: 'scheduleCompleteVisitPage',
|
||||
path: '/scheduleCompleteVisitPage',
|
||||
builder: (context, params) => const ScheduleCompleteVisitPageWidget()),
|
||||
FFRoute(
|
||||
name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()),
|
||||
FFRoute(
|
||||
name: 'provisionalSchedule',
|
||||
path: '/provisionalSchedule',
|
||||
builder: (context, params) => const ProvisionalSchedule()),
|
||||
FFRoute(
|
||||
name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => /*const*/ FastPassPageWidget()),
|
||||
FFRoute(
|
||||
name: 'preferencesSettings',
|
||||
path: '/preferencesSettings',
|
||||
builder: (context, params) => PreferencesPageWidget()),
|
||||
FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()),
|
||||
FFRoute(name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => PeopleOnThePropertyPage()),
|
||||
FFRoute(name: 'acessHistoryPage', path: '/acessHistoryPage', builder: (context, params) => AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})),
|
||||
FFRoute(name: 'liberationHistory', path: '/liberationHistory', builder: (context, params) => const LiberationHistoryWidget()),
|
||||
FFRoute(
|
||||
name: 'peopleOnThePropertyPage',
|
||||
path: '/peopleOnThePropertyPage',
|
||||
builder: (context, params) => PeopleOnThePropertyPage()),
|
||||
FFRoute(
|
||||
name: 'acessHistoryPage',
|
||||
path: '/acessHistoryPage',
|
||||
builder: (context, params) =>
|
||||
AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})),
|
||||
FFRoute(
|
||||
name: 'liberationHistory',
|
||||
path: '/liberationHistory',
|
||||
builder: (context, params) => const LiberationHistoryWidget()),
|
||||
FFRoute(name: 'signInPage', path: '/signInPage', builder: (context, params) => const SignInPageWidget()),
|
||||
FFRoute(name: 'signUpPage', path: '/signUpPage', builder: (context, params) => const SignUpPageWidget()),
|
||||
FFRoute(name: 'welcomePage', path: '/welcomePage', builder: (context, params) => const WelcomePageWidget()),
|
||||
|
@ -146,13 +188,16 @@ extension _GoRouterStateExtensions on GoRouterState {
|
|||
..addAll(pathParameters)
|
||||
..addAll(uri.queryParameters)
|
||||
..addAll(extraMap);
|
||||
TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey) ? extraMap[kTransitionInfoKey] as TransitionInfo : TransitionInfo.appDefault();
|
||||
TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey)
|
||||
? extraMap[kTransitionInfoKey] as TransitionInfo
|
||||
: TransitionInfo.appDefault();
|
||||
}
|
||||
|
||||
extension GoRouterLocationExtension on GoRouter {
|
||||
String getCurrentLocation() {
|
||||
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
|
||||
final RouteMatchList matchList = lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration;
|
||||
final RouteMatchList matchList =
|
||||
lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration;
|
||||
return matchList.uri.toString();
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +209,8 @@ class FFParameters {
|
|||
final Map<String, Future<dynamic> Function(String)> asyncParams;
|
||||
Map<String, dynamic> futureParamValues = {};
|
||||
|
||||
bool get isEmpty => state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey));
|
||||
bool get isEmpty =>
|
||||
state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey));
|
||||
bool isAsyncParam(MapEntry<String, dynamic> param) => asyncParams.containsKey(param.key) && param.value is String;
|
||||
bool get hasFutures => state.allParams.entries.any(isAsyncParam);
|
||||
Future<bool> completeFutures() => Future.wait(
|
||||
|
@ -267,5 +313,6 @@ class RootPageContext {
|
|||
return isRootPage && location != '/' && location != rootPageContext?.errorRoute;
|
||||
}
|
||||
|
||||
static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(value: RootPageContext(true, errorRoute), child: child);
|
||||
static Widget wrap(Widget child, {String? errorRoute}) =>
|
||||
Provider.value(value: RootPageContext(true, errorRoute), child: child);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ String placeToString(FFPlace place) => jsonEncode({
|
|||
'zipCode': place.zipCode,
|
||||
});
|
||||
|
||||
String uploadedFileToString(FFUploadedFile uploadedFile) =>
|
||||
uploadedFile.serialize();
|
||||
String uploadedFileToString(FFUploadedFile uploadedFile) => uploadedFile.serialize();
|
||||
|
||||
String? serializeParam(
|
||||
dynamic param,
|
||||
|
@ -137,8 +136,7 @@ FFPlace placeFromString(String placeStr) {
|
|||
);
|
||||
}
|
||||
|
||||
FFUploadedFile uploadedFileFromString(String uploadedFileStr) =>
|
||||
FFUploadedFile.deserialize(uploadedFileStr);
|
||||
FFUploadedFile uploadedFileFromString(String uploadedFileStr) => FFUploadedFile.deserialize(uploadedFileStr);
|
||||
|
||||
enum ParamType {
|
||||
int,
|
||||
|
@ -196,9 +194,7 @@ dynamic deserializeParam<T>(
|
|||
return param == 'true';
|
||||
case ParamType.DateTime:
|
||||
final milliseconds = int.tryParse(param);
|
||||
return milliseconds != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(milliseconds)
|
||||
: null;
|
||||
return milliseconds != null ? DateTime.fromMillisecondsSinceEpoch(milliseconds) : null;
|
||||
case ParamType.DateTimeRange:
|
||||
return dateTimeRangeFromString(param);
|
||||
case ParamType.LatLng:
|
||||
|
|
|
@ -13,5 +13,4 @@ Future<bool> getPermissionStatus(Permission setting) async {
|
|||
return kPermissionStateToBool[status]!;
|
||||
}
|
||||
|
||||
Future<void> requestPermission(Permission setting) async =>
|
||||
await setting.request();
|
||||
Future<void> requestPermission(Permission setting) async => await setting.request();
|
||||
|
|
|
@ -43,4 +43,4 @@ class FFPlace {
|
|||
state == other.state &&
|
||||
country == other.country &&
|
||||
zipCode == other.zipCode;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,16 +29,14 @@ String randomString(
|
|||
if (digits) {
|
||||
chars += '0123456789';
|
||||
}
|
||||
return List.generate(randomInteger(minLength, maxLength),
|
||||
(index) => chars[_random.nextInt(chars.length)]).join();
|
||||
return List.generate(randomInteger(minLength, maxLength), (index) => chars[_random.nextInt(chars.length)]).join();
|
||||
}
|
||||
|
||||
// Random date between 1970 and 2025.
|
||||
DateTime randomDate() {
|
||||
// Random max must be in range 0 < max <= 2^32.
|
||||
// So we have to generate the time in seconds and then convert to milliseconds.
|
||||
return DateTime.fromMillisecondsSinceEpoch(
|
||||
randomInteger(0, 1735689600) * 1000);
|
||||
return DateTime.fromMillisecondsSinceEpoch(randomInteger(0, 1735689600) * 1000);
|
||||
}
|
||||
|
||||
String randomImageUrl(int width, int height) {
|
||||
|
@ -46,6 +44,5 @@ String randomImageUrl(int width, int height) {
|
|||
}
|
||||
|
||||
Color randomColor() {
|
||||
return Color.fromARGB(
|
||||
255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255));
|
||||
}
|
||||
return Color.fromARGB(255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255));
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@ class FutureRequestManager<T> {
|
|||
}
|
||||
// Remove the first cached result if we have reached the specified limit,
|
||||
// since we will be adding another.
|
||||
if (!_requests.containsKey(uniqueQueryKey) &&
|
||||
_requests.length >= cacheLimit) {
|
||||
if (!_requests.containsKey(uniqueQueryKey) && _requests.length >= cacheLimit) {
|
||||
_requests.remove(_requests.keys.first);
|
||||
}
|
||||
// Return the cached query result or set it to the new value.
|
||||
|
@ -69,9 +68,8 @@ class StreamRequestManager<T> {
|
|||
|
||||
// Create a subscription that stores the latest result in the behavior subject.
|
||||
final streamSubject = BehaviorSubject<T>();
|
||||
_requestSubscriptions[uniqueQueryKey] = requestFn()
|
||||
.asBroadcastStream()
|
||||
.listen((result) => streamSubject.add(result));
|
||||
_requestSubscriptions[uniqueQueryKey] =
|
||||
requestFn().asBroadcastStream().listen((result) => streamSubject.add(result));
|
||||
_streamSubjects[uniqueQueryKey] = streamSubject;
|
||||
|
||||
return streamSubject.stream;
|
||||
|
@ -89,5 +87,4 @@ class StreamRequestManager<T> {
|
|||
}.forEach(clearRequest);
|
||||
}
|
||||
|
||||
String _requestKey(String? key) =>
|
||||
key == null || key.isEmpty ? '__DEFAULT_KEY__' : key;
|
||||
String _requestKey(String? key) => key == null || key.isEmpty ? '__DEFAULT_KEY__' : key;
|
||||
|
|
|
@ -65,9 +65,7 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheetandFaceDetection({
|
|||
enableLandmarks: true,
|
||||
),
|
||||
);
|
||||
createUploadMediaListTile(
|
||||
String label, MediaSource mediaSource, IconData icon) =>
|
||||
ListTile(
|
||||
createUploadMediaListTile(String label, MediaSource mediaSource, IconData icon) => ListTile(
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -110,15 +108,12 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheetandFaceDetection({
|
|||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Escolha uma das opções",
|
||||
enText: "Choose one of the options"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Escolha uma das opções", enText: "Choose one of the options"),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.getFont(
|
||||
pickerFontFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText
|
||||
.withOpacity(0.65),
|
||||
color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
),
|
||||
|
@ -134,40 +129,35 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheetandFaceDetection({
|
|||
if (allowPhoto && allowVideo) ...[
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria (Foto)",
|
||||
enText: "Gallery (Photo)"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Galeria (Foto)", enText: "Gallery (Photo)"),
|
||||
MediaSource.photoGallery,
|
||||
Icons.camera),
|
||||
),
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria (Video)",
|
||||
enText: "Gallery (Video)"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Galeria (Video)", enText: "Gallery (Video)"),
|
||||
MediaSource.videoGallery,
|
||||
Icons.videocam),
|
||||
)
|
||||
] else if (allowPhoto)
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria", enText: "Gallery"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"),
|
||||
MediaSource.photoGallery,
|
||||
Icons.photo))
|
||||
else
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria", enText: "Gallery"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"),
|
||||
MediaSource.videoGallery,
|
||||
Icons.videocam),
|
||||
),
|
||||
if (!kIsWeb) ...[
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Camera", enText: "Camera"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Camera", enText: "Camera"),
|
||||
MediaSource.camera,
|
||||
Icons.camera_alt),
|
||||
)
|
||||
|
@ -186,8 +176,8 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheetandFaceDetection({
|
|||
maxWidth: maxWidth,
|
||||
maxHeight: maxHeight,
|
||||
imageQuality: imageQuality,
|
||||
isVideo: mediaSource == MediaSource.videoGallery ||
|
||||
(mediaSource == MediaSource.camera && allowVideo && !allowPhoto),
|
||||
isVideo:
|
||||
mediaSource == MediaSource.videoGallery || (mediaSource == MediaSource.camera && allowVideo && !allowPhoto),
|
||||
mediaSource: mediaSource,
|
||||
includeDimensions: includeDimensions,
|
||||
includeBlurHash: includeBlurHash,
|
||||
|
@ -202,16 +192,14 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheetandFaceDetection({
|
|||
final inputImage = InputImage.fromFilePath(media.filePath!);
|
||||
final faces = await faceDetector.processImage(inputImage);
|
||||
if (faces.isEmpty) {
|
||||
final String message = FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhuma face detectada na imagem",
|
||||
enText: "No face detected in the image");
|
||||
final String message = FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhuma face detectada na imagem", enText: "No face detected in the image");
|
||||
DialogUtil.error(context, message);
|
||||
return null;
|
||||
}
|
||||
if (faces.length > 1) {
|
||||
final String message = FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Mais de uma face detectada na imagem",
|
||||
enText: "More than one face detected in the image");
|
||||
ptText: "Mais de uma face detectada na imagem", enText: "More than one face detected in the image");
|
||||
DialogUtil.error(context, message);
|
||||
return null;
|
||||
}
|
||||
|
@ -234,9 +222,7 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
bool includeDimensions = false,
|
||||
bool includeBlurHash = false,
|
||||
}) async {
|
||||
createUploadMediaListTile(
|
||||
String label, MediaSource mediaSource, IconData icon) =>
|
||||
ListTile(
|
||||
createUploadMediaListTile(String label, MediaSource mediaSource, IconData icon) => ListTile(
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -280,15 +266,12 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Escolha uma das opções",
|
||||
enText: "Choose one of the options"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Escolha uma das opções", enText: "Choose one of the options"),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.getFont(
|
||||
pickerFontFamily,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText
|
||||
.withOpacity(0.65),
|
||||
color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
),
|
||||
|
@ -304,40 +287,35 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
if (allowPhoto && allowVideo) ...[
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria (Foto)",
|
||||
enText: "Gallery (Photo)"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Galeria (Foto)", enText: "Gallery (Photo)"),
|
||||
MediaSource.photoGallery,
|
||||
Icons.camera),
|
||||
),
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria (Video)",
|
||||
enText: "Gallery (Video)"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Galeria (Video)", enText: "Gallery (Video)"),
|
||||
MediaSource.videoGallery,
|
||||
Icons.videocam),
|
||||
)
|
||||
] else if (allowPhoto)
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria", enText: "Gallery"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"),
|
||||
MediaSource.photoGallery,
|
||||
Icons.photo))
|
||||
else
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Galeria", enText: "Gallery"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"),
|
||||
MediaSource.videoGallery,
|
||||
Icons.videocam),
|
||||
),
|
||||
if (!kIsWeb) ...[
|
||||
Expanded(
|
||||
child: createUploadMediaListTile(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Camera", enText: "Camera"),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Camera", enText: "Camera"),
|
||||
MediaSource.camera,
|
||||
Icons.camera_alt),
|
||||
)
|
||||
|
@ -356,8 +334,8 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
maxWidth: maxWidth,
|
||||
maxHeight: maxHeight,
|
||||
imageQuality: imageQuality,
|
||||
isVideo: mediaSource == MediaSource.videoGallery ||
|
||||
(mediaSource == MediaSource.camera && allowVideo && !allowPhoto),
|
||||
isVideo:
|
||||
mediaSource == MediaSource.videoGallery || (mediaSource == MediaSource.camera && allowVideo && !allowPhoto),
|
||||
mediaSource: mediaSource,
|
||||
includeDimensions: includeDimensions,
|
||||
includeBlurHash: includeBlurHash,
|
||||
|
@ -407,9 +385,7 @@ Future<List<SelectedFile>?> selectMedia({
|
|||
}));
|
||||
}
|
||||
|
||||
final source = mediaSource == MediaSource.camera
|
||||
? ImageSource.camera
|
||||
: ImageSource.gallery;
|
||||
final source = mediaSource == MediaSource.camera ? ImageSource.camera : ImageSource.gallery;
|
||||
final pickedMediaFuture = isVideo
|
||||
? picker.pickVideo(source: source)
|
||||
: picker.pickImage(
|
||||
|
@ -480,8 +456,7 @@ Future<List<SelectedFile>?> selectFiles({
|
|||
return Future.wait(pickedFiles.files.asMap().entries.map((e) async {
|
||||
final index = e.key;
|
||||
final file = e.value;
|
||||
final storagePath =
|
||||
_getStoragePath(storageFolderPath, file.name, false, index);
|
||||
final storagePath = _getStoragePath(storageFolderPath, file.name, false, index);
|
||||
return SelectedFile(
|
||||
storagePath: storagePath,
|
||||
filePath: isWeb ? null : file.path,
|
||||
|
@ -578,8 +553,7 @@ void showUploadMessage(
|
|||
padding: const EdgeInsetsDirectional.only(end: 10.0),
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: Theme.of(context).brightness == Brightness.dark
|
||||
? AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).info)
|
||||
? AlwaysStoppedAnimation<Color>(FlutterFlowTheme.of(context).info)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
|
@ -593,12 +567,10 @@ void showUploadMessage(
|
|||
topRight: Radius.circular(15),
|
||||
),
|
||||
),
|
||||
duration:
|
||||
showLoading ? const Duration(days: 1) : const Duration(seconds: 4),
|
||||
duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/')
|
||||
? path.substring(0, path.length - 1)
|
||||
: path;
|
||||
String? _removeTrailingSlash(String? path) =>
|
||||
path != null && path.endsWith('/') ? path.substring(0, path.length - 1) : path;
|
||||
|
|
|
@ -65,4 +65,4 @@ class FFUploadedFile {
|
|||
height == other.height &&
|
||||
width == other.width &&
|
||||
blurHash == other.blurHash;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
export 'pages/acess_history_page/acess_history_page_widget.dart'
|
||||
show AccessHistoryScreen;
|
||||
export 'pages/acess_history_page/acess_history_page_widget.dart' show AccessHistoryScreen;
|
||||
export 'pages/home_page/home_page_widget.dart' show HomePageWidget;
|
||||
export 'pages/liberation_history/liberation_history_widget.dart'
|
||||
show LiberationHistoryWidget;
|
||||
export 'pages/people_on_the_property_page/people_on_the_property_page_widget.dart'
|
||||
show PeopleOnThePropertyPageWidget;
|
||||
export 'pages/preferences_settings_page/preferences_settings_widget.dart'
|
||||
show PreferencesPageWidget;
|
||||
export 'pages/liberation_history/liberation_history_widget.dart' show LiberationHistoryWidget;
|
||||
export 'pages/people_on_the_property_page/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget;
|
||||
export 'pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget;
|
||||
export 'pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget;
|
||||
export 'pages/register_visitor_page/register_visitor_page_widget.dart'
|
||||
show RegisterVisitorPageWidget;
|
||||
export 'pages/register_visitor_page/register_visitor_page_widget.dart' show RegisterVisitorPageWidget;
|
||||
export 'pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'
|
||||
show ScheduleCompleteVisitPageWidget;
|
||||
export 'pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget;
|
||||
|
|
|
@ -88,7 +88,10 @@ Future<void> _foregroundHandlerMessage(RemoteMessage message) async {
|
|||
StorageUtil().context?.go('/homePage');
|
||||
}
|
||||
if (!Platform.isIOS) {
|
||||
NotificationService.show(title: message.notification!.title!, body: message.notification!.body!, payload: Map<String, String>.from(message.data));
|
||||
NotificationService.show(
|
||||
title: message.notification!.title!,
|
||||
body: message.notification!.body!,
|
||||
payload: Map<String, String>.from(message.data));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +266,8 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
||||
_appStateNotifier = AppStateNotifier.instance;
|
||||
_router = createRouter(_appStateNotifier);
|
||||
Future.delayed(const Duration(milliseconds: 1000), () => setState(() => _appStateNotifier.stopShowingSplashImage()));
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 1000), () => setState(() => _appStateNotifier.stopShowingSplashImage()));
|
||||
|
||||
_setupFirebaseMessaging();
|
||||
WidgetsBinding.instance.addPersistentFrameCallback((_) => initDeepLinks());
|
||||
|
|
|
@ -43,11 +43,15 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> with SingleTicker
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(appBar: _buildAppBar(context), backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: _buildBody(context));
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: _buildBody(context));
|
||||
}
|
||||
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
final String title = FFLocalizations.of(context).getVariableText(ptText: "Sobre a Propriedade", enText: "About the Property");
|
||||
final String title =
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Sobre a Propriedade", enText: "About the Property");
|
||||
return AppBarUtil(
|
||||
title: title,
|
||||
onBackButtonPressed: () => context.pop(),
|
||||
|
|
|
@ -24,8 +24,7 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
|||
requestFn: requestFn,
|
||||
);
|
||||
void clearAccessHistoryCache() => _accessHistoryManager.clear();
|
||||
void clearAccessHistoryCacheKey(String? uniqueKey) =>
|
||||
_accessHistoryManager.clearRequest(uniqueKey);
|
||||
void clearAccessHistoryCacheKey(String? uniqueKey) => _accessHistoryManager.clearRequest(uniqueKey);
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {
|
||||
|
|
|
@ -44,8 +44,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
late Future<void> _accessFuture;
|
||||
List<dynamic> _accessWrap = [];
|
||||
|
||||
_AccessHistoryState(Map<String, String> opt)
|
||||
: selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
||||
_AccessHistoryState(Map<String, String> opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
||||
selectedTypeSubject.listen((value) {});
|
||||
}
|
||||
|
||||
|
@ -57,8 +56,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
|
||||
_scrollController = ScrollController()
|
||||
..addListener(() {
|
||||
if (_scrollController.position.atEdge &&
|
||||
_scrollController.position.pixels != 0) {
|
||||
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) {
|
||||
_loadMoreAccess();
|
||||
}
|
||||
});
|
||||
|
@ -117,8 +115,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
color: theme.primaryText,
|
||||
fontSize: 16.0,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(theme.headlineMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -132,27 +129,24 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
child: IconButton(
|
||||
icon: const Icon(Icons.filter_list),
|
||||
onPressed: () async {
|
||||
final Map<String, String>? selectedFilter =
|
||||
await showModalBottomSheet<Map<String, String>>(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: OptModalWidget(
|
||||
defaultPersonType:
|
||||
selectedTypeSubject.value['personType'] ??
|
||||
'.*',
|
||||
),
|
||||
),
|
||||
final Map<String, String>? selectedFilter = await showModalBottomSheet<Map<String, String>>(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: OptModalWidget(
|
||||
defaultPersonType: selectedTypeSubject.value['personType'] ?? '.*',
|
||||
),
|
||||
);
|
||||
});
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
if (selectedFilter != null) {
|
||||
_updateAccessHistoryAction(selectedFilter);
|
||||
|
@ -195,8 +189,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
final List<dynamic> accessHistory = response.jsonBody['acessos'] ?? [];
|
||||
|
||||
List<dynamic> filteredAccess = accessHistory.where((item) {
|
||||
final personTypeMatches =
|
||||
_personType == '.*' || item["PES_TIPO"].toString() == _personType;
|
||||
final personTypeMatches = _personType == '.*' || item["PES_TIPO"].toString() == _personType;
|
||||
return personTypeMatches;
|
||||
}).toList();
|
||||
|
||||
|
@ -229,8 +222,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Não há mais dados.", enText: "No more data."),
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."),
|
||||
),
|
||||
duration: const Duration(seconds: 3),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -250,9 +242,8 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum histórico encontrado!",
|
||||
enText: "No history found!"),
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum histórico encontrado!", enText: "No history found!"),
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
@ -292,8 +283,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
return FutureBuilder<void>(
|
||||
future: _accessFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting &&
|
||||
_accessWrap.isEmpty) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting && _accessWrap.isEmpty) {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 50.0,
|
||||
|
@ -306,9 +296,8 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Falha ao efetuar operação!",
|
||||
enText: "Failed to perform operation!")),
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Falha ao efetuar operação!", enText: "Failed to perform operation!")),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -326,8 +315,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _accessHistoryCardMoleculeWidget(
|
||||
BuildContext context, dynamic accessHistoryItem) {
|
||||
Widget _accessHistoryCardMoleculeWidget(BuildContext context, dynamic accessHistoryItem) {
|
||||
return CardItemTemplateComponentWidget(
|
||||
imagePath:
|
||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${_model.cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
|
||||
|
|
|
@ -67,7 +67,6 @@ class _DeliveryScheduleState extends State<DeliverySchedule> {
|
|||
centerTitle: true,
|
||||
elevation: 0.0,
|
||||
),
|
||||
body: const SafeArea(
|
||||
top: true, child: ScheduleProvisionalVisitPageWidget()));
|
||||
body: const SafeArea(top: true, child: ScheduleProvisionalVisitPageWidget()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,10 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError ||
|
||||
snapshot.hasData == false ||
|
||||
snapshot.data!.isEmpty) {
|
||||
} else if (snapshot.hasError || snapshot.hasData == false || snapshot.data!.isEmpty) {
|
||||
return Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Unexpected error', ptText: 'Erro inesperado')));
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado')));
|
||||
} else if (snapshot.hasData) {
|
||||
final data = snapshot.data!;
|
||||
final url = data['url']!;
|
||||
|
@ -68,12 +66,18 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
return Platform.isIOS
|
||||
? InAppWebView(
|
||||
initialUrlRequest: URLRequest(url: WebUri(url)),
|
||||
initialSettings: InAppWebViewSettings(allowsBackForwardNavigationGestures: true, javaScriptEnabled: true,),
|
||||
initialSettings: InAppWebViewSettings(
|
||||
allowsBackForwardNavigationGestures: true,
|
||||
javaScriptEnabled: true,
|
||||
),
|
||||
onWebViewCreated: (controller) async => _controllerIOS = controller,
|
||||
onLoadStop: (controller, url) async {
|
||||
await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-token', '\"$userUUID\"')");
|
||||
await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-user-data', '$freUserData')");
|
||||
await controller.evaluateJavascript(source: "window.localStorage.setItem('enableBackButton', 'true')");
|
||||
await controller.evaluateJavascript(
|
||||
source: "window.localStorage.setItem('fre-token', '\"$userUUID\"')");
|
||||
await controller.evaluateJavascript(
|
||||
source: "window.localStorage.setItem('fre-user-data', '$freUserData')");
|
||||
await controller.evaluateJavascript(
|
||||
source: "window.localStorage.setItem('enableBackButton', 'true')");
|
||||
},
|
||||
onUpdateVisitedHistory: (controller, uri, isVisited) {
|
||||
if (uri.toString().contains('/hub/home')) context.pop();
|
||||
|
@ -89,7 +93,7 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
NavigationDelegate(
|
||||
onProgress: (int progress) {},
|
||||
onPageStarted: (String url) {
|
||||
final String token = "localStorage.setItem('fre-token', '\"$userUUID\"');";
|
||||
final String token = "localStorage.setItem('fre-token', '\"$userUUID\"');";
|
||||
final String data = "localStorage.setItem('fre-user-data', '$freUserData');";
|
||||
const String backNavigation = "localStorage.setItem('enableBackButton', 'true');";
|
||||
|
||||
|
@ -98,10 +102,8 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
_controllerAndroid.runJavaScript(backNavigation);
|
||||
},
|
||||
onPageFinished: (String url) {
|
||||
bool isDarkMode = SchedulerBinding
|
||||
.instance
|
||||
.platformDispatcher
|
||||
.platformBrightness == Brightness.dark;
|
||||
bool isDarkMode =
|
||||
SchedulerBinding.instance.platformDispatcher.platformBrightness == Brightness.dark;
|
||||
|
||||
if (isDarkMode) {
|
||||
_controllerAndroid.runJavaScript(WebviewUtil.jsEnableDarkMode);
|
||||
|
@ -111,13 +113,13 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
|||
if (request.url.startsWith('http') ||
|
||||
request.url.startsWith('https://api.whatsapp.com/send') ||
|
||||
request.url.startsWith('https://wa.me')) {
|
||||
launchUrlString(request.url);
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
launchUrlString(request.url);
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
return NavigationDecision.prevent;
|
||||
},
|
||||
onUrlChange: (url) {
|
||||
if (url.url.toString().contains('/hub/home')) context.pop();
|
||||
if (url.url.toString().contains('/hub/home')) context.pop();
|
||||
}),
|
||||
)
|
||||
..loadRequest(Uri.parse(url)),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue