Merge branch 'develop' into fd-913
This commit is contained in:
commit
a8dd29a7d0
|
@ -3,7 +3,8 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:hub/flutter_flow/random_data_util.dart';
|
import 'package:hub/flutter_flow/random_data_util.dart';
|
||||||
import 'package:hub/main.dart';
|
import 'package:hub/main.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:integration_test/integration_test.dart';
|
import 'package:integration_test/integration_test.dart';
|
||||||
|
|
||||||
late WidgetTester widget;
|
late WidgetTester widget;
|
||||||
|
@ -13,8 +14,8 @@ void main() {
|
||||||
|
|
||||||
group('Initialization', () {
|
group('Initialization', () {
|
||||||
group('Navigation', () {
|
group('Navigation', () {
|
||||||
setUpAll(() async =>
|
setUpAll(() async => await initializeApp().then(
|
||||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Welcome', (WidgetTester tester) async {
|
testWidgets('Test Welcome', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testWelcome();
|
await _testWelcome();
|
||||||
|
@ -25,16 +26,16 @@ void main() {
|
||||||
});
|
});
|
||||||
group('Authentication', () {
|
group('Authentication', () {
|
||||||
group('Sign in', () {
|
group('Sign in', () {
|
||||||
setUpAll(() async =>
|
setUpAll(() async => await initializeApp().then(
|
||||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Sign In', (WidgetTester tester) async {
|
testWidgets('Test Sign In', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testSignIn();
|
await _testSignIn();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
group('Sign up', () {
|
group('Sign up', () {
|
||||||
setUpAll(() async =>
|
setUpAll(() async => await initializeApp().then(
|
||||||
await initializeApp().then((_) => StorageUtil().isLogged = false));
|
(_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage)));
|
||||||
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
||||||
widget = tester;
|
widget = tester;
|
||||||
await _testSignUp();
|
await _testSignUp();
|
||||||
|
@ -96,14 +97,8 @@ Future<void> _testWelcome() async {
|
||||||
Future<void> _testSignIn() async {
|
Future<void> _testSignIn() async {
|
||||||
await widget.pumpWidget(const App());
|
await widget.pumpWidget(const App());
|
||||||
await _navigateToSignIn();
|
await _navigateToSignIn();
|
||||||
await _auth({
|
await _auth({'emailTextFormField': 'erro@exemplo.com', 'passwordTextFormField': '12345678'});
|
||||||
'emailTextFormField': 'erro@exemplo.com',
|
await _auth({'emailTextFormField': 'email_app@exemplo.com', 'passwordTextFormField': '12345678'});
|
||||||
'passwordTextFormField': '12345678'
|
|
||||||
});
|
|
||||||
await _auth({
|
|
||||||
'emailTextFormField': 'email_app@exemplo.com',
|
|
||||||
'passwordTextFormField': '12345678'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _testSignUp() async {
|
Future<void> _testSignUp() async {
|
||||||
|
@ -120,17 +115,10 @@ Future<void> _testSignUp() async {
|
||||||
var name = randomString(7, 7, true, true, true);
|
var name = randomString(7, 7, true, true, true);
|
||||||
var email = '$name@example.com';
|
var email = '$name@example.com';
|
||||||
var password = '12345678';
|
var password = '12345678';
|
||||||
credentials = {
|
credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password};
|
||||||
'nameTextFormField': name,
|
|
||||||
'emailTextFormField': email,
|
|
||||||
'passwordTextFormField': password
|
|
||||||
};
|
|
||||||
await _navigateToSignUp();
|
await _navigateToSignUp();
|
||||||
await _auth(credentials);
|
await _auth(credentials);
|
||||||
credentials = {
|
credentials = {'emailTextFormField': email, 'passwordTextFormField': password};
|
||||||
'emailTextFormField': email,
|
|
||||||
'passwordTextFormField': password
|
|
||||||
};
|
|
||||||
await _auth(credentials);
|
await _auth(credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,20 +140,17 @@ Future<void> _testForgotPassword() async {
|
||||||
|
|
||||||
Future<void> _recoveryPassword() async {
|
Future<void> _recoveryPassword() async {
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
final Finder forgotPassword =
|
final Finder forgotPassword = find.byKey(const ValueKey<String>('ForgotPassword'));
|
||||||
find.byKey(const ValueKey<String>('ForgotPassword'));
|
|
||||||
if (forgotPassword.evaluate().isNotEmpty) await widget.tap(forgotPassword);
|
if (forgotPassword.evaluate().isNotEmpty) await widget.tap(forgotPassword);
|
||||||
await widget.ensureVisible(forgotPassword);
|
await widget.ensureVisible(forgotPassword);
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _navigateBackUsingSystemGesture() async =>
|
Future<void> _navigateBackUsingSystemGesture() async =>
|
||||||
IntegrationTestWidgetsFlutterBinding.instance.keyboard
|
IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape);
|
||||||
.isLogicalKeyPressed(LogicalKeyboardKey.escape);
|
|
||||||
Future<void> _navigateToSignUp() async {
|
Future<void> _navigateToSignUp() async {
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
final Finder navToSignUp =
|
final Finder navToSignUp = find.byKey(const ValueKey<String>('toggleSignUpPage'));
|
||||||
find.byKey(const ValueKey<String>('toggleSignUpPage'));
|
|
||||||
if (navToSignUp.evaluate().isNotEmpty) {
|
if (navToSignUp.evaluate().isNotEmpty) {
|
||||||
await widget.tap(navToSignUp);
|
await widget.tap(navToSignUp);
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
|
@ -174,8 +159,7 @@ Future<void> _navigateToSignUp() async {
|
||||||
|
|
||||||
Future<void> _navigateToSignIn() async {
|
Future<void> _navigateToSignIn() async {
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
final Finder navToSignIn =
|
final Finder navToSignIn = find.byKey(const ValueKey<String>('toggleSignInPage'));
|
||||||
find.byKey(const ValueKey<String>('toggleSignInPage'));
|
|
||||||
expect(navToSignIn, findsOneWidget);
|
expect(navToSignIn, findsOneWidget);
|
||||||
if (navToSignIn.evaluate().isNotEmpty) {
|
if (navToSignIn.evaluate().isNotEmpty) {
|
||||||
await widget.tap(navToSignIn);
|
await widget.tap(navToSignIn);
|
||||||
|
@ -214,8 +198,7 @@ Future<void> _submit(String key) async {
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Finder throwExceptionWidget =
|
final Finder throwExceptionWidget = find.byKey(const ValueKey<String>('ThrowExceptionWidget'));
|
||||||
find.byKey(const ValueKey<String>('ThrowExceptionWidget'));
|
|
||||||
await widget.pumpAndSettle();
|
await widget.pumpAndSettle();
|
||||||
if (throwExceptionWidget.evaluate().isNotEmpty) {
|
if (throwExceptionWidget.evaluate().isNotEmpty) {
|
||||||
await widget.ensureVisible(throwExceptionWidget);
|
await widget.ensureVisible(throwExceptionWidget);
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -24,24 +28,22 @@ class PhpGroup {
|
||||||
static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall();
|
static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall();
|
||||||
static ChangePasswordCall changePasswordCall = ChangePasswordCall();
|
static ChangePasswordCall changePasswordCall = ChangePasswordCall();
|
||||||
static GetLocalsCall getLocalsCall = GetLocalsCall();
|
static GetLocalsCall getLocalsCall = GetLocalsCall();
|
||||||
static PostScheduleVisitorCall postScheduleVisitorCall =
|
static PostScheduleVisitorCall postScheduleVisitorCall = PostScheduleVisitorCall();
|
||||||
PostScheduleVisitorCall();
|
|
||||||
static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall();
|
static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall();
|
||||||
static GetScheduleVisitCall getScheduleVisitCall = GetScheduleVisitCall();
|
static GetScheduleVisitCall getScheduleVisitCall = GetScheduleVisitCall();
|
||||||
static GetDadosCall getDadosCall = GetDadosCall();
|
static GetDadosCall getDadosCall = GetDadosCall();
|
||||||
static GetVisitorByDocCall getVisitorByDocCall = GetVisitorByDocCall();
|
static GetVisitorByDocCall getVisitorByDocCall = GetVisitorByDocCall();
|
||||||
static GetFotoVisitanteCall getFotoVisitanteCall = GetFotoVisitanteCall();
|
static GetFotoVisitanteCall getFotoVisitanteCall = GetFotoVisitanteCall();
|
||||||
static PostProvVisitSchedulingCall postProvVisitSchedulingCall =
|
static PostProvVisitSchedulingCall postProvVisitSchedulingCall = PostProvVisitSchedulingCall();
|
||||||
PostProvVisitSchedulingCall();
|
|
||||||
static GetVisitsCall getVisitsCall = GetVisitsCall();
|
static GetVisitsCall getVisitsCall = GetVisitsCall();
|
||||||
static DeleteVisitCall deleteVisitCall = DeleteVisitCall();
|
static DeleteVisitCall deleteVisitCall = DeleteVisitCall();
|
||||||
static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall();
|
static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall();
|
||||||
static RespondeSolicitacaoCall respondeSolicitacaoCall =
|
static RespondeSolicitacaoCall respondeSolicitacaoCall = RespondeSolicitacaoCall();
|
||||||
RespondeSolicitacaoCall();
|
|
||||||
static GetAccessCall getAccessCall = GetAccessCall();
|
static GetAccessCall getAccessCall = GetAccessCall();
|
||||||
static GetLiberationsCall getLiberationsCall = GetLiberationsCall();
|
static GetLiberationsCall getLiberationsCall = GetLiberationsCall();
|
||||||
static GetMessagesCall getMessagesCall = GetMessagesCall();
|
static GetMessagesCall getMessagesCall = GetMessagesCall();
|
||||||
static ChangeNotifica changeNotifica = ChangeNotifica();
|
static ChangeNotifica changeNotifica = ChangeNotifica();
|
||||||
|
static UpdateIDE updateIDE = UpdateIDE();
|
||||||
static RespondeVinculo resopndeVinculo = RespondeVinculo();
|
static RespondeVinculo resopndeVinculo = RespondeVinculo();
|
||||||
static ChangePass changePass = ChangePass();
|
static ChangePass changePass = ChangePass();
|
||||||
static ChangePanic changePanic = ChangePanic();
|
static ChangePanic changePanic = ChangePanic();
|
||||||
|
@ -59,8 +61,10 @@ class PhpGroup {
|
||||||
class UnregisterDevice {
|
class UnregisterDevice {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
|
@ -87,9 +91,12 @@ class UnregisterDevice {
|
||||||
class DeletePet {
|
class DeletePet {
|
||||||
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'excluirPet';
|
const String atividade = 'excluirPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -132,9 +139,12 @@ class UpdatePet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'atualizarPet';
|
const String atividade = 'atualizarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -155,9 +165,7 @@ class UpdatePet {
|
||||||
'species': species,
|
'species': species,
|
||||||
'breed': breed,
|
'breed': breed,
|
||||||
if (color != '') 'color': color,
|
if (color != '') 'color': color,
|
||||||
if (birthdayDate != '')
|
if (birthdayDate != '') 'birthdayDate': ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
||||||
'birthdayDate':
|
|
||||||
ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
|
||||||
'gender': gender,
|
'gender': gender,
|
||||||
'size': size,
|
'size': size,
|
||||||
if (notes != '') 'notes': notes,
|
if (notes != '') 'notes': notes,
|
||||||
|
@ -174,12 +182,18 @@ class UpdatePet {
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetPets {
|
class GetPets {
|
||||||
Future<ApiCallResponse> call({final int? page, final int? pageSize,}) async {
|
Future<ApiCallResponse> call({
|
||||||
|
final int? page,
|
||||||
|
final int? pageSize,
|
||||||
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'consultaPets';
|
const String atividade = 'consultaPets';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -211,9 +225,12 @@ class GetPetPhoto {
|
||||||
Future<ApiCallResponse> call({final int? petId}) async {
|
Future<ApiCallResponse> call({final int? petId}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'consultaFotoPet';
|
const String atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -254,9 +271,12 @@ class RegisterPet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cadastrarPet';
|
const String atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -276,9 +296,7 @@ class RegisterPet {
|
||||||
'species': species,
|
'species': species,
|
||||||
'breed': breed,
|
'breed': breed,
|
||||||
if (color != '') 'color': color,
|
if (color != '') 'color': color,
|
||||||
if (birthdayDate != '')
|
if (birthdayDate != '') 'birthdayDate': ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
||||||
'birthdayDate':
|
|
||||||
ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
|
||||||
'gender': gender,
|
'gender': gender,
|
||||||
'size': size,
|
'size': size,
|
||||||
if (notes != '') 'notes': notes,
|
if (notes != '') 'notes': notes,
|
||||||
|
@ -301,9 +319,12 @@ class BuscaEnconcomendas {
|
||||||
final String? adresseeType,
|
final String? adresseeType,
|
||||||
final String? status,
|
final String? status,
|
||||||
}) async {
|
}) async {
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getEncomendas';
|
const String atividade = 'getEncomendas';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
@ -345,9 +366,12 @@ class CancelaVisita {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -379,8 +403,10 @@ class CancelaVisita {
|
||||||
|
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -411,9 +437,12 @@ class ChangePanic {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -447,9 +476,12 @@ class ChangePass {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -483,9 +515,12 @@ class RespondeVinculo {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
|
@ -517,9 +552,12 @@ class ChangeNotifica {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -547,13 +585,54 @@ class ChangeNotifica {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UpdateIDE {
|
||||||
|
Future<ApiCallResponse> call() async {
|
||||||
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
|
final String devUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String newIde =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
|
return ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'changeNotifica',
|
||||||
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
'devUUID': devUUID,
|
||||||
|
'userUUID': userUUID,
|
||||||
|
'cliID': cliUUID,
|
||||||
|
'atividade': atividade,
|
||||||
|
'newIde': newIde,
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
isStreamingApi: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class UpdToken {
|
class UpdToken {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String token = StorageUtil().token;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String token = (await StorageHelper().get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'updToken',
|
callName: 'updToken',
|
||||||
|
@ -580,12 +659,24 @@ class UpdToken {
|
||||||
class LoginCall {
|
class LoginCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String email = StorageUtil().email;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String password = StorageUtil().passwd;
|
final String email = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? '';
|
||||||
final String type = StorageUtil().deviceType;
|
final String password =
|
||||||
final String description = StorageUtil().deviceDescription;
|
(await StorageHelper().get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? '';
|
||||||
final String token = await FirebaseMessagingService.getToken();
|
final String type =
|
||||||
|
(await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||||
|
final String description =
|
||||||
|
(await StorageHelper().get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? '';
|
||||||
|
late final String token;
|
||||||
|
try {
|
||||||
|
token = await FirebaseMessagingService.getToken();
|
||||||
|
if(token == null || token.isEmpty) throw Exception('Token is empty'); }
|
||||||
|
catch (e, s) {
|
||||||
|
token = '';
|
||||||
|
log('Error getting token', error: e, stackTrace: s);
|
||||||
|
LogUtil.requestAPIFailed('login.php', email, "Login", e, s);
|
||||||
|
}
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'login',
|
callName: 'login',
|
||||||
|
@ -652,7 +743,6 @@ class RegisterCall {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class ChangePasswordCall {
|
class ChangePasswordCall {
|
||||||
Future<ApiCallResponse> call({
|
Future<ApiCallResponse> call({
|
||||||
required final String email,
|
required final String email,
|
||||||
|
@ -660,9 +750,12 @@ class ChangePasswordCall {
|
||||||
required final String psswd,
|
required final String psswd,
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePassword',
|
callName: 'changePassword',
|
||||||
|
@ -696,7 +789,6 @@ class ForgotPasswordCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'forgotPassword',
|
callName: 'forgotPassword',
|
||||||
apiUrl: '$baseUrl/iforgot.php',
|
apiUrl: '$baseUrl/iforgot.php',
|
||||||
|
@ -722,8 +814,8 @@ class GetLocalsCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID = await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
final String userUUID = StorageUtil().userUUID;
|
final String userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLocals',
|
callName: 'getLocals',
|
||||||
|
@ -762,9 +854,12 @@ class PostScheduleVisitorCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putVisitante';
|
const String atividade = 'putVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -817,9 +912,12 @@ class PostScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putVisita';
|
const String atividade = 'putVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -871,9 +969,12 @@ class GetScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1145,9 +1246,12 @@ class GetDadosCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getDados';
|
const String atividade = 'getDados';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1181,8 +1285,7 @@ class GetDadosCall {
|
||||||
response,
|
response,
|
||||||
r'''$.error_msg''',
|
r'''$.error_msg''',
|
||||||
));
|
));
|
||||||
String? visitedDesNomeStr(dynamic response) =>
|
String? visitedDesNomeStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.DES_NOME''',
|
r'''$.visitado.DES_NOME''',
|
||||||
));
|
));
|
||||||
|
@ -1190,33 +1293,27 @@ class GetDadosCall {
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_ID''',
|
r'''$.visitado.VDO_ID''',
|
||||||
));
|
));
|
||||||
String? visitedVDOTNomeStr(dynamic response) =>
|
String? visitedVDOTNomeStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_NOME''',
|
r'''$.visitado.VDO_NOME''',
|
||||||
));
|
));
|
||||||
String? visitedVDOTipoStr(dynamic response) =>
|
String? visitedVDOTipoStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_TIPO''',
|
r'''$.visitado.VDO_TIPO''',
|
||||||
));
|
));
|
||||||
String? visitedVDOImeiStr(dynamic response) =>
|
String? visitedVDOImeiStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_IMEI''',
|
r'''$.visitado.VDO_IMEI''',
|
||||||
));
|
));
|
||||||
String? visitedVDODocumentoStr(dynamic response) =>
|
String? visitedVDODocumentoStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_DOCUMENTO''',
|
r'''$.visitado.VDO_DOCUMENTO''',
|
||||||
));
|
));
|
||||||
String? visitedVDOEmailStr(dynamic response) =>
|
String? visitedVDOEmailStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_EMAIL''',
|
r'''$.visitado.VDO_EMAIL''',
|
||||||
));
|
));
|
||||||
String? visitedVDOStatusWebStr(dynamic response) =>
|
String? visitedVDOStatusWebStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_STATUSWEB''',
|
r'''$.visitado.VDO_STATUSWEB''',
|
||||||
));
|
));
|
||||||
|
@ -1264,8 +1361,7 @@ class GetDadosCall {
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.DES_ID''',
|
r'''$.visitado.DES_ID''',
|
||||||
));
|
));
|
||||||
String? visitedVDoNotTerceirosStr(dynamic response) =>
|
String? visitedVDoNotTerceirosStr(dynamic response) => castToType<String>(getJsonField(
|
||||||
castToType<String>(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.visitado.VDO_NOTTERCEIROS''',
|
r'''$.visitado.VDO_NOTTERCEIROS''',
|
||||||
));
|
));
|
||||||
|
@ -1334,8 +1430,7 @@ class GetDadosCall {
|
||||||
.map((x) => castToType<String>(x))
|
.map((x) => castToType<String>(x))
|
||||||
.withoutNulls
|
.withoutNulls
|
||||||
.toList();
|
.toList();
|
||||||
List<String>? levelNACIndPermiteReentradaStrList(dynamic response) =>
|
List<String>? levelNACIndPermiteReentradaStrList(dynamic response) => (getJsonField(
|
||||||
(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.niveis[:].NAC_INDPERMITEREENTRADA''',
|
r'''$.niveis[:].NAC_INDPERMITEREENTRADA''',
|
||||||
true,
|
true,
|
||||||
|
@ -1353,8 +1448,7 @@ class GetDadosCall {
|
||||||
.map((x) => castToType<String>(x))
|
.map((x) => castToType<String>(x))
|
||||||
.withoutNulls
|
.withoutNulls
|
||||||
.toList();
|
.toList();
|
||||||
List<String>? levelNACTempoAntiCaronaStrList(dynamic response) =>
|
List<String>? levelNACTempoAntiCaronaStrList(dynamic response) => (getJsonField(
|
||||||
(getJsonField(
|
|
||||||
response,
|
response,
|
||||||
r'''$.niveis[:].NAC_TEMPOANTICARONA''',
|
r'''$.niveis[:].NAC_TEMPOANTICARONA''',
|
||||||
true,
|
true,
|
||||||
|
@ -1388,9 +1482,12 @@ class GetVisitorByDocCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitante';
|
const String atividade = 'getVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1442,9 +1539,12 @@ class GetFotoVisitanteCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getFotoVisitante';
|
const String atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1481,9 +1581,12 @@ class PostProvVisitSchedulingCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'putAgendamentoProv';
|
const String atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1530,9 +1633,12 @@ class GetVisitsCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1793,9 +1899,12 @@ class DeleteVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1836,10 +1945,14 @@ class GetPessoasLocalCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String ownerUUID = StorageUtil().ownerUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String userUUID = StorageUtil().userUUID;
|
final String ownerUUID =
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
(await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
|
@ -1902,9 +2015,12 @@ class RespondeSolicitacaoCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'respondeSolicitacao';
|
const String atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -1944,7 +2060,6 @@ class RespondeSolicitacaoCall {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class GetAccessCall {
|
class GetAccessCall {
|
||||||
Future<ApiCallResponse> call({
|
Future<ApiCallResponse> call({
|
||||||
final String? pageSize,
|
final String? pageSize,
|
||||||
|
@ -1953,9 +2068,12 @@ class GetAccessCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getAcessos';
|
const String atividade = 'getAcessos';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
@ -2195,15 +2313,19 @@ class GetAccessCall {
|
||||||
.withoutNulls
|
.withoutNulls
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetLiberationsCall {
|
class GetLiberationsCall {
|
||||||
Stream<ApiCallResponse> call() {
|
Stream<ApiCallResponse> call() {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final StreamController<ApiCallResponse> controller = StreamController();
|
final StreamController<ApiCallResponse> controller = StreamController();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getSolicitacoes';
|
const String atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2384,6 +2506,7 @@ class GetLiberationsCall {
|
||||||
.withoutNulls
|
.withoutNulls
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetMessagesCall {
|
class GetMessagesCall {
|
||||||
Future<ApiCallResponse> call({
|
Future<ApiCallResponse> call({
|
||||||
final String? pageSize,
|
final String? pageSize,
|
||||||
|
@ -2392,9 +2515,12 @@ class GetMessagesCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = StorageUtil().devUUID;
|
final String devUUID =
|
||||||
final String userUUID = StorageUtil().userUUID;
|
(await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
final String cliUUID = StorageUtil().cliUUID;
|
final String userUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
final String cliUUID =
|
||||||
|
(await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
const String atividade = 'getMensagens';
|
const String atividade = 'getMensagens';
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
|
|
|
@ -107,9 +107,7 @@ class ApiCallResponse {
|
||||||
final Object? exception;
|
final Object? exception;
|
||||||
bool get succeeded => statusCode >= 200 && statusCode < 300;
|
bool get succeeded => statusCode >= 200 && statusCode < 300;
|
||||||
String getHeader(String headerName) => headers[headerName] ?? '';
|
String getHeader(String headerName) => headers[headerName] ?? '';
|
||||||
String get bodyText =>
|
String get bodyText => response?.body ?? (jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
||||||
response?.body ??
|
|
||||||
(jsonBody is String ? jsonBody as String : jsonEncode(jsonBody));
|
|
||||||
String get exceptionMessage => exception.toString();
|
String get exceptionMessage => exception.toString();
|
||||||
|
|
||||||
static ApiCallResponse fromHttpResponse(
|
static ApiCallResponse fromHttpResponse(
|
||||||
|
@ -123,9 +121,7 @@ class ApiCallResponse {
|
||||||
if (bodyType == BodyType.BLOB) {
|
if (bodyType == BodyType.BLOB) {
|
||||||
jsonBody = response.bodyBytes;
|
jsonBody = response.bodyBytes;
|
||||||
} else {
|
} else {
|
||||||
final responseBody = decodeUtf8 && returnBody
|
final responseBody = decodeUtf8 && returnBody ? const Utf8Decoder().convert(response.bodyBytes) : response.body;
|
||||||
? const Utf8Decoder().convert(response.bodyBytes)
|
|
||||||
: response.body;
|
|
||||||
jsonBody = returnBody ? json.decode(responseBody) : null;
|
jsonBody = returnBody ? json.decode(responseBody) : null;
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
@ -137,8 +133,7 @@ class ApiCallResponse {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ApiCallResponse fromCloudCallResponse(Map<String, dynamic> response) =>
|
static ApiCallResponse fromCloudCallResponse(Map<String, dynamic> response) => ApiCallResponse(
|
||||||
ApiCallResponse(
|
|
||||||
response['body'],
|
response['body'],
|
||||||
ApiManager.toStringMap(response['headers'] ?? {}),
|
ApiManager.toStringMap(response['headers'] ?? {}),
|
||||||
response['statusCode'] ?? 400,
|
response['statusCode'] ?? 400,
|
||||||
|
@ -155,17 +150,14 @@ class ApiManager {
|
||||||
|
|
||||||
static String? _accessToken;
|
static String? _accessToken;
|
||||||
|
|
||||||
static void clearCache(String callName) => _apiCache.keys
|
static void clearCache(String callName) =>
|
||||||
.toSet()
|
_apiCache.keys.toSet().forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
||||||
.forEach((k) => k.callName == callName ? _apiCache.remove(k) : null);
|
|
||||||
|
|
||||||
static Map<String, String> toStringMap(Map map) =>
|
static Map<String, String> toStringMap(Map map) =>
|
||||||
map.map((key, value) => MapEntry(key.toString(), value.toString()));
|
map.map((key, value) => MapEntry(key.toString(), value.toString()));
|
||||||
|
|
||||||
static String asQueryParams(Map<String, dynamic> map) => map.entries
|
static String asQueryParams(Map<String, dynamic> map) =>
|
||||||
.map((e) =>
|
map.entries.map((e) => "${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}").join('&');
|
||||||
"${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}")
|
|
||||||
.join('&');
|
|
||||||
|
|
||||||
static Future<ApiCallResponse> urlRequest(
|
static Future<ApiCallResponse> urlRequest(
|
||||||
ApiCallType callType,
|
ApiCallType callType,
|
||||||
|
@ -179,15 +171,13 @@ class ApiManager {
|
||||||
BodyType? bodyType,
|
BodyType? bodyType,
|
||||||
}) async {
|
}) async {
|
||||||
if (params.isNotEmpty) {
|
if (params.isNotEmpty) {
|
||||||
final specifier =
|
final specifier = Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?';
|
||||||
Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?';
|
|
||||||
apiUrl = '$apiUrl$specifier${asQueryParams(params)}';
|
apiUrl = '$apiUrl$specifier${asQueryParams(params)}';
|
||||||
}
|
}
|
||||||
if (isStreamingApi) {
|
if (isStreamingApi) {
|
||||||
client ??= http.Client();
|
client ??= http.Client();
|
||||||
final request =
|
final request = http.Request(callType.toString().split('.').last, Uri.parse(apiUrl))
|
||||||
http.Request(callType.toString().split('.').last, Uri.parse(apiUrl))
|
..headers.addAll(toStringMap(headers));
|
||||||
..headers.addAll(toStringMap(headers));
|
|
||||||
final streamedResponse = await getStreamedResponse(request);
|
final streamedResponse = await getStreamedResponse(request);
|
||||||
return ApiCallResponse(
|
return ApiCallResponse(
|
||||||
null,
|
null,
|
||||||
|
@ -199,10 +189,8 @@ class ApiManager {
|
||||||
final makeRequest = callType == ApiCallType.GET
|
final makeRequest = callType == ApiCallType.GET
|
||||||
? (client != null ? client.get : http.get)
|
? (client != null ? client.get : http.get)
|
||||||
: (client != null ? client.delete : http.delete);
|
: (client != null ? client.delete : http.delete);
|
||||||
final response =
|
final response = await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
||||||
await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers));
|
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||||
return ApiCallResponse.fromHttpResponse(
|
|
||||||
response, returnBody, decodeUtf8, bodyType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<ApiCallResponse> requestWithBody(
|
static Future<ApiCallResponse> requestWithBody(
|
||||||
|
@ -224,13 +212,11 @@ class ApiManager {
|
||||||
(alwaysAllowBody && type == ApiCallType.DELETE),
|
(alwaysAllowBody && type == ApiCallType.DELETE),
|
||||||
'Invalid ApiCallType $type for request with body',
|
'Invalid ApiCallType $type for request with body',
|
||||||
);
|
);
|
||||||
final postBody =
|
final postBody = createBody(headers, params, body, bodyType, encodeBodyUtf8);
|
||||||
createBody(headers, params, body, bodyType, encodeBodyUtf8);
|
|
||||||
if (isStreamingApi) {
|
if (isStreamingApi) {
|
||||||
client ??= http.Client();
|
client ??= http.Client();
|
||||||
final request =
|
final request = http.Request(type.toString().split('.').last, Uri.parse(apiUrl))
|
||||||
http.Request(type.toString().split('.').last, Uri.parse(apiUrl))
|
..headers.addAll(toStringMap(headers));
|
||||||
..headers.addAll(toStringMap(headers));
|
|
||||||
request.body = postBody;
|
request.body = postBody;
|
||||||
final streamedResponse = await getStreamedResponse(request);
|
final streamedResponse = await getStreamedResponse(request);
|
||||||
return ApiCallResponse(
|
return ApiCallResponse(
|
||||||
|
@ -242,8 +228,7 @@ class ApiManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bodyType == BodyType.MULTIPART) {
|
if (bodyType == BodyType.MULTIPART) {
|
||||||
return multipartRequest(type, apiUrl, headers, params, returnBody,
|
return multipartRequest(type, apiUrl, headers, params, returnBody, decodeUtf8, alwaysAllowBody, bodyType);
|
||||||
decodeUtf8, alwaysAllowBody, bodyType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final requestFn = {
|
final requestFn = {
|
||||||
|
@ -252,10 +237,8 @@ class ApiManager {
|
||||||
ApiCallType.PATCH: client != null ? client.patch : http.patch,
|
ApiCallType.PATCH: client != null ? client.patch : http.patch,
|
||||||
ApiCallType.DELETE: client != null ? client.delete : http.delete,
|
ApiCallType.DELETE: client != null ? client.delete : http.delete,
|
||||||
}[type]!;
|
}[type]!;
|
||||||
final response = await requestFn(Uri.parse(apiUrl),
|
final response = await requestFn(Uri.parse(apiUrl), headers: toStringMap(headers), body: postBody);
|
||||||
headers: toStringMap(headers), body: postBody);
|
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||||
return ApiCallResponse.fromHttpResponse(
|
|
||||||
response, returnBody, decodeUtf8, bodyType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<ApiCallResponse> multipartRequest(
|
static Future<ApiCallResponse> multipartRequest(
|
||||||
|
@ -275,19 +258,14 @@ class ApiManager {
|
||||||
);
|
);
|
||||||
|
|
||||||
bool isFile(dynamic e) =>
|
bool isFile(dynamic e) =>
|
||||||
e is FFUploadedFile ||
|
e is FFUploadedFile || e is List<FFUploadedFile> || (e is List && e.firstOrNull is FFUploadedFile);
|
||||||
e is List<FFUploadedFile> ||
|
|
||||||
(e is List && e.firstOrNull is FFUploadedFile);
|
|
||||||
|
|
||||||
final nonFileParams = toStringMap(
|
final nonFileParams = toStringMap(Map.fromEntries(params.entries.where((e) => !isFile(e.value))));
|
||||||
Map.fromEntries(params.entries.where((e) => !isFile(e.value))));
|
|
||||||
|
|
||||||
List<http.MultipartFile> files = [];
|
List<http.MultipartFile> files = [];
|
||||||
params.entries.where((e) => isFile(e.value)).forEach((e) {
|
params.entries.where((e) => isFile(e.value)).forEach((e) {
|
||||||
final param = e.value;
|
final param = e.value;
|
||||||
final uploadedFiles = param is List
|
final uploadedFiles = param is List ? param as List<FFUploadedFile> : [param as FFUploadedFile];
|
||||||
? param as List<FFUploadedFile>
|
|
||||||
: [param as FFUploadedFile];
|
|
||||||
for (var uploadedFile in uploadedFiles) {
|
for (var uploadedFile in uploadedFiles) {
|
||||||
files.add(
|
files.add(
|
||||||
http.MultipartFile.fromBytes(
|
http.MultipartFile.fromBytes(
|
||||||
|
@ -300,15 +278,13 @@ class ApiManager {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final request = http.MultipartRequest(
|
final request = http.MultipartRequest(type.toString().split('.').last, Uri.parse(apiUrl))
|
||||||
type.toString().split('.').last, Uri.parse(apiUrl))
|
|
||||||
..headers.addAll(toStringMap(headers))
|
..headers.addAll(toStringMap(headers))
|
||||||
..files.addAll(files);
|
..files.addAll(files);
|
||||||
nonFileParams.forEach((key, value) => request.fields[key] = value);
|
nonFileParams.forEach((key, value) => request.fields[key] = value);
|
||||||
|
|
||||||
final response = await http.Response.fromStream(await request.send());
|
final response = await http.Response.fromStream(await request.send());
|
||||||
return ApiCallResponse.fromHttpResponse(
|
return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType);
|
||||||
response, returnBody, decodeUtf8, bodyType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MediaType? _getMediaType(String? filename) {
|
static MediaType? _getMediaType(String? filename) {
|
||||||
|
@ -357,13 +333,10 @@ class ApiManager {
|
||||||
case null:
|
case null:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (contentType != null &&
|
if (contentType != null && !headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
||||||
!headers.keys.any((h) => h.toLowerCase() == 'content-type')) {
|
|
||||||
headers['Content-Type'] = contentType;
|
headers['Content-Type'] = contentType;
|
||||||
}
|
}
|
||||||
return encodeBodyUtf8 && postBody is String
|
return encodeBodyUtf8 && postBody is String ? utf8.encode(postBody) : postBody;
|
||||||
? utf8.encode(postBody)
|
|
||||||
: postBody;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ApiCallResponse> call(ApiCallOptions options) => makeApiCall(
|
Future<ApiCallResponse> call(ApiCallOptions options) => makeApiCall(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
|
|
||||||
Future<StreamedResponse> getStreamedResponse(Request request) =>
|
Future<StreamedResponse> getStreamedResponse(Request request) => Client().send(request);
|
||||||
Client().send(request);
|
|
||||||
|
|
|
@ -2,8 +2,9 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
import 'notification_service.dart';
|
import 'notification_service.dart';
|
||||||
|
|
||||||
|
@ -16,8 +17,7 @@ Future<void> handleMessage(RemoteMessage message) async {
|
||||||
|
|
||||||
class FirebaseMessagingService {
|
class FirebaseMessagingService {
|
||||||
// Singleton instance
|
// Singleton instance
|
||||||
static final FirebaseMessagingService _instance =
|
static final FirebaseMessagingService _instance = FirebaseMessagingService._internal();
|
||||||
FirebaseMessagingService._internal();
|
|
||||||
|
|
||||||
// Factory constructor
|
// Factory constructor
|
||||||
factory FirebaseMessagingService() => _instance;
|
factory FirebaseMessagingService() => _instance;
|
||||||
|
@ -36,15 +36,14 @@ class FirebaseMessagingService {
|
||||||
_firebaseMessaging.pluginConstants;
|
_firebaseMessaging.pluginConstants;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getToken() async =>
|
static Future<String> getToken() async => await FirebaseMessaging.instance.getToken() ?? '';
|
||||||
await FirebaseMessaging.instance.getToken() ?? '';
|
|
||||||
|
|
||||||
Future<void> updateDeviceToken() async {
|
Future<void> updateDeviceToken() async {
|
||||||
try {
|
try {
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
|
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
StorageUtil().token = deviceToken;
|
await StorageHelper().set(SecureStorageKey.token.value, deviceToken, Storage.SecureStorage);
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
|
|
||||||
response = await PhpGroup.updToken.call();
|
response = await PhpGroup.updToken.call();
|
||||||
|
|
|
@ -8,14 +8,15 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
Future<void> onMessageReceived(
|
Future<void> onMessageReceived(Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
||||||
Map<String, dynamic> payload, String? extra, String? handleClick) async {
|
|
||||||
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
final localId = jsonDecode(payload['local']!)['CLI_ID'];
|
||||||
|
|
||||||
final cliUUID = StorageUtil().cliUUID;
|
final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
|
||||||
answersRequest(
|
answersRequest(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
required String? ref,
|
required String? ref,
|
||||||
|
@ -42,7 +43,7 @@ Future<void> onMessageReceived(
|
||||||
switch (handleClick) {
|
switch (handleClick) {
|
||||||
case 'visit_request':
|
case 'visit_request':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageUtil().context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -62,10 +63,8 @@ Future<void> onMessageReceived(
|
||||||
enText: 'Approve Visit',
|
enText: 'Approve Visit',
|
||||||
),
|
),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Você tem certeza que deseja aprovar essa visita?',
|
||||||
'Você tem certeza que deseja aprovar essa visita?',
|
enText: 'Are you sure you want to approve this visit?',
|
||||||
enText:
|
|
||||||
'Are you sure you want to approve this visit?',
|
|
||||||
),
|
),
|
||||||
() async {
|
() async {
|
||||||
await answersRequest(
|
await answersRequest(
|
||||||
|
@ -102,10 +101,8 @@ Future<void> onMessageReceived(
|
||||||
enText: 'Block Visit',
|
enText: 'Block Visit',
|
||||||
),
|
),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Você tem certeza que deseja bloquear essa visita?',
|
||||||
'Você tem certeza que deseja bloquear essa visita?',
|
enText: 'Are you sure you want to block this visit?',
|
||||||
enText:
|
|
||||||
'Are you sure you want to block this visit?',
|
|
||||||
), () async {
|
), () async {
|
||||||
await answersRequest
|
await answersRequest
|
||||||
.call(
|
.call(
|
||||||
|
@ -165,7 +162,7 @@ Future<void> onMessageReceived(
|
||||||
break;
|
break;
|
||||||
case 'access':
|
case 'access':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageUtil().context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -186,13 +183,11 @@ Future<void> onMessageReceived(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Name',
|
enText: 'Name',
|
||||||
ptText: 'Nome',
|
ptText: 'Nome',
|
||||||
): payload['PES_NOME'].toString(),
|
): payload['PES_NOME'] != null ? payload['PES_NOME'].toString() : payload['USR_NOME'].toString(),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Type',
|
enText: 'Type',
|
||||||
ptText: 'Tipo',
|
ptText: 'Tipo',
|
||||||
): payload['USR_TIPO'].toString() == 'O'
|
): payload['USR_TIPO'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||||
? 'Morador'
|
|
||||||
: 'Visitante',
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Access Date',
|
enText: 'Access Date',
|
||||||
ptText: 'Data de Acesso',
|
ptText: 'Data de Acesso',
|
||||||
|
@ -224,7 +219,7 @@ Future<void> onMessageReceived(
|
||||||
break;
|
break;
|
||||||
case 'mensagem':
|
case 'mensagem':
|
||||||
showDialog(
|
showDialog(
|
||||||
context: StorageUtil().context!,
|
context: StorageHelper().context!,
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -235,11 +230,8 @@ Future<void> onMessageReceived(
|
||||||
child: MessageNotificationModalTemplateComponentWidget(
|
child: MessageNotificationModalTemplateComponentWidget(
|
||||||
id: localId,
|
id: localId,
|
||||||
from: payload['remetente'].toString(),
|
from: payload['remetente'].toString(),
|
||||||
to: payload['destinatario'].toString() == 'O'
|
to: payload['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||||
? 'Morador'
|
message: extra.toString().isEmpty ? 'Unknown' : extra.toString(),
|
||||||
: 'Visitante',
|
|
||||||
message:
|
|
||||||
extra.toString().isEmpty ? 'Unknown' : extra.toString(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -247,8 +239,8 @@ Future<void> onMessageReceived(
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
StorageUtil().haveLocal = true;
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage);
|
||||||
StorageUtil().context!.go('/homePage');
|
StorageHelper().context!.go('/homePage');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -274,21 +266,17 @@ class NotificationService {
|
||||||
ledColor: Colors.white,
|
ledColor: Colors.white,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
channelGroups: [
|
channelGroups: [NotificationChannelGroup(channelGroupKey: 'basic_channel_group', channelGroupName: 'group_1')],
|
||||||
NotificationChannelGroup(
|
|
||||||
channelGroupKey: 'basic_channel_group',
|
|
||||||
channelGroupName: 'group_1')
|
|
||||||
],
|
|
||||||
debug: kDebugMode);
|
debug: kDebugMode);
|
||||||
|
|
||||||
await AwesomeNotifications()
|
await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async {
|
||||||
.isNotificationAllowed()
|
final bool requestOSnotification =
|
||||||
.then((isAllowed) async {
|
(await StorageHelper().get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) ==
|
||||||
final bool requestOSnotification = StorageUtil().requestOSnotification;
|
'true';
|
||||||
|
|
||||||
if (requestOSnotification == false) {
|
if (requestOSnotification == false) {
|
||||||
if (isAllowed == false) {
|
if (isAllowed == false) {
|
||||||
StorageUtil().requestOSnotification = true;
|
await StorageHelper().set(SQLiteStorageKey.requestOSNotification.value, 'true', Storage.SQLiteStorage);
|
||||||
await AwesomeNotifications().requestPermissionToSendNotifications();
|
await AwesomeNotifications().requestPermissionToSendNotifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,22 +290,18 @@ class NotificationService {
|
||||||
onDismissActionReceivedMethod: onDismissActionReceivedMethod);
|
onDismissActionReceivedMethod: onDismissActionReceivedMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> onActionReceivedMethod(
|
static Future<void> onActionReceivedMethod(ReceivedAction receivedAction) async {
|
||||||
ReceivedAction receivedAction) async {
|
|
||||||
final payload = receivedAction.payload ?? {};
|
final payload = receivedAction.payload ?? {};
|
||||||
final extra = receivedAction.body;
|
final extra = receivedAction.body;
|
||||||
final handleClick = payload['click_action'];
|
final handleClick = payload['click_action'];
|
||||||
onMessageReceived(payload, extra, handleClick);
|
onMessageReceived(payload, extra, handleClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> onNotificationCreatedMethod(
|
static Future<void> onNotificationCreatedMethod(ReceivedNotification receivedNotification) async {}
|
||||||
ReceivedNotification receivedNotification) async {}
|
|
||||||
|
|
||||||
static Future<void> onNotificationDisplayedMethod(
|
static Future<void> onNotificationDisplayedMethod(ReceivedNotification receivedNotification) async {}
|
||||||
ReceivedNotification receivedNotification) async {}
|
|
||||||
|
|
||||||
static Future<void> onDismissActionReceivedMethod(
|
static Future<void> onDismissActionReceivedMethod(ReceivedAction receivedAction) async {}
|
||||||
ReceivedAction receivedAction) async {}
|
|
||||||
|
|
||||||
static Future<void> show({
|
static Future<void> show({
|
||||||
required final String title,
|
required final String title,
|
||||||
|
@ -351,8 +335,7 @@ class NotificationService {
|
||||||
schedule: scheduled
|
schedule: scheduled
|
||||||
? NotificationInterval(
|
? NotificationInterval(
|
||||||
interval: Duration(seconds: interval!),
|
interval: Duration(seconds: interval!),
|
||||||
timeZone:
|
timeZone: await AwesomeNotifications().getLocalTimeZoneIdentifier(),
|
||||||
await AwesomeNotifications().getLocalTimeZoneIdentifier(),
|
|
||||||
preciseAlarm: true)
|
preciseAlarm: true)
|
||||||
: null);
|
: null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,7 @@ extension FFEnumExtensions<T extends Enum> on T {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension FFEnumListExtensions<T extends Enum> on Iterable<T> {
|
extension FFEnumListExtensions<T extends Enum> on Iterable<T> {
|
||||||
T? deserialize(String? value) =>
|
T? deserialize(String? value) => firstWhereOrNull((e) => e.serialize() == value);
|
||||||
firstWhereOrNull((e) => e.serialize() == value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
T? deserializeEnum<T>(String? value) {
|
T? deserializeEnum<T>(String? value) {
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
// ignore_for_file: unnecessary_getters_setters
|
// ignore_for_file: unnecessary_getters_setters
|
||||||
|
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
|
||||||
|
|
||||||
class DeviceStruct extends BaseStruct {
|
class DeviceStruct extends BaseStruct {
|
||||||
DeviceStruct({
|
DeviceStruct({
|
||||||
String? devUUID,
|
String? devUUID,
|
||||||
|
@ -67,8 +65,7 @@ class DeviceStruct extends BaseStruct {
|
||||||
),
|
),
|
||||||
}.withoutNulls;
|
}.withoutNulls;
|
||||||
|
|
||||||
static DeviceStruct fromSerializableMap(Map<String, dynamic> data) =>
|
static DeviceStruct fromSerializableMap(Map<String, dynamic> data) => DeviceStruct(
|
||||||
DeviceStruct(
|
|
||||||
devUUID: deserializeParam(
|
devUUID: deserializeParam(
|
||||||
data['devUUID'],
|
data['devUUID'],
|
||||||
ParamType.String,
|
ParamType.String,
|
||||||
|
@ -98,8 +95,7 @@ class DeviceStruct extends BaseStruct {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => const ListEquality().hash([devUUID, version, description]);
|
||||||
const ListEquality().hash([devUUID, version, description]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceStruct createDeviceStruct({
|
DeviceStruct createDeviceStruct({
|
||||||
|
|
|
@ -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/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export 'package:collection/collection.dart' show ListEquality;
|
export 'package:collection/collection.dart' show ListEquality;
|
||||||
export 'package:flutter/material.dart' show Color, Colors;
|
export 'package:flutter/material.dart' show Color, Colors;
|
||||||
export 'package:from_css_color/from_css_color.dart';
|
export 'package:from_css_color/from_css_color.dart';
|
||||||
|
|
||||||
|
|
||||||
typedef StructBuilder<T> = T Function(Map<String, dynamic> data);
|
typedef StructBuilder<T> = T Function(Map<String, dynamic> data);
|
||||||
|
|
||||||
abstract class BaseStruct {
|
abstract class BaseStruct {
|
||||||
|
@ -39,8 +36,7 @@ dynamic deserializeStructParam<T>(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return paramValues
|
return paramValues
|
||||||
.map<T>((e) => deserializeStructParam<T>(e, paramType, false,
|
.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder))
|
||||||
structBuilder: structBuilder))
|
|
||||||
.toList();
|
.toList();
|
||||||
} else if (param is Map<String, dynamic>) {
|
} else if (param is Map<String, dynamic>) {
|
||||||
return structBuilder(param);
|
return structBuilder(param);
|
||||||
|
@ -58,16 +54,9 @@ List<T>? getStructList<T>(
|
||||||
dynamic value,
|
dynamic value,
|
||||||
StructBuilder<T> structBuilder,
|
StructBuilder<T> structBuilder,
|
||||||
) =>
|
) =>
|
||||||
value is! List
|
value is! List ? null : value.whereType<Map<String, dynamic>>().map((e) => structBuilder(e)).toList();
|
||||||
? null
|
|
||||||
: value
|
|
||||||
.whereType<Map<String, dynamic>>()
|
|
||||||
.map((e) => structBuilder(e))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
List<T>? getEnumList<T>(dynamic value) => value is! List
|
List<T>? getEnumList<T>(dynamic value) => value is! List ? null : value.map((e) => deserializeEnum<T>(e)).withoutNulls;
|
||||||
? null
|
|
||||||
: value.map((e) => deserializeEnum<T>(e)).withoutNulls;
|
|
||||||
|
|
||||||
Color? getSchemaColor(dynamic value) => value is String
|
Color? getSchemaColor(dynamic value) => value is String
|
||||||
? fromCssColor(value)
|
? fromCssColor(value)
|
||||||
|
@ -75,8 +64,6 @@ Color? getSchemaColor(dynamic value) => value is String
|
||||||
? value
|
? value
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
List<Color>? getColorsList(dynamic value) =>
|
List<Color>? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls;
|
||||||
value is! List ? null : value.map(getSchemaColor).withoutNulls;
|
|
||||||
|
|
||||||
List<T>? getDataList<T>(dynamic value) =>
|
List<T>? getDataList<T>(dynamic value) => value is! List ? null : value.map((e) => castToType<T>(e)!).toList();
|
||||||
value is! List ? null : value.map((e) => castToType<T>(e)!).toList();
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
import '../../../shared/extensions/dialog_extensions.dart';
|
import '../../../shared/extensions/dialog_extensions.dart';
|
||||||
import '../../../shared/services/localization/localization_service.dart';
|
import '../../../shared/services/localization/localization_service.dart';
|
||||||
|
@ -11,17 +9,17 @@ import '../../../shared/services/localization/localization_service.dart';
|
||||||
class MenuButtonWidget extends MenuEntry {
|
class MenuButtonWidget extends MenuEntry {
|
||||||
const MenuButtonWidget({
|
const MenuButtonWidget({
|
||||||
super.key,
|
super.key,
|
||||||
this.action,
|
required this.action,
|
||||||
this.title,
|
required this.title,
|
||||||
this.icon,
|
required this.icon,
|
||||||
});
|
}) : super(action: action, title: title, icon: icon);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Function()? action;
|
final Function() action;
|
||||||
@override
|
@override
|
||||||
final String? title;
|
final String title;
|
||||||
@override
|
@override
|
||||||
final IconData? icon;
|
final IconData icon;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
||||||
|
@ -46,20 +44,9 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
onTap: _isProcessing
|
onTap: _isProcessing
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
setState(() {
|
setState(() { _isProcessing = true; });
|
||||||
_isProcessing = true;
|
await widget.action.call();
|
||||||
});
|
setState(() { _isProcessing = false; });
|
||||||
await LocalizationService.processLocals(context)
|
|
||||||
.then((value) async {
|
|
||||||
if (value) {
|
|
||||||
await widget.action?.call();
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableCredentials(context);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
_isProcessing = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
|
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
|
||||||
|
@ -116,8 +103,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
fontSize: limitedFontSize,
|
fontSize: limitedFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -9,17 +9,17 @@ import '../../../shared/services/localization/localization_service.dart';
|
||||||
class MenuCardItem extends MenuEntry {
|
class MenuCardItem extends MenuEntry {
|
||||||
const MenuCardItem({
|
const MenuCardItem({
|
||||||
super.key,
|
super.key,
|
||||||
this.action,
|
required this.action,
|
||||||
this.title,
|
required this.title,
|
||||||
this.icon,
|
required this.icon,
|
||||||
});
|
}) : super(action: action, title: title, icon: icon);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Function()? action;
|
final Function() action;
|
||||||
@override
|
@override
|
||||||
final String? title;
|
final String title;
|
||||||
@override
|
@override
|
||||||
final IconData? icon;
|
final IconData icon;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MenuCardItemState createState() => _MenuCardItemState();
|
_MenuCardItemState createState() => _MenuCardItemState();
|
||||||
|
@ -39,20 +39,9 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
onTap: _isProcessing
|
onTap: _isProcessing
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
setState(() {
|
setState(() { _isProcessing = true; });
|
||||||
_isProcessing = true;
|
await widget.action.call();
|
||||||
});
|
setState(() { _isProcessing = false; });
|
||||||
await LocalizationService.processLocals(context)
|
|
||||||
.then((value) async {
|
|
||||||
if (value) {
|
|
||||||
await widget.action?.call();
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableCredentials(context);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
_isProcessing = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
@ -64,8 +53,7 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 10.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 10.0, 0.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30.0,
|
width: 30.0,
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
|
|
|
@ -6,12 +6,7 @@ class AtomImageSvgTheme extends StatelessWidget {
|
||||||
final double width;
|
final double width;
|
||||||
final double height;
|
final double height;
|
||||||
|
|
||||||
const AtomImageSvgTheme({
|
const AtomImageSvgTheme({super.key, required this.filename, required this.width, required this.height});
|
||||||
super.key,
|
|
||||||
required this.filename,
|
|
||||||
required this.width,
|
|
||||||
required this.height
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -21,5 +16,4 @@ class AtomImageSvgTheme extends StatelessWidget {
|
||||||
|
|
||||||
return SvgPicture.asset(path, width: width, height: height);
|
return SvgPicture.asset(path, width: width, height: height);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -66,8 +65,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
fontSize: 32.0,
|
fontSize: 32.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
|
||||||
),
|
),
|
||||||
pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
@ -90,27 +88,19 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
child!,
|
child!,
|
||||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
headerTextStyle:
|
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||||
fontFamily:
|
fontSize: 32.0,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
letterSpacing: 0.0,
|
||||||
fontSize: 32.0,
|
fontWeight: FontWeight.w600,
|
||||||
letterSpacing: 0.0,
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||||
fontWeight: FontWeight.w600,
|
),
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
|
||||||
),
|
|
||||||
pickerBackgroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
selectedDateTimeBackgroundColor:
|
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
selectedDateTimeForegroundColor:
|
pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
FlutterFlowTheme.of(context).info,
|
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
pickerDialForegroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
actionButtonForegroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
iconSize: 24.0,
|
iconSize: 24.0,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -167,8 +157,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
|
@ -178,26 +167,20 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText: widget.hintText,
|
hintText: widget.hintText,
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
lineHeight: 1.0,
|
lineHeight: 1.0,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -234,11 +217,9 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
lineHeight: 1.8,
|
lineHeight: 1.8,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -246,8 +227,7 @@ class _CustomDatePickerState extends State<CustomDatePickerUtil> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_drop_down.dart';
|
import 'package:hub/flutter_flow/flutter_flow_drop_down.dart';
|
||||||
|
@ -54,8 +53,7 @@ class _CustomSelectState extends State<CustomSelect> {
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 48.0,
|
height: 48.0,
|
||||||
|
@ -69,14 +67,11 @@ class _CustomSelectState extends State<CustomSelect> {
|
||||||
isMultiSelect: false,
|
isMultiSelect: false,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintText: widget.hintText,
|
hintText: widget.hintText,
|
||||||
|
@ -89,8 +84,7 @@ class _CustomSelectState extends State<CustomSelect> {
|
||||||
borderColor: FlutterFlowTheme.of(context).customColor6,
|
borderColor: FlutterFlowTheme.of(context).customColor6,
|
||||||
borderWidth: 0.5,
|
borderWidth: 0.5,
|
||||||
borderRadius: 10.0,
|
borderRadius: 10.0,
|
||||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
margin: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 16.0, 0.0),
|
||||||
12.0, 0.0, 16.0, 0.0),
|
|
||||||
hidesUnderline: true,
|
hidesUnderline: true,
|
||||||
isOverButton: true,
|
isOverButton: true,
|
||||||
isSearchable: false,
|
isSearchable: false,
|
||||||
|
@ -103,31 +97,24 @@ class _CustomSelectState extends State<CustomSelect> {
|
||||||
if (widget.isRequired)
|
if (widget.isRequired)
|
||||||
if (widget.dropDownValue == null || widget.dropDownValue == '')
|
if (widget.dropDownValue == null || widget.dropDownValue == '')
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||||
const EdgeInsetsDirectional.only(top: 5, start: 15),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'This field is required',
|
enText: 'This field is required',
|
||||||
ptText: 'Este campo é obrigatório',
|
ptText: 'Este campo é obrigatório',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||||
.bodySmall
|
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||||
.bodySmallFamily),
|
|
||||||
fontSize: limitedInputFontSize
|
fontSize: limitedInputFontSize
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
|
@ -8,7 +8,8 @@ class SubmitButtonUtil extends StatelessWidget {
|
||||||
final String labelText;
|
final String labelText;
|
||||||
Future Function()? onPressed;
|
Future Function()? onPressed;
|
||||||
|
|
||||||
SubmitButtonUtil({super.key,
|
SubmitButtonUtil({
|
||||||
|
super.key,
|
||||||
required this.labelText,
|
required this.labelText,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
});
|
});
|
||||||
|
@ -29,8 +30,7 @@ class SubmitButtonUtil extends StatelessWidget {
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
|
||||||
),
|
),
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -42,8 +41,7 @@ class TabViewUtil extends StatelessWidget {
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
|
||||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily),
|
||||||
FlutterFlowTheme.of(context).titleMediumFamily),
|
|
||||||
),
|
),
|
||||||
unselectedLabelStyle: const TextStyle(),
|
unselectedLabelStyle: const TextStyle(),
|
||||||
indicatorColor: FlutterFlowTheme.of(context).primary,
|
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 'text_field_component_widget.dart' show TextFieldComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class TextFieldComponentModel extends FlutterFlowModel<TextFieldComponentWidget> {
|
||||||
class TextFieldComponentModel
|
|
||||||
extends FlutterFlowModel<TextFieldComponentWidget> {
|
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
|
|
|
@ -7,7 +7,6 @@ export 'text_field_component_model.dart';
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
||||||
|
|
||||||
class TextFieldComponentWidget extends StatefulWidget {
|
class TextFieldComponentWidget extends StatefulWidget {
|
||||||
const TextFieldComponentWidget({
|
const TextFieldComponentWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -21,8 +20,7 @@ class TextFieldComponentWidget extends StatefulWidget {
|
||||||
final String? hintTextStrParam;
|
final String? hintTextStrParam;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TextFieldComponentWidget> createState() =>
|
State<TextFieldComponentWidget> createState() => _TextFieldComponentWidgetState();
|
||||||
_TextFieldComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
||||||
|
@ -39,8 +37,7 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => TextFieldComponentModel());
|
_model = createModel(context, () => TextFieldComponentModel());
|
||||||
|
|
||||||
_model.textController ??=
|
_model.textController ??= TextEditingController(text: widget.initialValueStrParam);
|
||||||
TextEditingController(text: widget.initialValueStrParam);
|
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,16 +63,14 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: widget.hintTextStrParam,
|
hintText: widget.hintTextStrParam,
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -110,8 +105,7 @@ class _TextFieldComponentWidgetState extends State<TextFieldComponentWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textControllerValidator.asValidator(context),
|
validator: _model.textControllerValidator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
|
||||||
abstract class MenuEntry extends StatefulWidget {
|
abstract class MenuEntry extends StatefulWidget {
|
||||||
const MenuEntry({
|
const MenuEntry({
|
||||||
super.key,
|
super.key,
|
||||||
this.action,
|
required this.action,
|
||||||
this.title,
|
required this.title,
|
||||||
this.icon,
|
required this.icon,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Function()? action;
|
final Function() action;
|
||||||
final String? title;
|
final String title;
|
||||||
final IconData? icon;
|
final IconData icon;
|
||||||
}
|
}
|
|
@ -18,8 +18,7 @@ class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
||||||
// State field(s) for CheckboxGroup widget.
|
// State field(s) for CheckboxGroup widget.
|
||||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||||
set checkboxGroupValues(List<String>? v) =>
|
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||||
checkboxGroupValueController?.value = v;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
|
@ -45,12 +45,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
|
||||||
selected = {
|
selected = {
|
||||||
'personType': widget.defaultPersonType == '.*'
|
'personType': widget.defaultPersonType == '.*' ? ['E', 'O'] : [widget.defaultPersonType],
|
||||||
? ['E', 'O']
|
'accessType': widget.defaultAccessType == '.*' ? ['0', '1'] : [widget.defaultAccessType],
|
||||||
: [widget.defaultPersonType],
|
|
||||||
'accessType': widget.defaultAccessType == '.*'
|
|
||||||
? ['0', '1']
|
|
||||||
: [widget.defaultAccessType],
|
|
||||||
'search': '.*',
|
'search': '.*',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -59,9 +55,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
Map<String, String> filterResult = {
|
Map<String, String> filterResult = {
|
||||||
'personType': '',
|
'personType': '',
|
||||||
'accessType': '',
|
'accessType': '',
|
||||||
'search': _model.textController?.text == ''
|
'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(),
|
||||||
? '.*'
|
|
||||||
: _model.textController!.text.toLowerCase(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (selected['personType']!.isEmpty) {
|
if (selected['personType']!.isEmpty) {
|
||||||
|
@ -102,8 +96,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -123,8 +116,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -151,8 +143,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
width: 5,
|
width: 5,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
),
|
),
|
||||||
controlAffinity:
|
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -196,24 +187,19 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||||
10.0, 10.0, 0.0, 10.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||||
.getText('yfj9pd6k'), // Filtros
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
style:
|
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||||
FlutterFlowTheme.of(context).headlineMedium.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontSize: LimitedFontSizeUtil.getHeaderFontSize(
|
||||||
.headlineMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: LimitedFontSizeUtil.getHeaderFontSize(
|
|
||||||
context),
|
context),
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||||
.headlineMediumFamily),
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -225,8 +211,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
_buildCheckboxListTile(
|
_buildCheckboxListTile('personType', personTypeOptions, 14),
|
||||||
'personType', personTypeOptions, 14),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,8 +3,6 @@ import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'opt_modal_widget.dart' show OptModalWidget;
|
import 'opt_modal_widget.dart' show OptModalWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
|
@ -19,8 +17,7 @@ class OptModalModel extends FlutterFlowModel<OptModalWidget> {
|
||||||
// State field(s) for CheckboxGroup widget.
|
// State field(s) for CheckboxGroup widget.
|
||||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||||
set checkboxGroupValues(List<String>? v) =>
|
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||||
checkboxGroupValueController?.value = v;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
|
@ -49,12 +49,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
|
||||||
selected = {
|
selected = {
|
||||||
'personType': widget.defaultPersonType == '.*'
|
'personType': widget.defaultPersonType == '.*' ? ['E', 'O'] : [widget.defaultPersonType],
|
||||||
? ['E', 'O']
|
'accessType': widget.defaultAccessType == '.*' ? ['0', '1'] : [widget.defaultAccessType],
|
||||||
: [widget.defaultPersonType],
|
|
||||||
'accessType': widget.defaultAccessType == '.*'
|
|
||||||
? ['0', '1']
|
|
||||||
: [widget.defaultAccessType],
|
|
||||||
'search': '.*',
|
'search': '.*',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -63,9 +59,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
Map<String, String> filterResult = {
|
Map<String, String> filterResult = {
|
||||||
'personType': '',
|
'personType': '',
|
||||||
'accessType': '',
|
'accessType': '',
|
||||||
'search': _model.textController?.text == ''
|
'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(),
|
||||||
? '.*'
|
|
||||||
: _model.textController!.text.toLowerCase(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (selected['personType']!.isEmpty) {
|
if (selected['personType']!.isEmpty) {
|
||||||
|
@ -96,17 +90,14 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText('l7tw8b92'),
|
FFLocalizations.of(context).getText('l7tw8b92'),
|
||||||
textAlign: TextAlign
|
textAlign: TextAlign.left, // Adiciona esta linha para alinhar o texto à esquerda
|
||||||
.left, // Adiciona esta linha para alinhar o texto à esquerda
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -124,8 +115,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -152,8 +142,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
width: 10,
|
width: 10,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
),
|
),
|
||||||
controlAffinity:
|
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -198,30 +187,23 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||||
10.0, 10.0, 0.0, 10.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||||
.getText('yfj9pd6k'), // Filtros
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
style: FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||||
.headlineMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.headlineMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||||
.headlineMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController,
|
controller: _model.textController,
|
||||||
focusNode: _model.textFieldFocusNode,
|
focusNode: _model.textFieldFocusNode,
|
||||||
|
@ -232,27 +214,19 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'0enrtljz' /* Pesquise aqui..... */,
|
'0enrtljz' /* Pesquise aqui..... */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -289,14 +263,12 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
validator:
|
validator: _model.textControllerValidator.asValidator(context),
|
||||||
_model.textControllerValidator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
|
@ -305,10 +277,8 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
_buildCheckboxListTile(
|
_buildCheckboxListTile('personType', personTypeOptions),
|
||||||
'personType', personTypeOptions),
|
_buildCheckboxListTile('accessType', accessTypeOptions),
|
||||||
_buildCheckboxListTile(
|
|
||||||
'accessType', accessTypeOptions),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -319,8 +289,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
||||||
foregroundColor: FlutterFlowTheme.of(context).info,
|
foregroundColor: FlutterFlowTheme.of(context).info,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
),
|
),
|
||||||
child:
|
child: Text(FFLocalizations.of(context).getText('88kshkph')),
|
||||||
Text(FFLocalizations.of(context).getText('88kshkph')),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
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:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class OptionSelectionModalModel
|
class OptionSelectionModalModel extends FlutterFlowModel<OptionSelectionModalWidget> {
|
||||||
extends FlutterFlowModel<OptionSelectionModalWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,10 @@ class OptionSelectionModalWidget extends StatefulWidget {
|
||||||
final List<String>? nameListStr;
|
final List<String>? nameListStr;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<OptionSelectionModalWidget> createState() =>
|
State<OptionSelectionModalWidget> createState() => _OptionSelectionModalWidgetState();
|
||||||
_OptionSelectionModalWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget> with TickerProviderStateMixin {
|
||||||
with TickerProviderStateMixin {
|
|
||||||
late OptionSelectionModalModel _model;
|
late OptionSelectionModalModel _model;
|
||||||
|
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
@ -92,17 +90,14 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
context.pop();
|
context.pop();
|
||||||
if (widget.routesListStr![optionsListIndex] ==
|
if (widget.routesListStr![optionsListIndex] == 'scheduleCompleteVisitPage') {
|
||||||
'scheduleCompleteVisitPage') {
|
|
||||||
// Navegação para a página ScheduleCompleteVisitPage com queryParameters
|
// Navegação para a página ScheduleCompleteVisitPage com queryParameters
|
||||||
context.go(
|
context.go(
|
||||||
'/scheduleCompleteVisitPage',
|
'/scheduleCompleteVisitPage',
|
||||||
extra: {
|
extra: {
|
||||||
'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss')
|
'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
|
||||||
.format(DateTime.now()),
|
'visitEndDateStr':
|
||||||
'visitEndDateStr': DateFormat('yyyy-MM-dd HH:mm:ss')
|
DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))),
|
||||||
.format(
|
|
||||||
DateTime.now().add(const Duration(days: 1))),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -149,27 +144,20 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30.0,
|
width: 30.0,
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
.primaryBackground,
|
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
alignment: const AlignmentDirectional(
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
0.0, 0.0),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
widget.iconsListIcon![
|
widget.iconsListIcon![optionsListIndex]!,
|
||||||
optionsListIndex]!,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.accent1,
|
|
||||||
size: 34.0,
|
size: 34.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -186,21 +174,16 @@ class _OptionSelectionModalWidgetState extends State<OptionSelectionModalWidget>
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.nameListStr![optionsListIndex],
|
widget.nameListStr![optionsListIndex],
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
.titleLarge
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
.containsKey('Nunito'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,10 +3,7 @@ import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'order_filter_modal_widget.dart' show OrderFilterModalWidget;
|
import 'order_filter_modal_widget.dart' show OrderFilterModalWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode;
|
FocusNode? textFieldFocusNode;
|
||||||
TextEditingController? textController;
|
TextEditingController? textController;
|
||||||
|
@ -18,8 +15,7 @@ class OrderFilterModalModel extends FlutterFlowModel<OrderFilterModalWidget> {
|
||||||
// State field(s) for CheckboxGroup widget.
|
// State field(s) for CheckboxGroup widget.
|
||||||
FormFieldController<List<String>>? checkboxGroupValueController;
|
FormFieldController<List<String>>? checkboxGroupValueController;
|
||||||
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
List<String>? get checkboxGroupValues => checkboxGroupValueController?.value;
|
||||||
set checkboxGroupValues(List<String>? v) =>
|
set checkboxGroupValues(List<String>? v) => checkboxGroupValueController?.value = v;
|
||||||
checkboxGroupValueController?.value = v;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
|
@ -4,10 +4,10 @@ import 'package:hub/components/molecular_components/order_filter_modal/order_fil
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
// ignore: unused_import
|
// ignore: unused_import
|
||||||
import 'package:hub/shared/helpers/secure_storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
class OrderFilterModalWidget extends StatefulWidget {
|
class OrderFilterModalWidget extends StatefulWidget {
|
||||||
final String defaultAdresseeType;
|
final String defaultAdresseeType;
|
||||||
|
@ -29,26 +29,25 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
late Map<String, dynamic> selected;
|
late Map<String, dynamic> selected;
|
||||||
final List<Map<String, String>> adresseeTypeOptions = [
|
final List<Map<String, String>> adresseeTypeOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageUtil().context!)
|
'title':
|
||||||
.getVariableText(enText: 'Resident', ptText: 'Morador'),
|
FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||||
'value': 'MOR'
|
'value': 'MOR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageUtil().context!)
|
'title': FFLocalizations.of(StorageHelper().context!)
|
||||||
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||||
'value': 'PRO'
|
'value': 'PRO'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
final List<Map<String, String>> statusOptions = [
|
final List<Map<String, String>> statusOptions = [
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageUtil().context!)
|
'title': FFLocalizations.of(StorageHelper().context!)
|
||||||
.getVariableText(
|
.getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||||
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
|
||||||
'value': 'notPickedUp'
|
'value': 'notPickedUp'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': FFLocalizations.of(StorageUtil().context!)
|
'title':
|
||||||
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
FFLocalizations.of(StorageHelper().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||||
'value': 'pickedUp'
|
'value': 'pickedUp'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -66,12 +65,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
_model = createModel(context, () => OrderFilterModalModel());
|
_model = createModel(context, () => OrderFilterModalModel());
|
||||||
|
|
||||||
selected = {
|
selected = {
|
||||||
'adresseeType': widget.defaultAdresseeType == '.*'
|
'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType],
|
||||||
? ['MOR', 'PRO']
|
'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus],
|
||||||
: [widget.defaultAdresseeType],
|
|
||||||
'status': widget.defaultStatus == '.*'
|
|
||||||
? ['notPickedUp', 'pickedUp']
|
|
||||||
: [widget.defaultStatus],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,8 +96,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
context.pop(filterResult);
|
context.pop(filterResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCheckboxListTile(
|
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) {
|
||||||
String key, List<Map<String, String>> options, double fontsize) {
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
@ -118,8 +112,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
fontSize: fontsize,
|
fontSize: fontsize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -139,8 +132,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: fontsize,
|
fontSize: fontsize,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -168,8 +160,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
width: 5,
|
width: 5,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
),
|
),
|
||||||
controlAffinity:
|
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
||||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -199,23 +190,18 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0),
|
||||||
10.0, 10.0, 0.0, 10.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros
|
||||||
.getText('yfj9pd6k'), // Filtros
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
style:
|
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||||
FlutterFlowTheme.of(context).headlineMedium.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontSize: 18.0,
|
||||||
.headlineMediumFamily,
|
letterSpacing: 0.0,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 18.0,
|
useGoogleFonts:
|
||||||
letterSpacing: 0.0,
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.headlineMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -2,8 +2,6 @@ import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'throw_exception_widget.dart' show ThrowExceptionWidget;
|
import 'throw_exception_widget.dart' show ThrowExceptionWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ThrowExceptionModel extends FlutterFlowModel<ThrowExceptionWidget> {
|
class ThrowExceptionModel extends FlutterFlowModel<ThrowExceptionWidget> {
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
|
@ -14,8 +14,7 @@ export 'throw_exception_model.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class ThrowExceptionWidget extends StatefulWidget {
|
class ThrowExceptionWidget extends StatefulWidget {
|
||||||
ThrowExceptionWidget(
|
ThrowExceptionWidget({super.key, required this.msg, this.type = EnumThrowException.error});
|
||||||
{super.key, required this.msg, this.type = EnumThrowException.error});
|
|
||||||
|
|
||||||
final String? msg;
|
final String? msg;
|
||||||
EnumThrowException type;
|
EnumThrowException type;
|
||||||
|
@ -24,8 +23,7 @@ class ThrowExceptionWidget extends StatefulWidget {
|
||||||
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
|
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget> with TickerProviderStateMixin {
|
||||||
with TickerProviderStateMixin {
|
|
||||||
late ThrowExceptionModel _model;
|
late ThrowExceptionModel _model;
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
|
||||||
|
@ -39,6 +37,7 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
return FlutterFlowTheme.of(context).success;
|
return FlutterFlowTheme.of(context).success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IconData _getIconByType(BuildContext context) {
|
IconData _getIconByType(BuildContext context) {
|
||||||
switch (widget.type) {
|
switch (widget.type) {
|
||||||
case EnumThrowException.error:
|
case EnumThrowException.error:
|
||||||
|
@ -49,26 +48,26 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
return Icons.check_circle_outline;
|
return Icons.check_circle_outline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _getTitleByType(BuildContext context) {
|
String _getTitleByType(BuildContext context) {
|
||||||
switch (widget.type) {
|
switch (widget.type) {
|
||||||
case EnumThrowException.error:
|
case EnumThrowException.error:
|
||||||
return FFLocalizations.of(context)
|
return FFLocalizations.of(context).getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||||
.getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
|
||||||
case EnumThrowException.warning:
|
case EnumThrowException.warning:
|
||||||
return FFLocalizations.of(context)
|
return FFLocalizations.of(context).getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||||
.getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
|
||||||
case EnumThrowException.success:
|
case EnumThrowException.success:
|
||||||
return FFLocalizations.of(context)
|
return FFLocalizations.of(context).getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||||
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
@override void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
_model.onUpdate();
|
_model.onUpdate();
|
||||||
}
|
}
|
||||||
@override void initState() {
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => ThrowExceptionModel());
|
_model = createModel(context, () => ThrowExceptionModel());
|
||||||
animationsMap.addAll({
|
animationsMap.addAll({
|
||||||
|
@ -86,7 +85,9 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@override void dispose() {
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
_model.maybeDispose();
|
_model.maybeDispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
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:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class VisitorNotFoundComponentModel
|
class VisitorNotFoundComponentModel extends FlutterFlowModel<VisitorNotFoundComponentWidget> {
|
||||||
extends FlutterFlowModel<VisitorNotFoundComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,10 @@ class VisitorNotFoundComponentWidget extends StatefulWidget {
|
||||||
|
|
||||||
final String? doc;
|
final String? doc;
|
||||||
@override
|
@override
|
||||||
State<VisitorNotFoundComponentWidget> createState() =>
|
State<VisitorNotFoundComponentWidget> createState() => _VisitorNotFoundComponentWidgetState();
|
||||||
_VisitorNotFoundComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitorNotFoundComponentWidgetState
|
class _VisitorNotFoundComponentWidgetState extends State<VisitorNotFoundComponentWidget> {
|
||||||
extends State<VisitorNotFoundComponentWidget> {
|
|
||||||
late VisitorNotFoundComponentModel _model;
|
late VisitorNotFoundComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -61,8 +59,7 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
|
@ -84,19 +81,16 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
size: 72.0,
|
size: 72.0,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'1p9mykbj' /* Usuário não encontrado */,
|
'1p9mykbj' /* Usuário não encontrado */,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily,
|
||||||
FlutterFlowTheme.of(context).headlineSmallFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineSmallFamily),
|
||||||
FlutterFlowTheme.of(context).headlineSmallFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -113,8 +107,7 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontStyle: FontStyle.italic,
|
fontStyle: FontStyle.italic,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelSmallFamily),
|
||||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -147,22 +140,18 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
).then((value) => context.pop(value));
|
).then((value) => context.pop(value));
|
||||||
// Navigator.pop(context, value)
|
// Navigator.pop(context, value)
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
||||||
.getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
iconPadding: 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,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
textStyle: FlutterFlowTheme.of(context).labelSmall.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelSmallFamily,
|
||||||
FlutterFlowTheme.of(context).labelSmallFamily,
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelSmallFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelSmallFamily),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
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:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BottomArrowLinkedLocalsComponentModel
|
class BottomArrowLinkedLocalsComponentModel extends FlutterFlowModel<BottomArrowLinkedLocalsComponentWidget> {
|
||||||
extends FlutterFlowModel<BottomArrowLinkedLocalsComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@ import 'package:hub/components/organism_components/bottom_arrow_linked_locals_co
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
import '../../../shared/services/authentication/authentication_service.dart';
|
import '../../../shared/services/authentication/authentication_service.dart';
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
|
@ -15,12 +16,10 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BottomArrowLinkedLocalsComponentWidget> createState() =>
|
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState();
|
||||||
_BottomArrowLinkedLocalsComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BottomArrowLinkedLocalsComponentWidgetState
|
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||||
extends State<BottomArrowLinkedLocalsComponentWidget> {
|
|
||||||
late BottomArrowLinkedLocalsComponentModel _model;
|
late BottomArrowLinkedLocalsComponentModel _model;
|
||||||
|
|
||||||
bool _loading = false;
|
bool _loading = false;
|
||||||
|
@ -29,17 +28,21 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
late Future<void> _localsFuture;
|
late Future<void> _localsFuture;
|
||||||
List<dynamic> _localsWrap = [];
|
List<dynamic> _localsWrap = [];
|
||||||
|
|
||||||
@override void setState(VoidCallback callback) {
|
@override
|
||||||
|
void setState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
_model.onUpdate();
|
_model.onUpdate();
|
||||||
}
|
}
|
||||||
@override void initState() {
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model =
|
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||||
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
|
||||||
_localsFuture = _fetchLocals();
|
_localsFuture = _fetchLocals();
|
||||||
}
|
}
|
||||||
@override void dispose() {
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
_model.maybeDispose();
|
_model.maybeDispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@ -49,8 +52,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."),
|
||||||
ptText: "Não há mais dados.", enText: "No more data."),
|
|
||||||
),
|
),
|
||||||
duration: const Duration(seconds: 3),
|
duration: const Duration(seconds: 3),
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
@ -64,7 +66,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
var response = await PhpGroup.getLocalsCall.call();
|
var response = await PhpGroup.getLocalsCall.call();
|
||||||
final bool isError = response.jsonBody['error'];
|
final bool isError = response.jsonBody['error'];
|
||||||
|
|
||||||
|
|
||||||
if (isError) {
|
if (isError) {
|
||||||
final String errorMsg = response.jsonBody['error_msg'];
|
final String errorMsg = response.jsonBody['error_msg'];
|
||||||
_handleError(context, errorMsg);
|
_handleError(context, errorMsg);
|
||||||
|
@ -73,7 +74,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
|
|
||||||
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||||
|
|
||||||
|
|
||||||
final bool isEmpty = locals.isEmpty;
|
final bool isEmpty = locals.isEmpty;
|
||||||
final bool isUnique = locals.length == 1;
|
final bool isUnique = locals.length == 1;
|
||||||
final bool isActive = locals[0]['CLU_STATUS'] == 'A';
|
final bool isActive = locals[0]['CLU_STATUS'] == 'A';
|
||||||
|
@ -82,9 +82,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
final bool isEnabled = isUnique && isActive;
|
final bool isEnabled = isUnique && isActive;
|
||||||
final bool isDisabled = isUnique && isBlocked;
|
final bool isDisabled = isUnique && isBlocked;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!isEmpty) {
|
if (!isEmpty) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_localsWrap.addAll(locals);
|
_localsWrap.addAll(locals);
|
||||||
|
@ -98,9 +95,11 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
}
|
}
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
StorageUtil().cliName = local['CLI_NOME'];
|
|
||||||
StorageUtil().cliUUID = local['CLI_ID'];
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
StorageUtil().ownerUUID = local['CLU_OWNER_ID'];
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||||
|
await StorageHelper()
|
||||||
|
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
return response;
|
return response;
|
||||||
|
@ -127,29 +126,26 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
static void _handleError(BuildContext context, String errorMsg) {
|
static void _handleError(BuildContext context, String errorMsg) {
|
||||||
AuthenticationService.signOut(context);
|
AuthenticationService.signOut(context);
|
||||||
DialogUtil.error(context, errorMsg);
|
DialogUtil.error(context, errorMsg);
|
||||||
LogUtil.requestAPIFailed('getLocals.php', '{devUUID: ${StorageUtil().devUUID}, cliUUID: ${StorageUtil().userUUID}}', 'Get Locals', errorMsg, StackTrace.current);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
try {
|
try {
|
||||||
StorageUtil().cliUUID = cliID;
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, cliID, Storage.SQLiteStorage);
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
return {
|
return {
|
||||||
'error': false,
|
'error': false,
|
||||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
'error_msg': FFLocalizations.of(context)
|
||||||
ptText: "Vínculo Ativado com Sucesso",
|
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
||||||
enText: "Link Activated Successfully")
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
StorageUtil().cliUUID = '';
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, '', Storage.SQLiteStorage);
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
DialogUtil.errorDefault(context);
|
DialogUtil.errorDefault(context);
|
||||||
LogUtil.requestAPIFailed(
|
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s);
|
||||||
'responderVinculo.php', '', 'Responder Vínculo', e, s);
|
|
||||||
return {
|
return {
|
||||||
'error': true,
|
'error': true,
|
||||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -174,17 +170,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
Map<String, Color> _statusHashMap(dynamic local) {
|
Map<String, Color> _statusHashMap(dynamic local) {
|
||||||
return Map<String, Color>.from({
|
return Map<String, Color>.from({
|
||||||
if (local['CLU_STATUS'] == 'A')
|
if (local['CLU_STATUS'] == 'A')
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'):
|
||||||
ptText: 'Ativo',
|
FlutterFlowTheme.of(context).success
|
||||||
enText: 'Active'): FlutterFlowTheme.of(context).success
|
|
||||||
else if (local['CLU_STATUS'] == 'B')
|
else if (local['CLU_STATUS'] == 'B')
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'):
|
||||||
ptText: 'Bloqueado',
|
FlutterFlowTheme.of(context).error
|
||||||
enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
|
||||||
else
|
else
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'):
|
||||||
ptText: 'Pendente',
|
FlutterFlowTheme.of(context).warning
|
||||||
enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,15 +188,15 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
StorageUtil().cliUUID = local['CLI_ID'];
|
await StorageHelper().set(SQLiteStorageKey.clientUUID.value, local['CLI_ID'], Storage.SQLiteStorage);
|
||||||
StorageUtil().cliName = local['CLI_NOME'];
|
await StorageHelper().set(SQLiteStorageKey.clientName.value, local['CLI_NOME'], Storage.SQLiteStorage);
|
||||||
StorageUtil().ownerUUID = local['CLU_OWNER_ID'];
|
await StorageHelper()
|
||||||
|
.set(SQLiteStorageKey.ownerUUID.value, local['CLU_OWNER_ID'], Storage.SQLiteStorage);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
} else if (local['CLU_STATUS'] == 'B') {
|
} else if (local['CLU_STATUS'] == 'B') {
|
||||||
String message = FFLocalizations.of(context).getVariableText(
|
String message = FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
||||||
'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
|
||||||
enText: 'Location Blocked for Access, Contact Administration',
|
enText: 'Location Blocked for Access, Contact Administration',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -219,12 +212,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
String localName = local['CLI_NOME'];
|
String localName = local['CLI_NOME'];
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
||||||
ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Deseja aceitar o vínculo a $localName?',
|
ptText: 'Deseja aceitar o vínculo a $localName?',
|
||||||
enText: 'Do you wish to accept the link to $localName?'),
|
enText: 'Do you wish to accept the link to $localName?'), () async {
|
||||||
() async {
|
|
||||||
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|
||||||
|
@ -276,8 +267,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
height: height - (height * 0.5),
|
height: height - (height * 0.5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||||
topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
@ -289,16 +279,13 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: Text(FFLocalizations.of(context).getVariableText(
|
child: Text(FFLocalizations.of(context)
|
||||||
ptText: "Nenhum Local Encontrado.",
|
.getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
||||||
enText: "No local found")),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else if (_hasData == true &&
|
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty)
|
||||||
_loading == false &&
|
|
||||||
_localsWrap.isNotEmpty)
|
|
||||||
Expanded(child: _listItems(context)),
|
Expanded(child: _listItems(context)),
|
||||||
if (_loading == true)
|
if (_loading == true)
|
||||||
Container(
|
Container(
|
||||||
|
@ -315,8 +302,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 10),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Escolha um local', enText: 'Choose a location'),
|
||||||
ptText: 'Escolha um local', enText: 'Choose a location'),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
)))),
|
)))),
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'local_profile_component_widget.dart' show LocalProfileComponentWidget;
|
import 'local_profile_component_widget.dart' show LocalProfileComponentWidget;
|
||||||
|
@ -6,8 +7,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
class LocalProfileComponentModel
|
class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentWidget> {
|
||||||
extends FlutterFlowModel<LocalProfileComponentWidget> {
|
|
||||||
String cliName = '';
|
String cliName = '';
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
VoidCallback? setStateCallback;
|
VoidCallback? setStateCallback;
|
||||||
|
@ -18,8 +18,9 @@ class LocalProfileComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
cliName = StorageUtil().cliName;
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
setStateCallback?.call();
|
setStateCallback?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,10 @@ class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
const LocalProfileComponentWidget({super.key});
|
const LocalProfileComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LocalProfileComponentWidget> createState() =>
|
State<LocalProfileComponentWidget> createState() => _LocalProfileComponentWidgetState();
|
||||||
_LocalProfileComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LocalProfileComponentWidgetState
|
class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidget> {
|
||||||
extends State<LocalProfileComponentWidget> {
|
|
||||||
late LocalProfileComponentModel _model;
|
late LocalProfileComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -114,12 +112,9 @@ class _LocalProfileComponentWidgetState
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
alignment: const Alignment(0.0, 0.0),
|
alignment: const Alignment(0.0, 0.0),
|
||||||
placeholder: (context, url) =>
|
placeholder: (context, url) => Image.asset('assets/images/home.png'),
|
||||||
Image.asset('assets/images/home.png'),
|
errorListener: (_) => Image.asset('assets/images/home.png'),
|
||||||
errorListener: (_) =>
|
errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'),
|
||||||
Image.asset('assets/images/home.png'),
|
|
||||||
errorWidget: (_, __, ___) =>
|
|
||||||
Image.asset('assets/images/home.png'),
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
|
@ -2,29 +2,29 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
|
|
||||||
import '../../../shared/services/localization/localization_service.dart';
|
|
||||||
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
|
||||||
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'menu_component_widget.dart' show MenuComponentWidget;
|
import 'menu_component_widget.dart' show MenuComponentWidget;
|
||||||
|
|
||||||
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
|
|
||||||
bool isGrid = false;
|
bool isGrid = false;
|
||||||
|
|
||||||
late MenuListViewComponentModel menuListViewComponentModel;
|
late MenuListViewComponentModel menuListViewComponentModel;
|
||||||
late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel;
|
late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel;
|
||||||
|
|
||||||
@override void initState(BuildContext context) {
|
@override
|
||||||
menuListViewComponentModel =
|
void initState(BuildContext context) {
|
||||||
createModel(context, () => MenuListViewComponentModel());
|
menuListViewComponentModel = createModel(context, () => MenuListViewComponentModel());
|
||||||
menuStaggeredViewComponentModel =
|
menuStaggeredViewComponentModel = createModel(context, () => MenuStaggeredViewComponentModel());
|
||||||
createModel(context, () => MenuStaggeredViewComponentModel());
|
|
||||||
}
|
}
|
||||||
@override void dispose() {
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
menuListViewComponentModel.dispose();
|
menuListViewComponentModel.dispose();
|
||||||
menuStaggeredViewComponentModel.dispose();
|
menuStaggeredViewComponentModel.dispose();
|
||||||
}
|
}
|
||||||
|
@ -32,81 +32,89 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
Future changeMenuStyle(BuildContext context) async {
|
Future changeMenuStyle(BuildContext context) async {
|
||||||
isGrid = !isGrid;
|
isGrid = !isGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openQRCodeScanner(BuildContext context) async {
|
Future openQRCodeScanner(BuildContext context) async {
|
||||||
context.push(
|
|
||||||
'/qrCodePage',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: true,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Future openCompleteSchedule(BuildContext context) async {
|
|
||||||
context.push(
|
context.push(
|
||||||
'/scheduleCompleteVisitPage',
|
'/qrCodePage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Future openDeliverySchedule(BuildContext context) async {
|
|
||||||
final bool isProvisional = StorageUtil().provisional;
|
Future openCompleteSchedule(BuildContext context) async {
|
||||||
if (isProvisional == true) {
|
context.push(
|
||||||
context.push(
|
'/scheduleCompleteVisitPage',
|
||||||
'/deliverySchedule',
|
extra: <String, dynamic>{
|
||||||
extra: <String, dynamic>{
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
hasTransition: false,
|
||||||
hasTransition: true,
|
transitionType: PageTransitionType.scale,
|
||||||
transitionType: PageTransitionType.scale,
|
alignment: Alignment.bottomCenter,
|
||||||
alignment: Alignment.bottomCenter,
|
),
|
||||||
),
|
},
|
||||||
},
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Future openProvisionalSchedule(BuildContext context) async {
|
|
||||||
final isProvisional = StorageUtil().provisional;
|
|
||||||
if (isProvisional == true) {
|
|
||||||
context.push(
|
|
||||||
'/provisionalSchedule',
|
|
||||||
extra: <String, dynamic>{
|
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
|
||||||
hasTransition: true,
|
|
||||||
transitionType: PageTransitionType.scale,
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
DialogUnavailable.unavailableFeature(context);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future openDeliverySchedule(BuildContext context) async {
|
||||||
|
final bool isProvisional =
|
||||||
|
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||||
|
if (isProvisional == true) {
|
||||||
|
context.push(
|
||||||
|
'/deliverySchedule',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: false,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
DialogUnavailable.unavailableFeature(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future openProvisionalSchedule(BuildContext context) async {
|
||||||
|
final isProvisional =
|
||||||
|
await StorageHelper().get(SQLiteStorageKey.provisional.value, Storage.SQLiteStorage) == 'true';
|
||||||
|
if (isProvisional == true) {
|
||||||
|
context.push(
|
||||||
|
'/provisionalSchedule',
|
||||||
|
extra: <String, dynamic>{
|
||||||
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
|
hasTransition: false,
|
||||||
|
transitionType: PageTransitionType.scale,
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
DialogUnavailable.unavailableFeature(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future openFastPassSchedule(BuildContext context) async {
|
Future openFastPassSchedule(BuildContext context) async {
|
||||||
final isWpp = StorageUtil().whatsapp;
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isWpp) {
|
if (isWpp) {
|
||||||
context.push(
|
context.push(
|
||||||
'/fastPassPage',
|
'/fastPassPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
DialogUnavailable.unavailableFeature(context);
|
DialogUnavailable.unavailableFeature(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future showSchedules(BuildContext context) async {
|
Future showSchedules(BuildContext context) async {
|
||||||
final routesListStr = <String>[
|
final routesListStr = <String>[
|
||||||
'scheduleProvisionalVisitPage',
|
'scheduleProvisionalVisitPage',
|
||||||
|
@ -146,30 +154,33 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openVisitorsRegister(BuildContext context) async {
|
Future openVisitorsRegister(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/registerVisitorPage',
|
'/registerVisitorPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openPoepleOnTheProperty(BuildContext context) async {
|
Future openPoepleOnTheProperty(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/peopleOnThePropertyPage',
|
'/peopleOnThePropertyPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> Logout(BuildContext context) async {
|
Future<void> Logout(BuildContext context) async {
|
||||||
final String title = FFLocalizations.of(context).getVariableText(
|
final String title = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Sair',
|
ptText: 'Sair',
|
||||||
|
@ -179,58 +190,60 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
ptText: 'Tem certeza que deseja sair?',
|
ptText: 'Tem certeza que deseja sair?',
|
||||||
enText: 'Are you sure you want to logout?',
|
enText: 'Are you sure you want to logout?',
|
||||||
);
|
);
|
||||||
showAlertDialog(
|
showAlertDialog(context, title, content, () async => await AuthenticationService.signOut(context));
|
||||||
context,
|
|
||||||
title,
|
|
||||||
content,
|
|
||||||
() async => await AuthenticationService.signOut(context));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openPreferencesSettings(BuildContext context) async {
|
Future openPreferencesSettings(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/preferencesSettings',
|
'/preferencesSettings',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openMyOrders(BuildContext context) async {
|
Future openMyOrders(BuildContext context) async {
|
||||||
final isWpp = StorageUtil().whatsapp;
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isWpp) {
|
;
|
||||||
context.push(
|
if (isWpp) {
|
||||||
'/packageOrder',
|
context.push(
|
||||||
extra: <String, dynamic>{
|
'/packageOrder',
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
extra: <String, dynamic>{
|
||||||
hasTransition: true,
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
transitionType: PageTransitionType.scale,
|
hasTransition: false,
|
||||||
alignment: Alignment.bottomCenter,
|
transitionType: PageTransitionType.scale,
|
||||||
),
|
alignment: Alignment.bottomCenter,
|
||||||
},
|
),
|
||||||
);
|
},
|
||||||
} else {
|
);
|
||||||
DialogUnavailable.unavailableFeature(context);
|
} else {
|
||||||
}
|
DialogUnavailable.unavailableFeature(context);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future openReservations(BuildContext context) async {
|
Future openReservations(BuildContext context) async {
|
||||||
final isWpp = StorageUtil().whatsapp;
|
final isWpp = await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isWpp) {
|
;
|
||||||
context.push(
|
if (isWpp) {
|
||||||
'/reservation',
|
context.push(
|
||||||
extra: <String, dynamic>{
|
'/reservation',
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
extra: <String, dynamic>{
|
||||||
hasTransition: true,
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
transitionType: PageTransitionType.scale,
|
hasTransition: false,
|
||||||
alignment: Alignment.bottomCenter,
|
transitionType: PageTransitionType.scale,
|
||||||
),
|
alignment: Alignment.bottomCenter,
|
||||||
},
|
),
|
||||||
);
|
},
|
||||||
} else {
|
);
|
||||||
DialogUnavailable.unavailableFeature(context);
|
} else {
|
||||||
}
|
DialogUnavailable.unavailableFeature(context);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future showHistories(BuildContext context) async {
|
Future showHistories(BuildContext context) async {
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
// isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
|
@ -276,72 +289,75 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openLiberationsHistory(BuildContext context) async {
|
Future openLiberationsHistory(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/liberationHistory',
|
'/liberationHistory',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openAccessHistory(BuildContext context) async {
|
Future openAccessHistory(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/acessHistoryPage',
|
'/acessHistoryPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openVisitsHistory(BuildContext context) async {
|
Future openVisitsHistory(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/scheduleCompleteVisitPage',
|
'/scheduleCompleteVisitPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openMessagesHistory(BuildContext context) async {
|
Future openMessagesHistory(BuildContext context) async {
|
||||||
context.push(
|
context.push(
|
||||||
'/messageHistoryPage',
|
'/messageHistoryPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
hasTransition: true,
|
hasTransition: false,
|
||||||
transitionType: PageTransitionType.scale,
|
transitionType: PageTransitionType.scale,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future openPetsRegister(BuildContext context) async {
|
Future openPetsRegister(BuildContext context) async {
|
||||||
bool isPet = StorageUtil().pets;
|
bool isPet = await StorageHelper().get(SQLiteStorageKey.pets.value, Storage.SQLiteStorage) == 'true';
|
||||||
if (isPet) {
|
;
|
||||||
context.push(
|
if (isPet) {
|
||||||
'/petsPage',
|
context.push(
|
||||||
extra: <String, dynamic>{
|
'/petsPage',
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
extra: <String, dynamic>{
|
||||||
hasTransition: true,
|
kTransitionInfoKey: const TransitionInfo(
|
||||||
transitionType: PageTransitionType.scale,
|
hasTransition: false,
|
||||||
alignment: Alignment.bottomCenter,
|
transitionType: PageTransitionType.scale,
|
||||||
),
|
alignment: Alignment.bottomCenter,
|
||||||
},
|
),
|
||||||
);
|
},
|
||||||
} else {
|
);
|
||||||
DialogUnavailable.unavailableFeature(context);
|
} else {
|
||||||
}
|
DialogUnavailable.unavailableFeature(context);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -562,15 +562,12 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Sair da Conta',
|
ptText: 'Sair da Conta',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(icon: null, action: () {}, title: ''),
|
|
||||||
];
|
];
|
||||||
}();
|
}();
|
||||||
|
|
||||||
return Builder(
|
return Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (widget.style == MenuView.list_grid &&
|
if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) {
|
||||||
widget.expandable == true &&
|
|
||||||
widget.item == MenuItem.button) {
|
|
||||||
if (_model.isGrid == true) {
|
if (_model.isGrid == true) {
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
model: _model.menuStaggeredViewComponentModel,
|
model: _model.menuStaggeredViewComponentModel,
|
||||||
|
@ -605,9 +602,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (widget.style == MenuView.list &&
|
if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.tile) {
|
||||||
widget.expandable == false &&
|
|
||||||
widget.item == MenuItem.tile) {
|
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
model: _model.menuListViewComponentModel,
|
model: _model.menuListViewComponentModel,
|
||||||
updateCallback: () => setState(() {}),
|
updateCallback: () => setState(() {}),
|
||||||
|
|
|
@ -2,10 +2,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget;
|
import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MenuListViewComponentModel extends FlutterFlowModel<MenuListViewComponentWidget> {
|
||||||
|
|
||||||
class MenuListViewComponentModel
|
|
||||||
extends FlutterFlowModel<MenuListViewComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,10 @@ class MenuListViewComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? changeMenuStyle;
|
final Future Function()? changeMenuStyle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MenuListViewComponentWidget> createState() =>
|
State<MenuListViewComponentWidget> createState() => _MenuListViewComponentWidgetState();
|
||||||
_MenuListViewComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuListViewComponentWidgetState
|
class _MenuListViewComponentWidgetState extends State<MenuListViewComponentWidget> {
|
||||||
extends State<MenuListViewComponentWidget> {
|
|
||||||
late MenuListViewComponentModel _model;
|
late MenuListViewComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -75,8 +73,7 @@ class _MenuListViewComponentWidgetState
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: SizedBox(
|
child: SizedBox(height: 115, width: 115, child: widget.options[index]),
|
||||||
height: 115, width: 115, child: widget.options[index]),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -95,8 +92,7 @@ class _MenuListViewComponentWidgetState
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: SizedBox(
|
child: SizedBox(height: 115, width: 115, child: widget.options[index]),
|
||||||
height: 115, width: 115, child: widget.options[index]),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -4,9 +4,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MenuStaggeredViewComponentModel extends FlutterFlowModel<MenuStaggeredViewComponentWidget> {
|
||||||
class MenuStaggeredViewComponentModel
|
|
||||||
extends FlutterFlowModel<MenuStaggeredViewComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,10 @@ class MenuStaggeredViewComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? changeMenuStyle;
|
final Future Function()? changeMenuStyle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MenuStaggeredViewComponentWidget> createState() =>
|
State<MenuStaggeredViewComponentWidget> createState() => _MenuStaggeredViewComponentWidgetState();
|
||||||
_MenuStaggeredViewComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MenuStaggeredViewComponentWidgetState
|
class _MenuStaggeredViewComponentWidgetState extends State<MenuStaggeredViewComponentWidget> {
|
||||||
extends State<MenuStaggeredViewComponentWidget> {
|
|
||||||
late MenuStaggeredViewComponentModel _model;
|
late MenuStaggeredViewComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -91,9 +89,7 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]
|
].addToStart(const SizedBox(height: 30)).addToEnd(const SizedBox(height: 30)),
|
||||||
.addToStart(const SizedBox(height: 30))
|
|
||||||
.addToEnd(const SizedBox(height: 30)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/request_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 'message_well_component_widget.dart' show MessageWellComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MessageWellComponentModel extends FlutterFlowModel<MessageWellComponentWidget> {
|
||||||
|
|
||||||
class MessageWellComponentModel
|
|
||||||
extends FlutterFlowModel<MessageWellComponentWidget> {
|
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode;
|
FocusNode? textFieldFocusNode;
|
||||||
|
@ -30,8 +26,7 @@ class MessageWellComponentModel
|
||||||
requestFn: requestFn,
|
requestFn: requestFn,
|
||||||
);
|
);
|
||||||
void clearGetLiberationsCache() => _getLiberationsManager.clear();
|
void clearGetLiberationsCache() => _getLiberationsManager.clear();
|
||||||
void clearGetLiberationsCacheKey(String? uniqueKey) =>
|
void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey);
|
||||||
_getLiberationsManager.clearRequest(uniqueKey);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
|
@ -21,12 +21,10 @@ class MessageWellComponentWidget extends StatefulWidget {
|
||||||
const MessageWellComponentWidget({super.key});
|
const MessageWellComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MessageWellComponentWidget> createState() =>
|
State<MessageWellComponentWidget> createState() => _MessageWellComponentWidgetState();
|
||||||
_MessageWellComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MessageWellComponentWidgetState
|
class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget> {
|
||||||
extends State<MessageWellComponentWidget> {
|
|
||||||
StreamSubscription? _dropdownSubscription;
|
StreamSubscription? _dropdownSubscription;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -143,8 +141,7 @@ class _MessageWellComponentWidgetState
|
||||||
fillColor: theme.primary,
|
fillColor: theme.primary,
|
||||||
),
|
),
|
||||||
onChanged: (String? newValue) {
|
onChanged: (String? newValue) {
|
||||||
safeSetState(() => dropdown.value = LinkedHashMap.from(
|
safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()}));
|
||||||
{newValue!: dropdownItems[newValue].toString()}));
|
|
||||||
},
|
},
|
||||||
items: dropdownItems.entries
|
items: dropdownItems.entries
|
||||||
.map((entry) => DropdownMenuItem<String>(
|
.map((entry) => DropdownMenuItem<String>(
|
||||||
|
@ -181,8 +178,7 @@ class _MessageWellComponentWidgetState
|
||||||
final formattedWords = words.map((word) {
|
final formattedWords = words.map((word) {
|
||||||
if (word.isEmpty) return word; // Handle empty words
|
if (word.isEmpty) return word; // Handle empty words
|
||||||
final firstLetter = word.substring(0, 1).toUpperCase();
|
final firstLetter = word.substring(0, 1).toUpperCase();
|
||||||
final remainingLetters =
|
final remainingLetters = word.length > 1 ? word.substring(1).toLowerCase() : '';
|
||||||
word.length > 1 ? word.substring(1).toLowerCase() : '';
|
|
||||||
return '$firstLetter$remainingLetters';
|
return '$firstLetter$remainingLetters';
|
||||||
});
|
});
|
||||||
return formattedWords.join(' ');
|
return formattedWords.join(' ');
|
||||||
|
@ -238,8 +234,7 @@ class _MessageWellComponentWidgetState
|
||||||
padding: const EdgeInsets.only(left: 5),
|
padding: const EdgeInsets.only(left: 5),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.history,
|
Icons.history,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
size: 15,
|
size: 15,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -249,8 +244,7 @@ class _MessageWellComponentWidgetState
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
),
|
),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
@ -265,8 +259,7 @@ class _MessageWellComponentWidgetState
|
||||||
padding: const EdgeInsets.only(left: 5),
|
padding: const EdgeInsets.only(left: 5),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.message,
|
Icons.message,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
size: 15,
|
size: 15,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -327,8 +320,7 @@ class MessageWellState {
|
||||||
return MessageWellState(
|
return MessageWellState(
|
||||||
messages: messages ?? this.messages,
|
messages: messages ?? this.messages,
|
||||||
pageNumber: pageNumber ?? this.pageNumber,
|
pageNumber: pageNumber ?? this.pageNumber,
|
||||||
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ??
|
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? this.allowScrollInSingleChildScrollView,
|
||||||
this.allowScrollInSingleChildScrollView,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +374,6 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final messageWellProvider =
|
final messageWellProvider = StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||||
StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
|
||||||
return MessageWellNotifier();
|
return MessageWellNotifier();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
// ignore: unused_import
|
// ignore: unused_import
|
||||||
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class ScheduleVisitDetailModel
|
class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
||||||
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -39,8 +37,7 @@ class ScheduleVisitDetailModel
|
||||||
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||||
DateFormat newFormat = DateFormat('y-M-d 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}$')
|
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$').hasMatch(dateStr)) {
|
||||||
.hasMatch(dateStr)) {
|
|
||||||
return 'Invalid date format';
|
return 'Invalid date format';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +56,9 @@ class ScheduleVisitDetailModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -35,8 +35,7 @@ class ScheduleVisitDetailWidget extends StatefulWidget {
|
||||||
final String? visitObsStr;
|
final String? visitObsStr;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ScheduleVisitDetailWidget> createState() =>
|
State<ScheduleVisitDetailWidget> createState() => _ScheduleVisitDetailWidgetState();
|
||||||
_ScheduleVisitDetailWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
|
@ -58,19 +57,16 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
|
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??=
|
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||||
TextEditingController(text: widget.visitStartDate);
|
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??=
|
_model.textController4 ??= TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
||||||
TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
_model.textFieldFocusNode4 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController5 ??=
|
_model.textController5 ??= TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
||||||
TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
|
||||||
_model.textFieldFocusNode5 ??= FocusNode();
|
_model.textFieldFocusNode5 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||||
|
@ -132,13 +128,11 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible: widget.visitorStrList != null &&
|
visible: widget.visitorStrList != null && widget.visitorStrList != '',
|
||||||
widget.visitorStrList != '',
|
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
||||||
15.0, 0.0, 0.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
|
@ -161,8 +155,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 20.0),
|
||||||
5.0, 0.0, 5.0, 20.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
|
@ -190,8 +183,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0),
|
||||||
8.0, 0.0, 8.0, 10.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -203,31 +195,19 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'7w4fohoa' /* Encerramento da Visita */,
|
'7w4fohoa' /* Encerramento da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -258,32 +238,25 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController1Validator
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController2,
|
controller: _model.textController2,
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
|
@ -292,98 +265,71 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context)
|
labelText: FFLocalizations.of(context).getVariableText(
|
||||||
.getVariableText(
|
|
||||||
enText: 'Start',
|
enText: 'Start',
|
||||||
ptText: 'Início',
|
ptText: 'Início',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText:
|
hintText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'0cp1e31d' /* dd/mm/yyyy */,
|
'0cp1e31d' /* dd/mm/yyyy */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
.accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController2Validator
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -392,90 +338,64 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'abppdgz3' /* Término */,
|
'abppdgz3' /* Término */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText:
|
hintText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'kqralft4' /* dd/mm/yyyy */,
|
'kqralft4' /* dd/mm/yyyy */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
.accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController3Validator
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -483,16 +403,14 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
|
@ -501,96 +419,69 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'xjxhzqqm' /* Motivo da Visita */,
|
'xjxhzqqm' /* Motivo da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText:
|
hintText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'47oezdm6' /* Motivo */,
|
'47oezdm6' /* Motivo */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
.accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController4Validator
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController5,
|
controller: _model.textController5,
|
||||||
focusNode: _model.textFieldFocusNode5,
|
focusNode: _model.textFieldFocusNode5,
|
||||||
|
@ -599,89 +490,63 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'2ujg7u18' /* Nível de Acesso */,
|
'2ujg7u18' /* Nível de Acesso */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText:
|
hintText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'3emmbbfv' /* Nível de Acesso */,
|
'3emmbbfv' /* Nível de Acesso */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
.accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController5Validator
|
validator: _model.textController5Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -691,8 +556,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController6,
|
controller: _model.textController6,
|
||||||
focusNode: _model.textFieldFocusNode6,
|
focusNode: _model.textFieldFocusNode6,
|
||||||
|
@ -704,31 +568,19 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'ritce5uw' /* Observações da Visita */,
|
'ritce5uw' /* Observações da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -759,18 +611,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController6Validator
|
validator: _model.textController6Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -780,12 +627,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.postScheduleVisit =
|
_model.postScheduleVisit = await PhpGroup.postScheduleVisitCall.call(
|
||||||
await PhpGroup.postScheduleVisitCall.call(
|
|
||||||
devDesc: widget.visitObsStr,
|
devDesc: widget.visitObsStr,
|
||||||
idVisitante: widget.visitorStrList,
|
idVisitante: widget.visitorStrList,
|
||||||
dtInicio:
|
dtInicio: _model.convertDateFormat(widget.visitStartDate ?? ''),
|
||||||
_model.convertDateFormat(widget.visitStartDate ?? ''),
|
|
||||||
dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''),
|
dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''),
|
||||||
unica: widget.visitTempStr,
|
unica: widget.visitTempStr,
|
||||||
idMotivo: extractIdToStr(widget.visitResonStr!),
|
idMotivo: extractIdToStr(widget.visitResonStr!),
|
||||||
|
@ -799,12 +644,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
false) {
|
false) {
|
||||||
context.pop();
|
context.pop();
|
||||||
} else {
|
} else {
|
||||||
final String? msg = PhpGroup.postScheduleVisitCall.errorMsg(
|
final String? msg = PhpGroup.postScheduleVisitCall.errorMsg(
|
||||||
(_model.postScheduleVisit?.jsonBody ?? ''),
|
(_model.postScheduleVisit?.jsonBody ?? ''),
|
||||||
);
|
);
|
||||||
await DialogUtil.error(context, msg!).then((value) => safeSetState(() {}));
|
await DialogUtil.error(context, msg!).then((value) => safeSetState(() {}));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
class UpArrowLinkedLocalsComponentModel
|
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||||
extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -16,10 +16,10 @@ class UpArrowLinkedLocalsComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliName = StorageUtil().cliName;
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -12,12 +12,10 @@ class UpArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
const UpArrowLinkedLocalsComponentWidget({super.key});
|
const UpArrowLinkedLocalsComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<UpArrowLinkedLocalsComponentWidget> createState() =>
|
State<UpArrowLinkedLocalsComponentWidget> createState() => _UpArrowLinkedLocalsComponentWidgetState();
|
||||||
_UpArrowLinkedLocalsComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _UpArrowLinkedLocalsComponentWidgetState
|
class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocalsComponentWidget> {
|
||||||
extends State<UpArrowLinkedLocalsComponentWidget> {
|
|
||||||
late UpArrowLinkedLocalsComponentModel _model;
|
late UpArrowLinkedLocalsComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -107,8 +105,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
|
|
||||||
return GridView.builder(
|
return GridView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
gridDelegate:
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 1,
|
crossAxisCount: 1,
|
||||||
crossAxisSpacing: 10.0,
|
crossAxisSpacing: 10.0,
|
||||||
mainAxisSpacing: 0.0,
|
mainAxisSpacing: 0.0,
|
||||||
|
@ -117,8 +114,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: eachLocals.length,
|
itemCount: eachLocals.length,
|
||||||
itemBuilder: (context, eachLocalsIndex) {
|
itemBuilder: (context, eachLocalsIndex) {
|
||||||
final eachLocalsItem =
|
final eachLocalsItem = eachLocals[eachLocalsIndex];
|
||||||
eachLocals[eachLocalsIndex];
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -141,40 +137,31 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.primaryText,
|
borderRadius: const BorderRadius.only(
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(25.0),
|
bottomLeft: Radius.circular(25.0),
|
||||||
bottomRight:
|
bottomRight: Radius.circular(25.0),
|
||||||
Radius.circular(25.0),
|
|
||||||
topLeft: Radius.circular(25.0),
|
topLeft: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(25.0),
|
topRight: Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.secondaryText,
|
|
||||||
width: 3.0,
|
width: 3.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.only(
|
||||||
const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(25.0),
|
bottomLeft: Radius.circular(25.0),
|
||||||
bottomRight:
|
bottomRight: Radius.circular(25.0),
|
||||||
Radius.circular(25.0),
|
|
||||||
topLeft: Radius.circular(25.0),
|
topLeft: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(25.0),
|
topRight: Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
|
@ -187,36 +174,23 @@ class _UpArrowLinkedLocalsComponentWidgetState
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
alignment:
|
alignment: const Alignment(0.0, 0.0),
|
||||||
const Alignment(0.0, 0.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
getJsonField(
|
getJsonField(
|
||||||
eachLocalsItem,
|
eachLocalsItem,
|
||||||
r'''$.CLI_NOME''',
|
r'''$.CLI_NOME''',
|
||||||
).toString(),
|
).toString(),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'access_notification_modal_template_component_widget.dart'
|
import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget;
|
||||||
show AccessNotificationModalTemplateComponentWidget;
|
|
||||||
|
|
||||||
class AccessNotificationModalTemplateComponentModel
|
class AccessNotificationModalTemplateComponentModel
|
||||||
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||||
|
@ -32,9 +32,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -41,8 +41,7 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_model = createModel(
|
_model = createModel(context, () => AccessNotificationModalTemplateComponentModel());
|
||||||
context, () => AccessNotificationModalTemplateComponentModel());
|
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController(text: widget.name);
|
_model.textController1 ??= TextEditingController(text: widget.name);
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
@ -66,11 +65,9 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String labelTypeResident = FFLocalizations.of(context)
|
String labelTypeResident = FFLocalizations.of(context).getVariableText(enText: 'Resident', ptText: 'Morador');
|
||||||
.getVariableText(enText: 'Resident', ptText: 'Morador');
|
|
||||||
|
|
||||||
String labelTypeVisitor = FFLocalizations.of(context)
|
String labelTypeVisitor = FFLocalizations.of(context).getVariableText(enText: 'Visitor', ptText: 'Visitante');
|
||||||
.getVariableText(enText: 'Visitor', ptText: 'Visitante');
|
|
||||||
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
@ -113,13 +110,10 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
fit: BoxFit.cover,
|
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(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -132,25 +126,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'dvag09pq' /* Nome */,
|
'dvag09pq' /* Nome */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -162,18 +150,16 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator:
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
_model.textController1Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
@ -181,10 +167,8 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: TextEditingController(
|
controller:
|
||||||
text: widget.type == 'O'
|
TextEditingController(text: widget.type == 'O' ? labelTypeResident : labelTypeVisitor),
|
||||||
? labelTypeResident
|
|
||||||
: labelTypeVisitor),
|
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
|
@ -195,27 +179,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'h3s0r1he' /* Tipo */,
|
'h3s0r1he' /* Tipo */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -227,28 +203,22 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator: _model.textController2Validator
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
.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(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -261,25 +231,19 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'jveeqpdz' /* Acesso */,
|
'jveeqpdz' /* Acesso */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -291,23 +255,20 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator:
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
_model.textController3Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
|
@ -322,24 +283,18 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
enText: 'Access Sector',
|
enText: 'Access Sector',
|
||||||
ptText: 'Setor de Acesso',
|
ptText: 'Setor de Acesso',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -351,16 +306,14 @@ class _AccessNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
validator:
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
_model.textController4Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'card_item_template_component_widget.dart'
|
import 'card_item_template_component_widget.dart' show CardItemTemplateComponentWidget;
|
||||||
show CardItemTemplateComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CardItemTemplateComponentModel extends FlutterFlowModel<CardItemTemplateComponentWidget> {
|
||||||
class CardItemTemplateComponentModel
|
|
||||||
extends FlutterFlowModel<CardItemTemplateComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,10 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? onTapCardItemAction;
|
final Future Function()? onTapCardItemAction;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<CardItemTemplateComponentWidget> createState() =>
|
State<CardItemTemplateComponentWidget> createState() => _CardItemTemplateComponentWidgetState();
|
||||||
_CardItemTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CardItemTemplateComponentWidgetState
|
class _CardItemTemplateComponentWidgetState extends State<CardItemTemplateComponentWidget> {
|
||||||
extends State<CardItemTemplateComponentWidget> {
|
|
||||||
late CardItemTemplateComponentModel _model;
|
late CardItemTemplateComponentModel _model;
|
||||||
late LinkedHashMap<String, String> labelsLinkedHashMap;
|
late LinkedHashMap<String, String> labelsLinkedHashMap;
|
||||||
late List<LinkedHashMap<String, Color>> statusLinkedHashMap;
|
late List<LinkedHashMap<String, Color>> statusLinkedHashMap;
|
||||||
|
@ -41,9 +39,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => CardItemTemplateComponentModel());
|
_model = createModel(context, () => CardItemTemplateComponentModel());
|
||||||
labelsLinkedHashMap = LinkedHashMap.from(widget.labelsHashMap ?? {});
|
labelsLinkedHashMap = LinkedHashMap.from(widget.labelsHashMap ?? {});
|
||||||
statusLinkedHashMap = widget.statusHashMap
|
statusLinkedHashMap = widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList();
|
||||||
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
|
|
||||||
.toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -73,8 +69,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: limitedBodyTextSize,
|
fontSize: limitedBodyTextSize,
|
||||||
),
|
),
|
||||||
|
@ -89,8 +84,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
fontSize: limitedBodyTextSize,
|
fontSize: limitedBodyTextSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -182,9 +176,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_generateImage(),
|
_generateImage(),
|
||||||
]
|
].addToEnd(const SizedBox(width: 10)).addToStart(const SizedBox(width: 10)),
|
||||||
.addToEnd(const SizedBox(width: 10))
|
|
||||||
.addToStart(const SizedBox(width: 10)),
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Column(
|
return Column(
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'change_pass_widget.dart'
|
import 'change_pass_widget.dart' show PassKeyTemplateWidget;
|
||||||
show PassKeyTemplateWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PassKeyTemplateComponentModel extends FlutterFlowModel<PassKeyTemplateWidget> {
|
||||||
class PassKeyTemplateComponentModel
|
|
||||||
extends FlutterFlowModel<PassKeyTemplateWidget> {
|
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
|
@ -18,19 +15,18 @@ class PassKeyTemplateComponentModel
|
||||||
late bool keyTextFieldVisibility2;
|
late bool keyTextFieldVisibility2;
|
||||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator1;
|
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator1;
|
||||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2;
|
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2;
|
||||||
String? _keyTextFieldTextControllerValidator(
|
String? _keyTextFieldTextControllerValidator(BuildContext context, String? val) {
|
||||||
BuildContext context, String? val) {
|
if (val == null || val.isEmpty) {
|
||||||
if (val == null || val.isEmpty ) {
|
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'This field is required',
|
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(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'This field must have at least 4 characters',
|
enText: 'This field must have at least 4 characters',
|
||||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -27,6 +28,8 @@ class PassKeyTemplateWidget extends StatefulWidget {
|
||||||
class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
late PassKeyTemplateComponentModel _model;
|
late PassKeyTemplateComponentModel _model;
|
||||||
|
|
||||||
|
late String _accessPass = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
|
@ -41,6 +44,12 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
_model.keyTextFieldTextController1 ??= TextEditingController();
|
_model.keyTextFieldTextController1 ??= TextEditingController();
|
||||||
_model.keyTextFieldFocusNode1 ??= FocusNode();
|
_model.keyTextFieldFocusNode1 ??= FocusNode();
|
||||||
_model.keyTextFieldFocusNode1!.addListener(() => setState(() {}));
|
_model.keyTextFieldFocusNode1!.addListener(() => setState(() {}));
|
||||||
|
|
||||||
|
_initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initialize() async {
|
||||||
|
_accessPass = await StorageHelper().get(SecureStorageKey.accessPass.value, Storage.SecureStorage) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -81,8 +90,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
tablet: false,
|
tablet: false,
|
||||||
))
|
))
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -95,8 +103,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||||
0.0, 12.0, 0.0, 12.0),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.arrow_back_rounded,
|
Icons.arrow_back_rounded,
|
||||||
color: Color(0xFF15161E),
|
color: Color(0xFF15161E),
|
||||||
|
@ -104,20 +111,17 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
||||||
12.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'',
|
'',
|
||||||
style:
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
color: const Color(0xFF15161E),
|
||||||
color: const Color(0xFF15161E),
|
fontSize: 14.0,
|
||||||
fontSize: 14.0,
|
letterSpacing: 0.0,
|
||||||
letterSpacing: 0.0,
|
fontWeight: FontWeight.w500,
|
||||||
fontWeight: FontWeight.w500,
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -125,14 +129,11 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'INSERT PASSWORD',
|
enText: 'INSERT PASSWORD',
|
||||||
ptText: StorageUtil().accessPass != ''
|
ptText: _accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA',
|
||||||
? 'ALTERAR SENHA'
|
|
||||||
: 'ADICIONAR SENHA',
|
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Outfit',
|
fontFamily: 'Outfit',
|
||||||
|
@ -145,20 +146,17 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Enter your password to continue',
|
enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
||||||
ptText: 'Digite sua senha para continuar'),
|
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -168,8 +166,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||||
16.0, 12.0, 16.0, 0.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
@ -188,36 +185,29 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
obscureText: !_model.keyTextFieldVisibility1,
|
obscureText: !_model.keyTextFieldVisibility1,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getVariableText(
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Senha',
|
ptText: 'Senha',
|
||||||
enText: 'Password',
|
enText: 'Password',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getVariableText(
|
hintText: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Digite a sua senha.....',
|
ptText: 'Digite a sua senha.....',
|
||||||
enText: 'Enter your password.....',
|
enText: 'Enter your password.....',
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -248,14 +238,11 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor:
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
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(
|
suffixIcon: InkWell(
|
||||||
onTap: () => setState(
|
onTap: () => setState(
|
||||||
() => _model.keyTextFieldVisibility1 =
|
() => _model.keyTextFieldVisibility1 = !_model.keyTextFieldVisibility1,
|
||||||
!_model.keyTextFieldVisibility1,
|
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -273,20 +260,14 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
maxLength: 4,
|
maxLength: 4,
|
||||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||||
buildCounter: (context,
|
buildCounter: (context, {required currentLength, required isFocused, maxLength}) => null,
|
||||||
{required currentLength,
|
|
||||||
required isFocused,
|
|
||||||
maxLength}) =>
|
|
||||||
null,
|
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
validator: _model.keyTextFieldTextControllerValidator1
|
validator: _model.keyTextFieldTextControllerValidator1.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
LengthLimitingTextInputFormatter(4),
|
LengthLimitingTextInputFormatter(4),
|
||||||
|
@ -300,12 +281,10 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (_model.formKey.currentState == null ||
|
if (_model.formKey.currentState == null || !_model.formKey.currentState!.validate()) {
|
||||||
!_model.formKey.currentState!.validate()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await widget.toggleActionStatus?.call(
|
await widget.toggleActionStatus?.call(
|
||||||
|
@ -317,20 +296,14 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: StorageUtil().accessPass != ''
|
ptText: _accessPass != '' ? 'Alterar' : 'Adicionar',
|
||||||
? 'Alterar'
|
enText: _accessPass != '' ? 'Change' : 'Add',
|
||||||
: 'Adicionar',
|
|
||||||
enText: StorageUtil().accessPass != ''
|
|
||||||
? 'Change'
|
|
||||||
: 'Add',
|
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 270.0,
|
width: 270.0,
|
||||||
height: 50.0,
|
height: 50.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
0.0, 0.0, 0.0, 0.0),
|
iconPadding: 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),
|
color: const Color(0xFF1AAB5F),
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
@ -338,8 +311,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
|
|
@ -32,13 +32,10 @@ class DetailsComponentWidget extends StatefulWidget {
|
||||||
class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
late DetailsComponentModel _model;
|
late DetailsComponentModel _model;
|
||||||
|
|
||||||
LinkedHashMap<String, String> get labelsLinkedHashMap =>
|
LinkedHashMap<String, String> get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap);
|
||||||
LinkedHashMap.from(widget.labelsHashMap);
|
|
||||||
|
|
||||||
List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
|
List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
|
||||||
widget.statusHashMap
|
widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList();
|
||||||
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
|
@ -97,8 +94,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
SizedBox(height: MediaQuery.of(context).size.height * 0.03),
|
SizedBox(height: MediaQuery.of(context).size.height * 0.03),
|
||||||
Row(
|
Row(
|
||||||
children: statusLinkedHashMap.expand((linkedHashMap) {
|
children: statusLinkedHashMap.expand((linkedHashMap) {
|
||||||
return linkedHashMap.entries
|
return linkedHashMap.entries.map((MapEntry<String, Color> item) {
|
||||||
.map((MapEntry<String, Color> item) {
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
|
@ -122,31 +118,22 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: item.value,
|
fillColor: item.value,
|
||||||
labelText: item.key,
|
labelText: item.key,
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.labelMediumFamily,
|
|
||||||
|
|
||||||
),
|
),
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.labelMediumFamily,
|
|
||||||
),
|
),
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
|
@ -159,8 +146,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
@ -171,8 +157,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator: _model.textController1Validator
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -193,8 +178,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
initialValue: '$value',
|
initialValue: '$value',
|
||||||
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
@ -211,15 +195,11 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
@ -242,29 +222,25 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -272,8 +248,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
||||||
if (widget.buttons
|
if (widget.buttons.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
||||||
.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
|
||||||
OverflowBar(
|
OverflowBar(
|
||||||
overflowAlignment: OverflowBarAlignment.center,
|
overflowAlignment: OverflowBarAlignment.center,
|
||||||
overflowSpacing: 2,
|
overflowSpacing: 2,
|
||||||
|
|
|
@ -2,12 +2,10 @@ import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'forgot_password_template_component_widget.dart'
|
import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget;
|
||||||
show ForgotPasswordTemplateComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ForgotPasswordTemplateComponentModel
|
class ForgotPasswordTemplateComponentModel extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
|
@ -15,8 +13,7 @@ class ForgotPasswordTemplateComponentModel
|
||||||
FocusNode? emailAddressFocusNode;
|
FocusNode? emailAddressFocusNode;
|
||||||
TextEditingController? emailAddressTextController;
|
TextEditingController? emailAddressTextController;
|
||||||
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
||||||
String? _emailAddressTextControllerValidator(
|
String? _emailAddressTextControllerValidator(BuildContext context, String? val) {
|
||||||
BuildContext context, String? val) {
|
|
||||||
if (val == null || val.isEmpty) {
|
if (val == null || val.isEmpty) {
|
||||||
return FFLocalizations.of(context).getText(
|
return FFLocalizations.of(context).getText(
|
||||||
'snnmkbyc' /* E-mail é Obrigatório */,
|
'snnmkbyc' /* E-mail é Obrigatório */,
|
||||||
|
|
|
@ -19,12 +19,10 @@ class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
||||||
const ForgotPasswordTemplateComponentWidget({super.key});
|
const ForgotPasswordTemplateComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ForgotPasswordTemplateComponentWidget> createState() =>
|
State<ForgotPasswordTemplateComponentWidget> createState() => _ForgotPasswordTemplateComponentWidgetState();
|
||||||
_ForgotPasswordTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ForgotPasswordTemplateComponentWidgetState
|
class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTemplateComponentWidget> {
|
||||||
extends State<ForgotPasswordTemplateComponentWidget> {
|
|
||||||
late ForgotPasswordTemplateComponentModel _model;
|
late ForgotPasswordTemplateComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
class LiberationHistoryItemDetailsTemplateComponentModel
|
class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
extends FlutterFlowModel<
|
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||||
LiberationHistoryItemDetailsTemplateComponentWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -27,9 +27,10 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -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_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
class LiberationHistoryItemDetailsTemplateComponentWidget
|
class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget {
|
||||||
extends StatefulWidget {
|
|
||||||
const LiberationHistoryItemDetailsTemplateComponentWidget({
|
const LiberationHistoryItemDetailsTemplateComponentWidget({
|
||||||
super.key,
|
super.key,
|
||||||
required this.name,
|
required this.name,
|
||||||
|
@ -40,8 +39,7 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(
|
_model = createModel(context, () => LiberationHistoryItemDetailsTemplateComponentModel());
|
||||||
context, () => LiberationHistoryItemDetailsTemplateComponentModel());
|
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController(text: widget.name);
|
_model.textController1 ??= TextEditingController(text: widget.name);
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
@ -106,13 +104,10 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
fit: BoxFit.cover,
|
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(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -125,25 +120,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'dmazrriq' /* Nome */,
|
'dmazrriq' /* Nome */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -155,18 +144,16 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator:
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
_model.textController1Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
@ -185,27 +172,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'xx3ivbr4' /* Tipo */,
|
'xx3ivbr4' /* Tipo */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -217,28 +196,22 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator: _model.textController2Validator
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
.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(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -251,25 +224,19 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'rhheok7k' /* Acesso */,
|
'rhheok7k' /* Acesso */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -281,23 +248,20 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator:
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
_model.textController3Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
|
@ -311,24 +275,18 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'w3tciqlv' /* Acionamento */,
|
'w3tciqlv' /* Acionamento */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -340,16 +298,14 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
validator:
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
_model.textController4Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -37,8 +37,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(
|
_model = createModel(context, () => MessageNotificationModalTemplateComponentModel());
|
||||||
context, () => MessageNotificationModalTemplateComponentModel());
|
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController(text: widget.message);
|
_model.textController1 ??= TextEditingController(text: widget.message);
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
@ -80,8 +79,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -96,21 +94,17 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
enText: 'Message',
|
enText: 'Message',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
|
@ -126,8 +120,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -153,26 +146,20 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
ptText: 'De',
|
ptText: 'De',
|
||||||
enText: 'From',
|
enText: 'From',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
|
@ -185,27 +172,22 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator:
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
_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(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -220,21 +202,17 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
enText: 'To',
|
enText: 'To',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
|
@ -250,8 +228,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
class ScheduleProvisionalVisitPageModel
|
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||||
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
String devUUID = '';
|
String devUUID = '';
|
||||||
String userUUID = '';
|
String userUUID = '';
|
||||||
|
@ -19,35 +21,27 @@ class ScheduleProvisionalVisitPageModel
|
||||||
void addToVisitors(dynamic item) => visitors.add(item);
|
void addToVisitors(dynamic item) => visitors.add(item);
|
||||||
void removeFromVisitors(dynamic item) => visitors.remove(item);
|
void removeFromVisitors(dynamic item) => visitors.remove(item);
|
||||||
void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
|
void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
|
||||||
void insertAtIndexInVisitors(int index, dynamic item) =>
|
void insertAtIndexInVisitors(int index, dynamic item) => visitors.insert(index, item);
|
||||||
visitors.insert(index, item);
|
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => visitors[index] = updateFn(visitors[index]);
|
||||||
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) =>
|
|
||||||
visitors[index] = updateFn(visitors[index]);
|
|
||||||
|
|
||||||
List<String> docs = [];
|
List<String> docs = [];
|
||||||
void addToDocs(String item) => docs.add(item);
|
void addToDocs(String item) => docs.add(item);
|
||||||
void removeFromDocs(String item) => docs.remove(item);
|
void removeFromDocs(String item) => docs.remove(item);
|
||||||
void removeAtIndexFromDocs(int index) => docs.removeAt(index);
|
void removeAtIndexFromDocs(int index) => docs.removeAt(index);
|
||||||
void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
|
void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
|
||||||
void updateDocsAtIndex(int index, Function(String) updateFn) =>
|
void updateDocsAtIndex(int index, Function(String) updateFn) => docs[index] = updateFn(docs[index]);
|
||||||
docs[index] = updateFn(docs[index]);
|
|
||||||
|
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
FocusNode? personNameFocusNode;
|
FocusNode? personNameFocusNode;
|
||||||
TextEditingController? personNameTextController;
|
TextEditingController? personNameTextController;
|
||||||
String? Function(BuildContext, String?)? personNameTextControllerValidator;
|
String? Function(BuildContext, String?)? personNameTextControllerValidator;
|
||||||
String? _personNameTextControllerValidator(
|
String? _personNameTextControllerValidator(BuildContext context, String? val) {
|
||||||
BuildContext context, String? val) {
|
|
||||||
if (val == null || val.isEmpty) {
|
if (val == null || val.isEmpty) {
|
||||||
return FFLocalizations.of(context).getText(
|
return FFLocalizations.of(context).getText('3hqg8buh');
|
||||||
'3hqg8buh',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.length > 80) {
|
if (val.length > 80) {
|
||||||
return FFLocalizations.of(context).getText(
|
return FFLocalizations.of(context).getText('l0b0zr50');
|
||||||
'l0b0zr50',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -58,31 +52,26 @@ class ScheduleProvisionalVisitPageModel
|
||||||
String? Function(BuildContext, String?)? dateTimeTextControllerValidator;
|
String? Function(BuildContext, String?)? dateTimeTextControllerValidator;
|
||||||
String? _dateTimeTextControllerValidator(BuildContext context, String? val) {
|
String? _dateTimeTextControllerValidator(BuildContext context, String? val) {
|
||||||
if (val == null || val.isEmpty) {
|
if (val == null || val.isEmpty) {
|
||||||
return FFLocalizations.of(context).getText(
|
return FFLocalizations.of(context).getText('uzefkuf9');
|
||||||
'uzefkuf9',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime selectedDateTime;
|
DateTime selectedDateTime;
|
||||||
DateTime currentDateTime = DateTime.now();
|
DateTime currentDateTime = DateTime.now().add(const Duration(minutes: 59));
|
||||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
|
log('dateTimeTextController.text: ${dateTimeTextController.text}');
|
||||||
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Formato de data/hora inválido',
|
ptText: 'Formato de data inválido',
|
||||||
enText: 'Invalid date/time format',
|
enText: 'Invalid date format',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedDateTime.isBefore(currentDateTime)) {
|
if (selectedDateTime.isBefore(currentDateTime)) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'A data/hora selecionada é inválida',
|
ptText: 'A data devem ser, no mínimo, uma (1) hora à frente.',
|
||||||
enText: 'The selected date/time is invalid',
|
enText: 'The date must be at least one (1) hour ahead.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +89,8 @@ class ScheduleProvisionalVisitPageModel
|
||||||
personNameTextController ??= TextEditingController();
|
personNameTextController ??= TextEditingController();
|
||||||
personNameFocusNode ??= FocusNode();
|
personNameFocusNode ??= FocusNode();
|
||||||
|
|
||||||
dateTimeTextController ??= TextEditingController();
|
dateTimeTextController ??= TextEditingController(
|
||||||
|
text: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))));
|
||||||
dateTimeFocusNode ??= FocusNode();
|
dateTimeFocusNode ??= FocusNode();
|
||||||
|
|
||||||
notesTextController ??= TextEditingController();
|
notesTextController ??= TextEditingController();
|
||||||
|
@ -109,44 +99,6 @@ class ScheduleProvisionalVisitPageModel
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isFormValid() {
|
|
||||||
if (personNameTextController.text == '' ||
|
|
||||||
personNameTextController.text.length > 80) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dateTimeTextController.text == '') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DateTime selectedDateTime;
|
|
||||||
DateTime currentDateTime = DateTime.now();
|
|
||||||
selectedDateTime =
|
|
||||||
DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
|
||||||
|
|
||||||
try {
|
|
||||||
selectedDateTime =
|
|
||||||
DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDateTime.isBefore(currentDateTime)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> init() async {
|
|
||||||
cliUUID = StorageUtil().cliUUID;
|
|
||||||
devUUID = StorageUtil().devUUID;
|
|
||||||
userUUID = StorageUtil().userUUID;
|
|
||||||
cliName = StorageUtil().cliName;
|
|
||||||
ownerUUID = StorageUtil().ownerUUID;
|
|
||||||
setState?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
personNameFocusNode?.dispose();
|
personNameFocusNode?.dispose();
|
||||||
|
@ -158,4 +110,40 @@ class ScheduleProvisionalVisitPageModel
|
||||||
notesFocusNode?.dispose();
|
notesFocusNode?.dispose();
|
||||||
notesTextController?.dispose();
|
notesTextController?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isFormValid() {
|
||||||
|
if (personNameTextController.text == '' || personNameTextController.text.length > 80) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dateTimeTextController.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime selectedDateTime;
|
||||||
|
DateTime currentDateTime = DateTime.now().add(const Duration(minutes: 59));
|
||||||
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
|
|
||||||
|
try {
|
||||||
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(dateTimeTextController.text);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateTime.isBefore(currentDateTime)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
|
cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
setState?.call();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,8 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'qr_code_pass_key_template_component_widget.dart'
|
import 'qr_code_pass_key_template_component_widget.dart' show QrCodePassKeyTemplateComponentWidget;
|
||||||
show QrCodePassKeyTemplateComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class QrCodePassKeyTemplateComponentModel
|
class QrCodePassKeyTemplateComponentModel extends FlutterFlowModel<QrCodePassKeyTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<QrCodePassKeyTemplateComponentWidget> {
|
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
|
@ -13,8 +11,7 @@ class QrCodePassKeyTemplateComponentModel
|
||||||
TextEditingController? keyTextFieldTextController;
|
TextEditingController? keyTextFieldTextController;
|
||||||
late bool keyTextFieldVisibility;
|
late bool keyTextFieldVisibility;
|
||||||
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator;
|
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator;
|
||||||
String? _keyTextFieldTextControllerValidator(
|
String? _keyTextFieldTextControllerValidator(BuildContext context, String? val) {
|
||||||
BuildContext context, String? val) {
|
|
||||||
if (val == null || val.isEmpty) {
|
if (val == null || val.isEmpty) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'This field is required',
|
enText: 'This field is required',
|
||||||
|
@ -23,9 +20,9 @@ class QrCodePassKeyTemplateComponentModel
|
||||||
}
|
}
|
||||||
if (val.length < 4) {
|
if (val.length < 4) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'This field must be at least 4 characters',
|
enText: 'This field must be at least 4 characters',
|
||||||
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
ptText: 'Este campo deve ter pelo menos 4 caracteres',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -20,12 +20,10 @@ class QrCodePassKeyTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function(String key)? toggleActionStatus;
|
final Future Function(String key)? toggleActionStatus;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<QrCodePassKeyTemplateComponentWidget> createState() =>
|
State<QrCodePassKeyTemplateComponentWidget> createState() => _QrCodePassKeyTemplateComponentWidgetState();
|
||||||
_QrCodePassKeyTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _QrCodePassKeyTemplateComponentWidgetState
|
class _QrCodePassKeyTemplateComponentWidgetState extends State<QrCodePassKeyTemplateComponentWidget> {
|
||||||
extends State<QrCodePassKeyTemplateComponentWidget> {
|
|
||||||
late QrCodePassKeyTemplateComponentModel _model;
|
late QrCodePassKeyTemplateComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -242,18 +240,14 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
||||||
24.0, 24.0, 20.0, 24.0),
|
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
onTap: () => safeSetState(
|
onTap: () => safeSetState(
|
||||||
() => _model.keyTextFieldVisibility =
|
() => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility,
|
||||||
!_model.keyTextFieldVisibility,
|
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_model.keyTextFieldVisibility
|
_model.keyTextFieldVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
|
@ -265,19 +259,13 @@ class _QrCodePassKeyTemplateComponentWidgetState
|
||||||
fontSize: LimitedFontSizeUtil.getInputFontSize(context),
|
fontSize: LimitedFontSizeUtil.getInputFontSize(context),
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
maxLength: 4,
|
maxLength: 4,
|
||||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||||
buildCounter: (context,
|
buildCounter: (context, {required currentLength, required isFocused, maxLength}) => null,
|
||||||
{required currentLength,
|
|
||||||
required isFocused,
|
|
||||||
maxLength}) =>
|
|
||||||
null,
|
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
validator: _model.keyTextFieldTextControllerValidator
|
validator: _model.keyTextFieldTextControllerValidator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
LengthLimitingTextInputFormatter(4),
|
LengthLimitingTextInputFormatter(4),
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
|
@ -9,8 +10,7 @@ import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'regisiter_vistor_template_component_widget.dart';
|
import 'regisiter_vistor_template_component_widget.dart';
|
||||||
|
|
||||||
class RegisiterVistorTemplateComponentModel
|
class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
|
||||||
Timer? _debounceTimer;
|
Timer? _debounceTimer;
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
|
@ -18,8 +18,7 @@ class RegisiterVistorTemplateComponentModel
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
bool isDataUploading = false;
|
bool isDataUploading = false;
|
||||||
FFUploadedFile uploadedLocalFile =
|
FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
|
||||||
|
|
||||||
void debounce(Function() fn, Duration time) {
|
void debounce(Function() fn, Duration time) {
|
||||||
if (_debounceTimer != null) {
|
if (_debounceTimer != null) {
|
||||||
|
@ -43,14 +42,12 @@ class RegisiterVistorTemplateComponentModel
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> getVisitanteByDocument(
|
Future<bool> getVisitanteByDocument(String document, BuildContext context) async {
|
||||||
String document, BuildContext context) async {
|
|
||||||
final response = await PhpGroup.getVisitorByDocCall.call(
|
final response = await PhpGroup.getVisitorByDocCall.call(
|
||||||
documento: document,
|
documento: document,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
if (response.jsonBody['visitante']['VTE_ID'] != '0' && response.jsonBody['error'] != 'false') {
|
||||||
response.jsonBody['error'] != 'false') {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -93,9 +90,7 @@ class RegisiterVistorTemplateComponentModel
|
||||||
TextEditingController? textController4;
|
TextEditingController? textController4;
|
||||||
String? Function(BuildContext, String?)? textController4Validator;
|
String? Function(BuildContext, String?)? textController4Validator;
|
||||||
String? _textController4Validator(BuildContext context, String? val) {
|
String? _textController4Validator(BuildContext context, String? val) {
|
||||||
if (val != null &&
|
if (val != null && val.isNotEmpty && ValidatorUtil.isValidEmail(val) == false) {
|
||||||
val.isNotEmpty &&
|
|
||||||
ValidatorUtil.isValidEmail(val) == false) {
|
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Invalid email',
|
enText: 'Invalid email',
|
||||||
ptText: 'Email inválido',
|
ptText: 'Email inválido',
|
||||||
|
@ -134,9 +129,10 @@ class RegisiterVistorTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -24,16 +24,13 @@ class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
||||||
final String source;
|
final String source;
|
||||||
final String? doc;
|
final String? doc;
|
||||||
|
|
||||||
const RegisiterVistorTemplateComponentWidget(
|
const RegisiterVistorTemplateComponentWidget({super.key, required this.source, this.doc});
|
||||||
{super.key, required this.source, this.doc});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<RegisiterVistorTemplateComponentWidget> createState() =>
|
State<RegisiterVistorTemplateComponentWidget> createState() => _RegisiterVistorTemplateComponentWidgetState();
|
||||||
_RegisiterVistorTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RegisiterVistorTemplateComponentWidgetState
|
class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistorTemplateComponentWidget> {
|
||||||
extends State<RegisiterVistorTemplateComponentWidget> {
|
|
||||||
late RegisiterVistorTemplateComponentModel _model;
|
late RegisiterVistorTemplateComponentModel _model;
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
@ -53,8 +50,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
|
|
||||||
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
||||||
|
|
||||||
_model =
|
_model = createModel(context, () => RegisiterVistorTemplateComponentModel());
|
||||||
createModel(context, () => RegisiterVistorTemplateComponentModel());
|
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController();
|
_model.textController1 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
@ -91,19 +87,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController1.text.isEmpty ||
|
if (_model.textController1.text.isEmpty || _model.textController1.text == '') {
|
||||||
_model.textController1.text == '') {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.dropDownValue == null ||
|
if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') {
|
||||||
_model.dropDownValue!.isEmpty ||
|
|
||||||
_model.dropDownValue == '') {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController2.text.isEmpty ||
|
if (_model.textController2.text.isEmpty || _model.textController2.text == '') {
|
||||||
_model.textController2.text == '') {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,19 +153,17 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
overflow: TextOverflow.clip,
|
overflow: TextOverflow.clip,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: _model.textController2,
|
controller: _model.textController2,
|
||||||
|
@ -192,16 +182,12 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'rl8tvwnr' /* Documento */,
|
'rl8tvwnr' /* Documento */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle:
|
hintStyle:
|
||||||
|
@ -252,8 +238,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
@ -262,15 +247,13 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_model.debounce(() async {
|
_model.debounce(() async {
|
||||||
var data = await _model.getVisitanteByDocument(
|
var data = await _model.getVisitanteByDocument(value, context);
|
||||||
value, context);
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isVisitorRegistered = data;
|
_isVisitorRegistered = data;
|
||||||
});
|
});
|
||||||
}, const Duration(milliseconds: 500));
|
}, const Duration(milliseconds: 500));
|
||||||
},
|
},
|
||||||
validator:
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
_model.textController2Validator.asValidator(context),
|
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
LengthLimitingTextInputFormatter(20)
|
LengthLimitingTextInputFormatter(20)
|
||||||
|
@ -284,29 +267,17 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(
|
padding: const EdgeInsetsDirectional.only(top: 5, start: 12),
|
||||||
top: 5, start: 12),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getVariableText(
|
||||||
.getVariableText(
|
|
||||||
enText: 'Visitor already registered',
|
enText: 'Visitor already registered',
|
||||||
ptText: 'Visitante já cadastrado',
|
ptText: 'Visitante já cadastrado',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).labelSmall.override(
|
||||||
.labelSmall
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
.brightness ==
|
? Color.alphaBlend(Colors.white.withOpacity(0.7), Colors.red)
|
||||||
Brightness.dark
|
: Color.alphaBlend(Colors.black.withOpacity(0.25), Colors.red),
|
||||||
? Color.alphaBlend(
|
|
||||||
Colors.white
|
|
||||||
.withOpacity(0.7),
|
|
||||||
Colors.red)
|
|
||||||
: Color.alphaBlend(
|
|
||||||
Colors.black
|
|
||||||
.withOpacity(0.25),
|
|
||||||
Colors.red),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
)),
|
)),
|
||||||
|
@ -317,8 +288,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
@ -337,26 +307,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'v7g73yik' /* Nome */,
|
'v7g73yik' /* Nome */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -397,30 +361,26 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||||
validator:
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
_model.textController1Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0),
|
||||||
24.0, 0.0, 24.0, 10.0),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
FlutterFlowDropDown<String>(
|
FlutterFlowDropDown<String>(
|
||||||
controller: _model.dropDownValueController ??=
|
controller: _model.dropDownValueController ??= FormFieldController<String>(null),
|
||||||
FormFieldController<String>(null),
|
|
||||||
options: [
|
options: [
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'n8vddmcq' /* Visitante */,
|
'n8vddmcq' /* Visitante */,
|
||||||
|
@ -429,20 +389,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
'9luaa09e' /* Prestador de Serviço */,
|
'9luaa09e' /* Prestador de Serviço */,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
onChanged: (val) =>
|
onChanged: (val) => setState(() => _model.dropDownValue = val),
|
||||||
setState(() => _model.dropDownValue = val),
|
|
||||||
width: MediaQuery.sizeOf(context).width * 0.9,
|
width: MediaQuery.sizeOf(context).width * 0.9,
|
||||||
// height: 44.0,
|
// height: 44.0,
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getVariableText(
|
hintText: FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -458,39 +413,30 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
borderColor: FlutterFlowTheme.of(context).customColor6,
|
borderColor: FlutterFlowTheme.of(context).customColor6,
|
||||||
borderWidth: 0.5,
|
borderWidth: 0.5,
|
||||||
borderRadius: 8.0,
|
borderRadius: 8.0,
|
||||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0),
|
||||||
16.0, 0.0, 16.0, 0.0),
|
|
||||||
hidesUnderline: true,
|
hidesUnderline: true,
|
||||||
isOverButton: true,
|
isOverButton: true,
|
||||||
isSearchable: false,
|
isSearchable: false,
|
||||||
isMultiSelect: false,
|
isMultiSelect: false,
|
||||||
),
|
),
|
||||||
if (_model.dropDownValue == null ||
|
if (_model.dropDownValue == null || _model.dropDownValue == '')
|
||||||
_model.dropDownValue == '')
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(
|
padding: const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||||
top: 5, start: 15),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Select the type of visitor',
|
enText: 'Select the type of visitor',
|
||||||
ptText: 'Selecione o tipo de visitante',
|
ptText: 'Selecione o tipo de visitante',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||||
.bodySmall
|
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.customColor6,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
@ -500,12 +446,10 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
||||||
false)) {
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -514,15 +458,13 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_model.isDataUploading = false;
|
_model.isDataUploading = false;
|
||||||
_model.uploadedLocalFile =
|
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
_model.uploadedLocalFile.bytes ??
|
_model.uploadedLocalFile.bytes ?? Uint8List.fromList([]),
|
||||||
Uint8List.fromList([]),
|
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -553,27 +495,24 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 10.0, 0.0, 15.0),
|
||||||
20.0, 10.0, 0.0, 15.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'bqpucwh0' /* Contatos */,
|
'bqpucwh0' /* Contatos */,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedSubHeaderFontSize,
|
fontSize: limitedSubHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -585,8 +524,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
maxLength: 25,
|
maxLength: 25,
|
||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')),
|
||||||
RegExp('[0-9, +, -, (, )]')),
|
|
||||||
LengthLimitingTextInputFormatter(25)
|
LengthLimitingTextInputFormatter(25)
|
||||||
],
|
],
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
@ -596,26 +534,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'h84ls2r6' /* Telefone */,
|
'h84ls2r6' /* Telefone */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -652,12 +584,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
// validator:
|
// validator:
|
||||||
|
@ -665,8 +596,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
@ -686,26 +616,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'fqp7qmka' /* Email */,
|
'fqp7qmka' /* Email */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -742,33 +666,28 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||||
validator:
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
_model.textController4Validator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: _isFormValid(context)
|
onPressed: _isFormValid(context)
|
||||||
? () async {
|
? () async {
|
||||||
_model.imgBase64 =
|
_model.imgBase64 = await ImageUtils.convertImageFileToBase64(
|
||||||
await ImageUtils.convertImageFileToBase64(
|
|
||||||
_model.uploadedLocalFile,
|
_model.uploadedLocalFile,
|
||||||
);
|
);
|
||||||
_model.scheduleVisitor =
|
_model.scheduleVisitor = await PhpGroup.postScheduleVisitorCall
|
||||||
await PhpGroup.postScheduleVisitorCall
|
.call(
|
||||||
.call(
|
|
||||||
documento: _model.textController2.text,
|
documento: _model.textController2.text,
|
||||||
nome: _model.textController1.text,
|
nome: _model.textController1.text,
|
||||||
tipo: _model.dropDownValue ==
|
tipo: _model.dropDownValue ==
|
||||||
|
@ -779,7 +698,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
: 'P',
|
: 'P',
|
||||||
foto: 'base64;jpeg,${_model.imgBase64}',
|
foto: 'base64;jpeg,${_model.imgBase64}',
|
||||||
)
|
)
|
||||||
.onError((e, s) async {
|
.onError((e, s) async {
|
||||||
return await DialogUtil.errorDefault(context);
|
return await DialogUtil.errorDefault(context);
|
||||||
});
|
});
|
||||||
if (PhpGroup.postScheduleVisitorCall.error(
|
if (PhpGroup.postScheduleVisitorCall.error(
|
||||||
|
@ -792,24 +711,18 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
_model.textController3?.clear();
|
_model.textController3?.clear();
|
||||||
_model.textController4?.clear();
|
_model.textController4?.clear();
|
||||||
_model.dropDownValueController?.reset();
|
_model.dropDownValueController?.reset();
|
||||||
_model.uploadedLocalFile = FFUploadedFile(
|
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
bytes: Uint8List.fromList([]));
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText: 'Visitante cadastrado com sucesso.',
|
||||||
'Visitante cadastrado com sucesso.',
|
enText: 'Visitor successfully registered.'),
|
||||||
enText:
|
style: TextStyle(color: FlutterFlowTheme.of(context).info,
|
||||||
'Visitor successfully registered.'),
|
|
||||||
style: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.info,
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
backgroundColor:
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
duration: const Duration(seconds: 3),
|
duration: const Duration(seconds: 3),
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
|
@ -822,27 +735,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
_formKey.currentState?.reset();
|
_formKey.currentState?.reset();
|
||||||
if (widget.source ==
|
if (widget.source == 'VisitorNotFoundComponent') {
|
||||||
'VisitorNotFoundComponent') {
|
|
||||||
Navigator.pop(context, true);
|
Navigator.pop(context, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return DialogUtil.error(
|
return DialogUtil.error(
|
||||||
context,
|
context,
|
||||||
PhpGroup.postScheduleVisitorCall.errorMsg(
|
PhpGroup.postScheduleVisitorCall.errorMsg(_model.scheduleVisitor?.jsonBody) == null
|
||||||
_model
|
? FFLocalizations.of(context).getVariableText(
|
||||||
.scheduleVisitor?.jsonBody) ==
|
ptText: 'Erro ao se conectar com o servidor',
|
||||||
null
|
|
||||||
? FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText:
|
|
||||||
'Erro ao se conectar com o servidor',
|
|
||||||
enText: 'Error connecting to server',
|
enText: 'Error connecting to server',
|
||||||
)
|
)
|
||||||
: PhpGroup.postScheduleVisitorCall
|
: PhpGroup.postScheduleVisitorCall
|
||||||
.errorMsg(
|
.errorMsg(_model.scheduleVisitor?.jsonBody)
|
||||||
_model.scheduleVisitor?.jsonBody)
|
|
||||||
.toString());
|
.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -853,20 +759,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
height: 30.0 * MediaQuery.textScalerOf(context).scale(1),
|
height: 30.0 * MediaQuery.textScalerOf(context).scale(1),
|
||||||
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(80.0, 0.0, 80.0, 0.0),
|
||||||
80.0, 0.0, 80.0, 0.0),
|
iconPadding: 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,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
.titleSmall
|
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'sign_in_template_component_widget.dart'
|
import 'sign_in_template_component_widget.dart' show SignInTemplateComponentWidget;
|
||||||
show SignInTemplateComponentWidget;
|
|
||||||
|
|
||||||
class SignInTemplateComponentModel
|
|
||||||
extends FlutterFlowModel<SignInTemplateComponentWidget> {
|
|
||||||
|
|
||||||
|
class SignInTemplateComponentModel extends FlutterFlowModel<SignInTemplateComponentWidget> {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
FocusNode? emailAddressFocusNode;
|
FocusNode? emailAddressFocusNode;
|
||||||
|
@ -27,6 +24,7 @@ class SignInTemplateComponentModel
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FocusNode? passwordFocusNode;
|
FocusNode? passwordFocusNode;
|
||||||
TextEditingController? passwordTextController;
|
TextEditingController? passwordTextController;
|
||||||
late bool passwordVisibility;
|
late bool passwordVisibility;
|
||||||
|
@ -41,11 +39,6 @@ class SignInTemplateComponentModel
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {
|
void initState(BuildContext context) {
|
||||||
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
||||||
|
|
|
@ -28,12 +28,10 @@ class SignInTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? toggleSignUpPage;
|
final Future Function()? toggleSignUpPage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SignInTemplateComponentWidget> createState() =>
|
State<SignInTemplateComponentWidget> createState() => _SignInTemplateComponentWidgetState();
|
||||||
_SignInTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SignInTemplateComponentWidgetState
|
class _SignInTemplateComponentWidgetState extends State<SignInTemplateComponentWidget> with TickerProviderStateMixin {
|
||||||
extends State<SignInTemplateComponentWidget> with TickerProviderStateMixin {
|
|
||||||
late SignInTemplateComponentModel _model;
|
late SignInTemplateComponentModel _model;
|
||||||
|
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'sign_up_template_component_widget.dart'
|
import 'sign_up_template_component_widget.dart' show SignUpTemplateComponentWidget;
|
||||||
show SignUpTemplateComponentWidget;
|
|
||||||
|
|
||||||
class SignUpTemplateComponentModel
|
|
||||||
extends FlutterFlowModel<SignUpTemplateComponentWidget> {
|
|
||||||
|
|
||||||
|
class SignUpTemplateComponentModel extends FlutterFlowModel<SignUpTemplateComponentWidget> {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
FocusNode? nameRegisterFormFocusNode;
|
FocusNode? nameRegisterFormFocusNode;
|
||||||
TextEditingController? nameRegisterFormTextController;
|
TextEditingController? nameRegisterFormTextController;
|
||||||
|
@ -80,7 +77,4 @@ class SignUpTemplateComponentModel
|
||||||
passwordRegisterFormFocusNode?.dispose();
|
passwordRegisterFormFocusNode?.dispose();
|
||||||
passwordRegisterFormTextController?.dispose();
|
passwordRegisterFormTextController?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,8 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_animations.dart';
|
import '/flutter_flow/flutter_flow_animations.dart';
|
||||||
|
@ -22,14 +23,14 @@ class SignUpTemplateComponentWidget extends StatefulWidget {
|
||||||
{super.key, required this.toggleSignInPage});
|
{super.key, required this.toggleSignInPage});
|
||||||
final Future Function()? toggleSignInPage;
|
final Future Function()? toggleSignInPage;
|
||||||
@override
|
@override
|
||||||
State<SignUpTemplateComponentWidget> createState() =>
|
State<SignUpTemplateComponentWidget> createState() => _SignUpTemplateComponentWidgetState();
|
||||||
_SignUpTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SignUpTemplateComponentWidgetState
|
class _SignUpTemplateComponentWidgetState
|
||||||
extends State<SignUpTemplateComponentWidget> with TickerProviderStateMixin {
|
extends State<SignUpTemplateComponentWidget> with TickerProviderStateMixin {
|
||||||
late SignUpTemplateComponentModel _model;
|
late SignUpTemplateComponentModel _model;
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
late String _deviceType;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
|
@ -87,6 +88,12 @@ class _SignUpTemplateComponentWidgetState
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initialize() async {
|
||||||
|
_deviceType = (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -112,13 +119,11 @@ class _SignUpTemplateComponentWidgetState
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ValidatorUtil.isValidEmail(
|
if (!ValidatorUtil.isValidEmail(_model.emailRegisterFormTextController.text)) {
|
||||||
_model.emailRegisterFormTextController.text)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ValidatorUtil.isValidPassword(
|
if (!ValidatorUtil.isValidPassword(_model.passwordRegisterFormTextController.text)) {
|
||||||
_model.passwordRegisterFormTextController.text)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,8 +202,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
maxWidth: 570.0,
|
maxWidth: 570.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
.primaryBackground,
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -207,107 +211,64 @@ class _SignUpTemplateComponentWidgetState
|
||||||
padding: const EdgeInsets.all(32.0),
|
padding: const EdgeInsets.all(32.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Form(
|
Form(
|
||||||
key: _model.formKey,
|
key: _model.formKey,
|
||||||
autovalidateMode:
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
AutovalidateMode.onUserInteraction,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>('nameTextFormField'),
|
||||||
'nameTextFormField'),
|
controller: _model.nameRegisterFormTextController,
|
||||||
controller: _model
|
focusNode: _model.nameRegisterFormFocusNode,
|
||||||
.nameRegisterFormTextController,
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
focusNode: _model
|
|
||||||
.nameRegisterFormFocusNode,
|
|
||||||
onChanged: (_) =>
|
|
||||||
EasyDebounce.debounce(
|
|
||||||
'_model.nameRegisterFormTextController',
|
'_model.nameRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
autofillHints: const [
|
autofillHints: const [AutofillHints.name],
|
||||||
AutofillHints.name
|
|
||||||
],
|
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(
|
|
||||||
context)
|
|
||||||
.getText(
|
|
||||||
'3corpwhd' /* Nome */,
|
'3corpwhd' /* Nome */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme
|
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||||
.of(context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.labelLarge
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.customColor1,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder:
|
focusedBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).success,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.success,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorBorder:
|
errorBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.error,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
|
@ -323,146 +284,83 @@ class _SignUpTemplateComponentWidgetState
|
||||||
focusedErrorBorder:
|
focusedErrorBorder:
|
||||||
OutlineInputBorder(
|
OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.error,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor:
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryBackground,
|
|
||||||
suffixIcon: Icon(
|
suffixIcon: Icon(
|
||||||
Icons.person,
|
Icons.person,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.accent1,
|
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.bodyLarge
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
useGoogleFonts:
|
||||||
useGoogleFonts: GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model
|
validator: _model.nameRegisterFormTextControllerValidator
|
||||||
.nameRegisterFormTextControllerValidator
|
|
||||||
.asValidator(context),
|
.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>('emailTextFormField'),
|
||||||
'emailTextFormField'),
|
controller: _model.emailRegisterFormTextController,
|
||||||
controller: _model
|
focusNode: _model.emailRegisterFormFocusNode,
|
||||||
.emailRegisterFormTextController,
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
focusNode: _model
|
|
||||||
.emailRegisterFormFocusNode,
|
|
||||||
onChanged: (_) =>
|
|
||||||
EasyDebounce.debounce(
|
|
||||||
'_model.emailRegisterFormTextController',
|
'_model.emailRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
autofillHints: const [
|
autofillHints: const [AutofillHints.email],
|
||||||
AutofillHints.email
|
|
||||||
],
|
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(
|
|
||||||
context)
|
|
||||||
.getText(
|
|
||||||
'80wonb69' /* Email */,
|
'80wonb69' /* Email */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme
|
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||||
.of(context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.labelLarge
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder:
|
focusedBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).success,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.success,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorBorder:
|
errorBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.error,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
|
@ -478,147 +376,84 @@ class _SignUpTemplateComponentWidgetState
|
||||||
focusedErrorBorder:
|
focusedErrorBorder:
|
||||||
OutlineInputBorder(
|
OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).error,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.error,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor:
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryBackground,
|
|
||||||
suffixIcon: Icon(
|
suffixIcon: Icon(
|
||||||
Icons.email,
|
Icons.email,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.accent1,
|
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.bodyLarge
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.customColor1,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
useGoogleFonts:
|
||||||
useGoogleFonts: GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType
|
keyboardType: TextInputType.emailAddress,
|
||||||
.emailAddress,
|
validator: _model.emailRegisterFormTextControllerValidator
|
||||||
validator: _model
|
|
||||||
.emailRegisterFormTextControllerValidator
|
|
||||||
.asValidator(context),
|
.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>('passwordTextFormField'),
|
||||||
'passwordTextFormField'),
|
controller: _model.passwordRegisterFormTextController,
|
||||||
controller: _model
|
focusNode: _model.passwordRegisterFormFocusNode,
|
||||||
.passwordRegisterFormTextController,
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
focusNode: _model
|
|
||||||
.passwordRegisterFormFocusNode,
|
|
||||||
onChanged: (_) =>
|
|
||||||
EasyDebounce.debounce(
|
|
||||||
'_model.passwordRegisterFormTextController',
|
'_model.passwordRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
autofillHints: const [
|
autofillHints: const [AutofillHints.password],
|
||||||
AutofillHints.password
|
obscureText: !_model.passwordRegisterFormVisibility,
|
||||||
],
|
|
||||||
obscureText: !_model
|
|
||||||
.passwordRegisterFormVisibility,
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(
|
|
||||||
context)
|
|
||||||
.getText(
|
|
||||||
'0firji8l' /* Senha */,
|
'0firji8l' /* Senha */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme
|
labelStyle: FlutterFlowTheme.of(context).labelLarge.override(
|
||||||
.of(context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.labelLarge
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.customColor1,
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder:
|
focusedBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
borderSide: const BorderSide(
|
||||||
borderSide:
|
color: Color(0xFF1AAB5F),
|
||||||
const BorderSide(
|
|
||||||
color:
|
|
||||||
Color(0xFF1AAB5F),
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorBorder:
|
errorBorder: OutlineInputBorder(
|
||||||
OutlineInputBorder(
|
borderSide: const BorderSide(
|
||||||
borderSide:
|
color: Color(0xFFFF5963),
|
||||||
const BorderSide(
|
|
||||||
color:
|
|
||||||
Color(0xFFFF5963),
|
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
|
@ -639,62 +474,38 @@ class _SignUpTemplateComponentWidgetState
|
||||||
Color(0xFFFF5963),
|
Color(0xFFFF5963),
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(
|
|
||||||
12.0),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor:
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryBackground,
|
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
key: const ValueKey<
|
key: const ValueKey<
|
||||||
String>(
|
String>(
|
||||||
'passwordVisibilitySuffixIcon'),
|
'passwordVisibilitySuffixIcon'),
|
||||||
onTap: () => setState(
|
onTap: () => setState(
|
||||||
() => _model
|
() => _model.passwordRegisterFormVisibility =
|
||||||
.passwordRegisterFormVisibility =
|
!_model.passwordRegisterFormVisibility,
|
||||||
!_model
|
|
||||||
.passwordRegisterFormVisibility,
|
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
skipTraversal: true),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_model.passwordRegisterFormVisibility
|
_model.passwordRegisterFormVisibility
|
||||||
? Icons
|
? Icons.visibility_outlined
|
||||||
.visibility_outlined
|
: Icons.visibility_off_outlined,
|
||||||
: Icons
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
.visibility_off_outlined,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.accent1,
|
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.bodyLarge
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w500,
|
||||||
FontWeight.w500,
|
useGoogleFonts:
|
||||||
useGoogleFonts: GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
validator: _model
|
validator: _model.passwordRegisterFormTextControllerValidator
|
||||||
.passwordRegisterFormTextControllerValidator
|
|
||||||
.asValidator(context),
|
.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -703,8 +514,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>(
|
||||||
'SubmitButtonWidget'),
|
'SubmitButtonWidget'),
|
||||||
|
@ -712,24 +522,16 @@ class _SignUpTemplateComponentWidgetState
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
var shouldSetState = false;
|
var shouldSetState = false;
|
||||||
_model.register =
|
_model.register = await AuthenticationService.signUp(
|
||||||
await AuthenticationService
|
|
||||||
.signUp(
|
|
||||||
context,
|
context,
|
||||||
email: _model
|
email: _model.emailRegisterFormTextController.text,
|
||||||
.emailRegisterFormTextController
|
name: _model.nameRegisterFormTextController.text,
|
||||||
.text,
|
passwd: _model.passwordRegisterFormTextController.text,
|
||||||
name: _model
|
device: _deviceType,
|
||||||
.nameRegisterFormTextController
|
|
||||||
.text,
|
|
||||||
passwd: _model
|
|
||||||
.passwordRegisterFormTextController
|
|
||||||
.text,
|
|
||||||
device: StorageUtil()
|
|
||||||
.deviceType,
|
|
||||||
);
|
);
|
||||||
shouldSetState = true;
|
shouldSetState = true;
|
||||||
if (_model.register == true)
|
if (_model.register == true)
|
||||||
|
|
||||||
await widget
|
await widget
|
||||||
.toggleSignInPage
|
.toggleSignInPage
|
||||||
?.call();
|
?.call();
|
||||||
|
@ -741,48 +543,30 @@ class _SignUpTemplateComponentWidgetState
|
||||||
if (shouldSetState)
|
if (shouldSetState)
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText(
|
||||||
.getText(
|
|
||||||
'rnvdwzei' /* Cadastrar-se */,
|
'rnvdwzei' /* Cadastrar-se */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
const EdgeInsetsDirectional
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
.fromSTEB(
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
0.0, 0.0, 0.0, 0.0),
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.accent1,
|
|
||||||
textStyle: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.secondaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(12.0),
|
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||||
disabledColor:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.customColor5,
|
|
||||||
disabledTextColor: Colors.white,
|
disabledTextColor: Colors.white,
|
||||||
),
|
),
|
||||||
showLoadingIndicator: true,
|
showLoadingIndicator: true,
|
||||||
|
@ -791,8 +575,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
|
|
||||||
// You will have to add an action on this rich text to go to your login page.
|
// You will have to add an action on this rich text to go to your login page.
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||||
.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>(
|
||||||
'toggleSignInPage'),
|
'toggleSignInPage'),
|
||||||
|
@ -804,66 +587,39 @@ class _SignUpTemplateComponentWidgetState
|
||||||
.toggleSignInPage
|
.toggleSignInPage
|
||||||
?.call(),
|
?.call(),
|
||||||
child: RichText(
|
child: RichText(
|
||||||
textScaler: MediaQuery.of(context)
|
textScaler: MediaQuery.of(context).textScaler,
|
||||||
.textScaler,
|
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: FFLocalizations.of(
|
text: FFLocalizations.of(context).getText(
|
||||||
context)
|
|
||||||
.getText(
|
|
||||||
'a9smhn5b' /* Você já tem uma conta? */,
|
'a9smhn5b' /* Você já tem uma conta? */,
|
||||||
),
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: FlutterFlowTheme.of(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: FFLocalizations.of(
|
text: FFLocalizations.of(context).getText(
|
||||||
context)
|
|
||||||
.getText(
|
|
||||||
'09xv5ctc' /* Clique aqui */,
|
'09xv5ctc' /* Clique aqui */,
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
context)
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
.bodyMedium
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primary,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight:
|
fontWeight: FontWeight.w600,
|
||||||
FontWeight.w600,
|
useGoogleFonts:
|
||||||
useGoogleFonts: GoogleFonts
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
style:
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.bodyMedium
|
letterSpacing: 0.0,
|
||||||
.override(
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
fontFamily:
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(
|
),
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -873,8 +629,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).animateOnPageLoad(
|
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||||
animationsMap['containerOnPageLoadAnimation']!),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -36,9 +37,10 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -85,23 +85,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
_model.textController1 = TextEditingController(
|
_model.textController1 =
|
||||||
text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??=
|
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||||
TextEditingController(text: widget.visitStartDate);
|
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??=
|
_model.textController4 ??= TextEditingController(text: widget.visitReasonStr);
|
||||||
TextEditingController(text: widget.visitReasonStr);
|
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
_model.textFieldFocusNode4 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController5 ??=
|
_model.textController5 ??= TextEditingController(text: widget.visitLevelStr);
|
||||||
TextEditingController(text: widget.visitLevelStr);
|
|
||||||
_model.textFieldFocusNode5 ??= FocusNode();
|
_model.textFieldFocusNode5 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||||
|
@ -117,8 +114,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var filteredVisitorJsonList =
|
var filteredVisitorJsonList = findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
||||||
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
||||||
|
@ -154,8 +150,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(1.0, 0.0),
|
alignment: const AlignmentDirectional(1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 15.0, 0.0),
|
||||||
15.0, 0.0, 15.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
|
@ -184,8 +179,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 20.0),
|
||||||
0.0, 0.0, 20.0, 20.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
|
@ -225,10 +219,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration:
|
fadeInDuration: const Duration(milliseconds: 500),
|
||||||
const Duration(milliseconds: 500),
|
fadeOutDuration: const Duration(milliseconds: 500),
|
||||||
fadeOutDuration:
|
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
imageUrl: valueOrDefault<String>(
|
imageUrl: valueOrDefault<String>(
|
||||||
widget.visitorImgPath,
|
widget.visitorImgPath,
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
'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(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0),
|
||||||
8.0, 0.0, 8.0, 10.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
@ -262,27 +253,19 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'9yu35pzg' /* Encerramento da Visita */,
|
'9yu35pzg' /* Encerramento da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -314,29 +297,24 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController1Validator
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController2,
|
controller: _model.textController2,
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
|
@ -350,34 +328,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'aj6scczp' /* Início */,
|
'aj6scczp' /* Início */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ub084nhy' /* dd/mm/yyyy */,
|
'ub084nhy' /* dd/mm/yyyy */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -408,27 +374,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController2Validator
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -442,34 +401,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'rvi5z7wg' /* Término */,
|
'rvi5z7wg' /* Término */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ixs67mrz' /* dd/mm/yyyy */,
|
'ixs67mrz' /* dd/mm/yyyy */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -500,20 +447,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController3Validator
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -521,16 +462,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
|
@ -544,34 +483,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'yxilg7ek' /* Motivo da Visita */,
|
'yxilg7ek' /* Motivo da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ypeydbem' /* Motivo */,
|
'ypeydbem' /* Motivo */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -602,27 +529,20 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController4Validator
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController5,
|
controller: _model.textController5,
|
||||||
focusNode: _model.textFieldFocusNode5,
|
focusNode: _model.textFieldFocusNode5,
|
||||||
|
@ -636,34 +556,22 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'dgr3pk3a' /* Nível de Acesso */,
|
'dgr3pk3a' /* Nível de Acesso */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'rs3d4gb8' /* Nível de Acesso */,
|
'rs3d4gb8' /* Nível de Acesso */,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -694,20 +602,14 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController5Validator
|
validator: _model.textController5Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -717,8 +619,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController6,
|
controller: _model.textController6,
|
||||||
focusNode: _model.textFieldFocusNode6,
|
focusNode: _model.textFieldFocusNode6,
|
||||||
|
@ -732,27 +633,19 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'lppn9rxa' /* Observações da Visita */,
|
'lppn9rxa' /* Observações da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -784,15 +677,12 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController6Validator
|
validator: _model.textController6Validator.asValidator(context),
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -817,8 +707,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.deleteVisit =
|
_model.deleteVisit = await PhpGroup.deleteVisitCall.call(
|
||||||
await PhpGroup.deleteVisitCall.call(
|
|
||||||
idVisita: widget.visitIdStr,
|
idVisita: widget.visitIdStr,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -828,8 +717,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
false) {
|
false) {
|
||||||
context.pop();
|
context.pop();
|
||||||
} else {
|
} else {
|
||||||
final error =
|
final error = await DialogUtil.errorDefault(context);
|
||||||
await DialogUtil.errorDefault(context);
|
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
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/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/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';
|
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';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class VisitDetailsModalTemplateComponentModel
|
class VisitDetailsModalTemplateComponentModel extends FlutterFlowModel<VisitDetailsModalTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<VisitDetailsModalTemplateComponentWidget> {
|
|
||||||
/// Local state fields for this component.
|
/// Local state fields for this component.
|
||||||
|
|
||||||
Color statusColor = const Color(0xff000000);
|
Color statusColor = const Color(0xff000000);
|
||||||
|
@ -23,8 +20,7 @@ class VisitDetailsModalTemplateComponentModel
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {
|
void initState(BuildContext context) {
|
||||||
viewVisitDetailModel = createModel(context, () => ViewVisitDetailModel());
|
viewVisitDetailModel = createModel(context, () => ViewVisitDetailModel());
|
||||||
scheduleVisitDetailModel =
|
scheduleVisitDetailModel = createModel(context, () => ScheduleVisitDetailModel());
|
||||||
createModel(context, () => ScheduleVisitDetailModel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.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';
|
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;
|
final Color? visitStatusColor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitDetailsModalTemplateComponentWidget> createState() =>
|
State<VisitDetailsModalTemplateComponentWidget> createState() => _VisitDetailsModalTemplateComponentWidgetState();
|
||||||
_VisitDetailsModalTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitDetailsModalTemplateComponentWidgetState
|
class _VisitDetailsModalTemplateComponentWidgetState extends State<VisitDetailsModalTemplateComponentWidget> {
|
||||||
extends State<VisitDetailsModalTemplateComponentWidget> {
|
|
||||||
late VisitDetailsModalTemplateComponentModel _model;
|
late VisitDetailsModalTemplateComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -59,8 +56,7 @@ class _VisitDetailsModalTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model =
|
_model = createModel(context, () => VisitDetailsModalTemplateComponentModel());
|
||||||
createModel(context, () => VisitDetailsModalTemplateComponentModel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'visitor_details_modal_template_component_widget.dart'
|
import 'visitor_details_modal_template_component_widget.dart' show VisitorDetailsModalTemplateComponentWidget;
|
||||||
show VisitorDetailsModalTemplateComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class VisitorDetailsModalTemplateComponentModel
|
class VisitorDetailsModalTemplateComponentModel extends FlutterFlowModel<VisitorDetailsModalTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<VisitorDetailsModalTemplateComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,10 @@ class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
||||||
final String? visitorEmail;
|
final String? visitorEmail;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
State<VisitorDetailsModalTemplateComponentWidget> createState() => _VisitorDetailsModalTemplateComponentWidgetState();
|
||||||
_VisitorDetailsModalTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitorDetailsModalTemplateComponentWidgetState
|
class _VisitorDetailsModalTemplateComponentWidgetState extends State<VisitorDetailsModalTemplateComponentWidget> {
|
||||||
extends State<VisitorDetailsModalTemplateComponentWidget> {
|
|
||||||
late VisitorDetailsModalTemplateComponentModel _model;
|
late VisitorDetailsModalTemplateComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -42,8 +40,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model =
|
_model = createModel(context, () => VisitorDetailsModalTemplateComponentModel());
|
||||||
createModel(context, () => VisitorDetailsModalTemplateComponentModel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -85,8 +82,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0),
|
||||||
10.0, 5.0, 15.0, 0.0),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -107,21 +103,18 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0),
|
||||||
20.0, 40.0, 20.0, 0.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
0.0, 10.0, 0.0, 0.0),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (widget.visitorImageURL != '' &&
|
if (widget.visitorImageURL != '' && widget.visitorImageURL != null)
|
||||||
widget.visitorImageURL != null)
|
|
||||||
Container(
|
Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
|
@ -137,23 +130,17 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||||
20.0, 0.0, 20.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.visitorName ?? '',
|
widget.visitorName ?? '',
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -161,24 +148,18 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 30.0),
|
||||||
20.0, 0.0, 20.0, 30.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'hz7ivuqn' /* Tipo de Visitante */,
|
'hz7ivuqn' /* Tipo de Visitante */,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -192,28 +173,20 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||||
20.0, 0.0, 20.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'rwqn0det' /* (00) 0 0000-0000 */,
|
'rwqn0det' /* (00) 0 0000-0000 */,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -229,28 +202,20 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||||
20.0, 0.0, 20.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'0wqbiekp' /* email@provider.etc */,
|
'0wqbiekp' /* email@provider.etc */,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
class VisitorSearchModalTemplateComponentModel
|
class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -14,18 +14,15 @@ class VisitorSearchModalTemplateComponentModel
|
||||||
void addToVisitors(dynamic item) => visitors.add(item);
|
void addToVisitors(dynamic item) => visitors.add(item);
|
||||||
void removeFromVisitors(dynamic item) => visitors.remove(item);
|
void removeFromVisitors(dynamic item) => visitors.remove(item);
|
||||||
void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
|
void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
|
||||||
void insertAtIndexInVisitors(int index, dynamic item) =>
|
void insertAtIndexInVisitors(int index, dynamic item) => visitors.insert(index, item);
|
||||||
visitors.insert(index, item);
|
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => visitors[index] = updateFn(visitors[index]);
|
||||||
void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) =>
|
|
||||||
visitors[index] = updateFn(visitors[index]);
|
|
||||||
|
|
||||||
List<String> docs = [];
|
List<String> docs = [];
|
||||||
void addToDocs(String item) => docs.add(item);
|
void addToDocs(String item) => docs.add(item);
|
||||||
void removeFromDocs(String item) => docs.remove(item);
|
void removeFromDocs(String item) => docs.remove(item);
|
||||||
void removeAtIndexFromDocs(int index) => docs.removeAt(index);
|
void removeAtIndexFromDocs(int index) => docs.removeAt(index);
|
||||||
void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
|
void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
|
||||||
void updateDocsAtIndex(int index, Function(String) updateFn) =>
|
void updateDocsAtIndex(int index, Function(String) updateFn) => docs[index] = updateFn(docs[index]);
|
||||||
docs[index] = updateFn(docs[index]);
|
|
||||||
|
|
||||||
FocusNode? textFieldFocusNode;
|
FocusNode? textFieldFocusNode;
|
||||||
TextEditingController? textController;
|
TextEditingController? textController;
|
||||||
|
@ -38,9 +35,10 @@ class VisitorSearchModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = StorageUtil().devUUID;
|
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
userUUID = StorageUtil().userUUID;
|
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
cliUUID = StorageUtil().cliUUID;
|
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -27,12 +27,10 @@ class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function(List<String>? docsParam)? getDocs;
|
final Future Function(List<String>? docsParam)? getDocs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitorSearchModalTemplateComponentWidget> createState() =>
|
State<VisitorSearchModalTemplateComponentWidget> createState() => _VisitorSearchModalTemplateComponentWidgetState();
|
||||||
_VisitorSearchModalTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitorSearchModalTemplateComponentWidgetState
|
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget>
|
||||||
extends State<VisitorSearchModalTemplateComponentWidget>
|
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late VisitorSearchModalTemplateComponentModel _model;
|
late VisitorSearchModalTemplateComponentModel _model;
|
||||||
|
|
||||||
|
@ -44,8 +42,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model =
|
_model = createModel(context, () => VisitorSearchModalTemplateComponentModel());
|
||||||
createModel(context, () => VisitorSearchModalTemplateComponentModel());
|
|
||||||
|
|
||||||
_model.textController ??= TextEditingController();
|
_model.textController ??= TextEditingController();
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
@ -90,8 +87,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 25.0, 16.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 25.0, 16.0, 0.0),
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController,
|
controller: _model.textController,
|
||||||
focusNode: _model.textFieldFocusNode,
|
focusNode: _model.textFieldFocusNode,
|
||||||
|
@ -109,82 +105,57 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
ptText: 'Documento do Visitante',
|
ptText: 'Documento do Visitante',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).accent1, width: 0.5),
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0),
|
||||||
bottomRight: Radius.circular(15.0),
|
bottomRight: Radius.circular(15.0),
|
||||||
topLeft: Radius.circular(15.0),
|
topLeft: Radius.circular(15.0),
|
||||||
topRight: Radius.circular(15.0),
|
topRight: Radius.circular(15.0)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).primary, width: 0.5),
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0),
|
||||||
bottomRight: Radius.circular(15.0),
|
bottomRight: Radius.circular(15.0),
|
||||||
topLeft: Radius.circular(15.0),
|
topLeft: Radius.circular(15.0),
|
||||||
topRight: Radius.circular(15.0),
|
topRight: Radius.circular(15.0)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0),
|
||||||
bottomRight: Radius.circular(15.0),
|
bottomRight: Radius.circular(15.0),
|
||||||
topLeft: Radius.circular(15.0),
|
topLeft: Radius.circular(15.0),
|
||||||
topRight: Radius.circular(15.0),
|
topRight: Radius.circular(15.0)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0),
|
||||||
bottomRight: Radius.circular(15.0),
|
bottomRight: Radius.circular(15.0),
|
||||||
topLeft: Radius.circular(15.0),
|
topLeft: Radius.circular(15.0),
|
||||||
topRight: Radius.circular(15.0),
|
topRight: Radius.circular(15.0)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
prefixIcon: Icon(
|
prefixIcon: Icon(Icons.search_outlined, color: FlutterFlowTheme.of(context).accent1),
|
||||||
Icons.search_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
keyboardType:
|
keyboardType: const TextInputType.numberWithOptions(signed: true),
|
||||||
const TextInputType.numberWithOptions(signed: true),
|
|
||||||
validator: _model.textControllerValidator.asValidator(context),
|
validator: _model.textControllerValidator.asValidator(context),
|
||||||
inputFormatters: [
|
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_model.visitors.isNotEmpty && _model.visitors.isNotEmpty)
|
if (_model.visitors.isNotEmpty && _model.visitors.isNotEmpty)
|
||||||
|
@ -193,34 +164,28 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0),
|
||||||
16.0, 12.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText('9coywebh'),
|
||||||
'9coywebh' /* Visitantes encontrados */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0),
|
||||||
4.0, 12.0, 16.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
_model.visitors.length.toString(),
|
_model.visitors.length.toString(),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -232,12 +197,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (_model.visitors.isNotEmpty) {
|
if (_model.visitors.isNotEmpty) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0),
|
||||||
8.0, 8.0, 8.0, 0.0),
|
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final visitor =
|
final visitor = _model.visitors.map((e) => e).toList();
|
||||||
_model.visitors.map((e) => e).toList();
|
|
||||||
final doc = _model.docs.map((e) => e).toList();
|
final doc = _model.docs.map((e) => e).toList();
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
@ -247,8 +210,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
final visitorItem = visitor[visitorIndex];
|
final visitorItem = visitor[visitorIndex];
|
||||||
final docItem = doc[visitorIndex];
|
final docItem = doc[visitorIndex];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 1.0),
|
||||||
0.0, 0.0, 0.0, 1.0),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -257,24 +219,19 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
.primaryBackground,
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(40.0),
|
||||||
BorderRadius.circular(40.0),
|
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration: const Duration(
|
fadeInDuration: const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
fadeOutDuration: const Duration(milliseconds: 500),
|
||||||
fadeOutDuration: const Duration(
|
|
||||||
milliseconds: 500),
|
|
||||||
imageUrl:
|
imageUrl:
|
||||||
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
visitorItem,
|
visitorItem,
|
||||||
|
@ -288,39 +245,21 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
12.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
getJsonField(
|
getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(),
|
||||||
visitorItem,
|
|
||||||
r'''$.VTE_NOME''',
|
|
||||||
)?.toString(),
|
|
||||||
'NOT FOUND',
|
'NOT FOUND',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
context)
|
fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily,
|
||||||
.bodyLarge
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyLargeFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
.asMap()
|
FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyLargeFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -332,16 +271,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(
|
icon: Icon(Icons.close,
|
||||||
Icons.close,
|
color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.customColor6,
|
|
||||||
size: 20.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.removeFromVisitors(
|
_model.removeFromVisitors(visitorItem);
|
||||||
visitorItem);
|
|
||||||
_model.removeFromDocs(docItem);
|
_model.removeFromDocs(docItem);
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
},
|
},
|
||||||
|
@ -361,9 +294,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
return Container(
|
return Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground),
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -375,14 +306,8 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
children: [
|
children: [
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
onPressed: MediaQuery.of(context).viewInsets.bottom > 0
|
onPressed: MediaQuery.of(context).viewInsets.bottom > 0
|
||||||
? () async {
|
? () async => await addVisitor(context).whenComplete(safeSetState(() {}))
|
||||||
await addVisitor(context);
|
: () async => await sendVisitors(context),
|
||||||
|
|
||||||
safeSetState(() {});
|
|
||||||
}
|
|
||||||
: () async {
|
|
||||||
await sendVisitors(context);
|
|
||||||
},
|
|
||||||
text: MediaQuery.of(context).viewInsets.bottom > 0
|
text: MediaQuery.of(context).viewInsets.bottom > 0
|
||||||
? FFLocalizations.of(context).getVariableText(
|
? FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Add',
|
enText: 'Add',
|
||||||
|
@ -401,32 +326,25 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
0.0, 0.0, 0.0, 0.0),
|
0.0, 0.0, 0.0, 0.0),
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts:
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
color: Colors.transparent,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15),
|
bottomLeft: Radius.circular(15),
|
||||||
bottomRight: Radius.circular(15),
|
bottomRight: Radius.circular(15),
|
||||||
topLeft: Radius.circular(15),
|
topLeft: Radius.circular(15),
|
||||||
topRight: Radius.circular(15),
|
topRight: Radius.circular(15)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(height: 30.0)
|
||||||
height: 30.0,
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -434,9 +352,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> sendVisitors(BuildContext context) async {
|
Future<void> sendVisitors(BuildContext context) async {
|
||||||
await widget.getVisitors?.call(
|
await widget.getVisitors?.call(_model.visitors);
|
||||||
_model.visitors,
|
|
||||||
);
|
|
||||||
log('() => docs: ${_model.docs}');
|
log('() => docs: ${_model.docs}');
|
||||||
await widget.getDocs?.call(_model.docs);
|
await widget.getDocs?.call(_model.docs);
|
||||||
context.pop();
|
context.pop();
|
||||||
|
@ -445,37 +361,25 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
Future<void> addVisitor(BuildContext context) async {
|
Future<void> addVisitor(BuildContext context) async {
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
_model.textController?.text = _model.textController.text;
|
_model.textController?.text = _model.textController.text;
|
||||||
_model.textController?.selection =
|
_model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length);
|
||||||
TextSelection.collapsed(offset: _model.textController!.text.length);
|
|
||||||
});
|
});
|
||||||
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(
|
_model.getVisitorByDoc =
|
||||||
documento: _model.textController.text,
|
await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||||
);
|
|
||||||
|
|
||||||
if (PhpGroup.getVisitorByDocCall.vistanteId(
|
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' &&
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false &&
|
||||||
) !=
|
PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != null) {
|
||||||
'0' &&
|
String newDoc = _model.textController.text.replaceFirst(RegExp(r'^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);
|
bool existDoc = _model.docs.contains(newDoc);
|
||||||
if (existDoc == false) {
|
if (existDoc == false) {
|
||||||
_model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante(
|
_model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante((_model.getVisitorByDoc?.jsonBody ?? '')));
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
|
||||||
));
|
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
_model.addToDocs(_model.textController.text);
|
_model.addToDocs(_model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
} else if (existDoc == true) {
|
} else if (existDoc == true) {
|
||||||
ToastUtil.showToast(
|
ToastUtil.showToast(
|
||||||
message: FFLocalizations.of(context).getVariableText(
|
message: FFLocalizations.of(context)
|
||||||
ptText: 'Visitante já adicionado!',
|
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||||
enText: 'Visitor already added!'),
|
|
||||||
gravity: ToastGravity.TOP,
|
gravity: ToastGravity.TOP,
|
||||||
backgroundColor: Colors.red);
|
backgroundColor: Colors.red);
|
||||||
}
|
}
|
||||||
|
@ -485,9 +389,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: VisitorNotFoundComponentWidget(
|
child: VisitorNotFoundComponentWidget(doc: _model.textController.text),
|
||||||
doc: _model.textController.text,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {
|
).then((value) => safeSetState(() {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'welcome_template_component_widget.dart'
|
import 'welcome_template_component_widget.dart' show WelcomeTemplateComponentWidget;
|
||||||
show WelcomeTemplateComponentWidget;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class WelcomeTemplateComponentModel
|
class WelcomeTemplateComponentModel extends FlutterFlowModel<WelcomeTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<WelcomeTemplateComponentWidget> {
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,7 @@ class WelcomeTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? toggleSignInPage;
|
final Future Function()? toggleSignInPage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<WelcomeTemplateComponentWidget> createState() =>
|
State<WelcomeTemplateComponentWidget> createState() => _WelcomeTemplateComponentWidgetState();
|
||||||
_WelcomeTemplateComponentWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _WelcomeTemplateComponentWidgetState
|
class _WelcomeTemplateComponentWidgetState
|
||||||
|
@ -200,8 +199,7 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.toggleSignInPage?.call();
|
await widget.toggleSignInPage?.call();
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText('dynet730' /* Entrar */),
|
||||||
.getText('dynet730' /* Entrar */),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
|
@ -217,67 +215,45 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
.titleSmall
|
.titleSmall
|
||||||
.override(
|
.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color:
|
color: FlutterFlowTheme.of(context).info,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.info,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(12.0),
|
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>('toggleSignUpPage'),
|
||||||
'toggleSignUpPage'),
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.toggleSignUpPage?.call();
|
await widget.toggleSignUpPage?.call();
|
||||||
},
|
},
|
||||||
text:
|
text: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'hha60cg7' /* Cadastrar */,
|
'hha60cg7' /* Cadastrar */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
color: FlutterFlowTheme.of(context).customColor1,
|
||||||
const EdgeInsetsDirectional
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.customColor1,
|
|
||||||
textStyle: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
|
@ -285,8 +261,7 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(12.0),
|
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: false,
|
||||||
),
|
),
|
||||||
|
@ -296,13 +271,11 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
} else {
|
} else {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>(
|
||||||
'toggleSignInPage'),
|
'toggleSignInPage'),
|
||||||
|
@ -310,45 +283,29 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
await widget.toggleSignInPage
|
await widget.toggleSignInPage
|
||||||
?.call();
|
?.call();
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText(
|
||||||
.getText(
|
|
||||||
'zvtay8ee' /* Entrar */,
|
'zvtay8ee' /* Entrar */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
const EdgeInsetsDirectional
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
.fromSTEB(
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
0.0, 0.0, 0.0, 0.0),
|
color: FlutterFlowTheme.of(context).info,
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
textStyle: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.info,
|
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(12.0),
|
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: false,
|
||||||
),
|
),
|
||||||
|
@ -356,54 +313,36 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>(
|
key: const ValueKey<String>(
|
||||||
'toggleSignUpPage'),
|
'toggleSignUpPage'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.toggleSignUpPage
|
await widget.toggleSignUpPage?.call();
|
||||||
?.call();
|
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context).getText(
|
||||||
.getText(
|
|
||||||
'o6zob50a' /* Cadastrar */,
|
'o6zob50a' /* Cadastrar */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
const EdgeInsetsDirectional
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
.fromSTEB(
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
0.0, 0.0, 0.0, 0.0),
|
color: FlutterFlowTheme.of(context).info,
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
textStyle: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.info,
|
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
'Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
BorderRadius.circular(12.0),
|
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: false,
|
||||||
),
|
),
|
||||||
|
@ -418,8 +357,7 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).animateOnPageLoad(
|
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||||
animationsMap['containerOnPageLoadAnimation']!),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// File generated by FlutterFire CLI.
|
// File generated by FlutterFire CLI.
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||||
import 'package:flutter/foundation.dart'
|
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
|
||||||
|
|
||||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||||
///
|
///
|
||||||
|
@ -73,10 +72,8 @@ class DefaultFirebaseOptions {
|
||||||
projectId: 'accessmoblie-da839',
|
projectId: 'accessmoblie-da839',
|
||||||
databaseURL: 'https://accessmoblie-da839.firebaseio.com',
|
databaseURL: 'https://accessmoblie-da839.firebaseio.com',
|
||||||
storageBucket: 'accessmoblie-da839.appspot.com',
|
storageBucket: 'accessmoblie-da839.appspot.com',
|
||||||
androidClientId:
|
androidClientId: '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com',
|
||||||
'187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com',
|
iosClientId: '187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com',
|
||||||
iosClientId:
|
|
||||||
'187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com',
|
|
||||||
iosBundleId: 'br.com.freaccess.hub',
|
iosBundleId: 'br.com.freaccess.hub',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ class FFIcons {
|
||||||
static const IconData kvector1 = IconData(0xe902, fontFamily: _iconsFamily);
|
static const IconData kvector1 = IconData(0xe902, fontFamily: _iconsFamily);
|
||||||
|
|
||||||
// menu
|
// menu
|
||||||
static const IconData kiconFastPass =
|
static const IconData kiconFastPass = IconData(0xe900, fontFamily: _menuFamily);
|
||||||
IconData(0xe900, fontFamily: _menuFamily);
|
|
||||||
static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily);
|
static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily);
|
||||||
static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily);
|
static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily);
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
|
|
||||||
|
|
||||||
enum AnimationTrigger {
|
enum AnimationTrigger {
|
||||||
onPageLoad,
|
onPageLoad,
|
||||||
onActionTrigger,
|
onActionTrigger,
|
||||||
|
@ -52,12 +51,8 @@ extension AnimatedWidgetExtension on Widget {
|
||||||
return Animate(
|
return Animate(
|
||||||
effects: animationInfo.effects,
|
effects: animationInfo.effects,
|
||||||
child: this,
|
child: this,
|
||||||
onPlay: (controller) => animationInfo.loop
|
onPlay: (controller) => animationInfo.loop ? controller.repeat(reverse: animationInfo.reverse) : null,
|
||||||
? controller.repeat(reverse: animationInfo.reverse)
|
onComplete: (controller) => !animationInfo.loop && animationInfo.reverse ? controller.reverse() : null,
|
||||||
: null,
|
|
||||||
onComplete: (controller) => !animationInfo.loop && animationInfo.reverse
|
|
||||||
? controller.reverse()
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,11 +63,7 @@ extension AnimatedWidgetExtension on Widget {
|
||||||
}) {
|
}) {
|
||||||
animationInfo.maybeUpdateEffects(effects);
|
animationInfo.maybeUpdateEffects(effects);
|
||||||
return hasBeenTriggered || animationInfo.applyInitialState
|
return hasBeenTriggered || animationInfo.applyInitialState
|
||||||
? Animate(
|
? Animate(controller: animationInfo.controller, autoPlay: false, effects: animationInfo.effects, child: this)
|
||||||
controller: animationInfo.controller,
|
|
||||||
autoPlay: false,
|
|
||||||
effects: animationInfo.effects,
|
|
||||||
child: this)
|
|
||||||
: this;
|
: this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,9 @@ import 'package:flutter/gestures.dart' show DragStartBehavior;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const double _kTabHeight = 46.0;
|
const double _kTabHeight = 46.0;
|
||||||
|
|
||||||
typedef _LayoutCallback = void Function(
|
typedef _LayoutCallback = void Function(List<double> xOffsets, TextDirection textDirection, double width);
|
||||||
List<double> xOffsets, TextDirection textDirection, double width);
|
|
||||||
|
|
||||||
class _TabLabelBarRenderer extends RenderFlex {
|
class _TabLabelBarRenderer extends RenderFlex {
|
||||||
_TabLabelBarRenderer({
|
_TabLabelBarRenderer({
|
||||||
|
@ -36,8 +33,7 @@ class _TabLabelBarRenderer extends RenderFlex {
|
||||||
RenderBox? child = firstChild;
|
RenderBox? child = firstChild;
|
||||||
final List<double> xOffsets = <double>[];
|
final List<double> xOffsets = <double>[];
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final FlexParentData childParentData =
|
final FlexParentData childParentData = child.parentData! as FlexParentData;
|
||||||
child.parentData! as FlexParentData;
|
|
||||||
xOffsets.add(childParentData.offset.dx);
|
xOffsets.add(childParentData.offset.dx);
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
|
@ -86,8 +82,7 @@ class _TabLabelBar extends Flex {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void updateRenderObject(
|
void updateRenderObject(BuildContext context, _TabLabelBarRenderer renderObject) {
|
||||||
BuildContext context, _TabLabelBarRenderer renderObject) {
|
|
||||||
super.updateRenderObject(context, renderObject);
|
super.updateRenderObject(context, renderObject);
|
||||||
renderObject.onPerformLayout = onPerformLayout;
|
renderObject.onPerformLayout = onPerformLayout;
|
||||||
}
|
}
|
||||||
|
@ -138,8 +133,7 @@ class _IndicatorPainter extends CustomPainter {
|
||||||
assert(_currentTabOffsets!.isNotEmpty);
|
assert(_currentTabOffsets!.isNotEmpty);
|
||||||
assert(tabIndex >= 0);
|
assert(tabIndex >= 0);
|
||||||
assert(tabIndex <= maxTabIndex);
|
assert(tabIndex <= maxTabIndex);
|
||||||
return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) /
|
return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) / 2.0;
|
||||||
2.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -194,12 +188,10 @@ class _TabBarScrollPosition extends ScrollPositionWithSingleContext {
|
||||||
// ballistic scroll activity.
|
// ballistic scroll activity.
|
||||||
if (!_viewportDimensionWasNonZero || _needsPixelsCorrection) {
|
if (!_viewportDimensionWasNonZero || _needsPixelsCorrection) {
|
||||||
_needsPixelsCorrection = false;
|
_needsPixelsCorrection = false;
|
||||||
correctPixels(tabBar._initialScrollOffset(
|
correctPixels(tabBar._initialScrollOffset(viewportDimension, minScrollExtent, maxScrollExtent));
|
||||||
viewportDimension, minScrollExtent, maxScrollExtent));
|
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
return super.applyContentDimensions(minScrollExtent, maxScrollExtent) &&
|
return super.applyContentDimensions(minScrollExtent, maxScrollExtent) && result;
|
||||||
result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void markNeedsPixelsCorrection() {
|
void markNeedsPixelsCorrection() {
|
||||||
|
@ -215,8 +207,7 @@ class _TabBarScrollController extends ScrollController {
|
||||||
final _FlutterFlowButtonTabBarState tabBar;
|
final _FlutterFlowButtonTabBarState tabBar;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ScrollPosition createScrollPosition(ScrollPhysics physics,
|
ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) {
|
||||||
ScrollContext context, ScrollPosition? oldPosition) {
|
|
||||||
return _TabBarScrollPosition(
|
return _TabBarScrollPosition(
|
||||||
physics: physics,
|
physics: physics,
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -227,8 +218,7 @@ class _TabBarScrollController extends ScrollController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A Flutterflow Design widget that displays a horizontal row of tabs.
|
/// A Flutterflow Design widget that displays a horizontal row of tabs.
|
||||||
class FlutterFlowButtonTabBar extends StatefulWidget
|
class FlutterFlowButtonTabBar extends StatefulWidget implements PreferredSizeWidget {
|
||||||
implements PreferredSizeWidget {
|
|
||||||
/// The [tabs] argument must not be null and its length must match the [controller]'s
|
/// The [tabs] argument must not be null and its length must match the [controller]'s
|
||||||
/// [TabController.length].
|
/// [TabController.length].
|
||||||
///
|
///
|
||||||
|
@ -362,17 +352,14 @@ class FlutterFlowButtonTabBar extends StatefulWidget
|
||||||
maxHeight = math.max(itemHeight, maxHeight);
|
maxHeight = math.max(itemHeight, maxHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Size.fromHeight(
|
return Size.fromHeight(maxHeight + labelPadding.vertical + buttonMargin.vertical);
|
||||||
maxHeight + labelPadding.vertical + buttonMargin.vertical);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FlutterFlowButtonTabBar> createState() =>
|
State<FlutterFlowButtonTabBar> createState() => _FlutterFlowButtonTabBarState();
|
||||||
_FlutterFlowButtonTabBarState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar> with TickerProviderStateMixin {
|
||||||
with TickerProviderStateMixin {
|
|
||||||
ScrollController? _scrollController;
|
ScrollController? _scrollController;
|
||||||
TabController? _controller;
|
TabController? _controller;
|
||||||
_IndicatorPainter? _indicatorPainter;
|
_IndicatorPainter? _indicatorPainter;
|
||||||
|
@ -396,8 +383,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
|
|
||||||
/// The animation duration is 2/3 of the tab scroll animation duration in
|
/// The animation duration is 2/3 of the tab scroll animation duration in
|
||||||
/// Material design (kTabScrollDuration).
|
/// Material design (kTabScrollDuration).
|
||||||
_animationController = AnimationController(
|
_animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 200));
|
||||||
vsync: this, duration: const Duration(milliseconds: 200));
|
|
||||||
|
|
||||||
// so the buttons start in their "final" state (color)
|
// so the buttons start in their "final" state (color)
|
||||||
_animationController
|
_animationController
|
||||||
|
@ -415,8 +401,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
bool get _controllerIsValid => _controller?.animation != null;
|
bool get _controllerIsValid => _controller?.animation != null;
|
||||||
|
|
||||||
void _updateTabController() {
|
void _updateTabController() {
|
||||||
final TabController? newController =
|
final TabController? newController = widget.controller ?? DefaultTabController.maybeOf(context);
|
||||||
widget.controller ?? DefaultTabController.maybeOf(context);
|
|
||||||
assert(() {
|
assert(() {
|
||||||
if (newController == null) {
|
if (newController == null) {
|
||||||
throw FlutterError(
|
throw FlutterError(
|
||||||
|
@ -501,8 +486,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
|
|
||||||
int get maxTabIndex => _indicatorPainter!.maxTabIndex;
|
int get maxTabIndex => _indicatorPainter!.maxTabIndex;
|
||||||
|
|
||||||
double _tabScrollOffset(
|
double _tabScrollOffset(int index, double viewportWidth, double minExtent, double maxExtent) {
|
||||||
int index, double viewportWidth, double minExtent, double maxExtent) {
|
|
||||||
if (!widget.isScrollable) {
|
if (!widget.isScrollable) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
@ -518,34 +502,27 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return clampDouble(
|
return clampDouble(tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent);
|
||||||
tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double _tabCenteredScrollOffset(int index) {
|
double _tabCenteredScrollOffset(int index) {
|
||||||
final ScrollPosition position = _scrollController!.position;
|
final ScrollPosition position = _scrollController!.position;
|
||||||
return _tabScrollOffset(index, position.viewportDimension,
|
return _tabScrollOffset(index, position.viewportDimension, position.minScrollExtent, position.maxScrollExtent);
|
||||||
position.minScrollExtent, position.maxScrollExtent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double _initialScrollOffset(
|
double _initialScrollOffset(double viewportWidth, double minExtent, double maxExtent) {
|
||||||
double viewportWidth, double minExtent, double maxExtent) {
|
|
||||||
return _tabScrollOffset(_currentIndex, viewportWidth, minExtent, maxExtent);
|
return _tabScrollOffset(_currentIndex, viewportWidth, minExtent, maxExtent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _scrollToCurrentIndex() {
|
void _scrollToCurrentIndex() {
|
||||||
final double offset = _tabCenteredScrollOffset(_currentIndex);
|
final double offset = _tabCenteredScrollOffset(_currentIndex);
|
||||||
_scrollController!
|
_scrollController!.animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease);
|
||||||
.animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _scrollToControllerValue() {
|
void _scrollToControllerValue() {
|
||||||
final double? leadingPosition =
|
final double? leadingPosition = _currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null;
|
||||||
_currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null;
|
|
||||||
final double middlePosition = _tabCenteredScrollOffset(_currentIndex);
|
final double middlePosition = _tabCenteredScrollOffset(_currentIndex);
|
||||||
final double? trailingPosition = _currentIndex < maxTabIndex
|
final double? trailingPosition = _currentIndex < maxTabIndex ? _tabCenteredScrollOffset(_currentIndex + 1) : null;
|
||||||
? _tabCenteredScrollOffset(_currentIndex + 1)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
final double index = _controller!.index.toDouble();
|
final double index = _controller!.index.toDouble();
|
||||||
final double value = _controller!.animation!.value;
|
final double value = _controller!.animation!.value;
|
||||||
|
@ -557,13 +534,9 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
} else if (value == index) {
|
} else if (value == index) {
|
||||||
offset = middlePosition;
|
offset = middlePosition;
|
||||||
} else if (value < index) {
|
} else if (value < index) {
|
||||||
offset = leadingPosition == null
|
offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value)!;
|
||||||
? middlePosition
|
|
||||||
: lerpDouble(middlePosition, leadingPosition, index - value)!;
|
|
||||||
} else {
|
} else {
|
||||||
offset = trailingPosition == null
|
offset = trailingPosition == null ? middlePosition : lerpDouble(middlePosition, trailingPosition, value - index)!;
|
||||||
? middlePosition
|
|
||||||
: lerpDouble(middlePosition, trailingPosition, value - index)!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_scrollController!.jumpTo(offset);
|
_scrollController!.jumpTo(offset);
|
||||||
|
@ -601,8 +574,7 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called each time layout completes.
|
// Called each time layout completes.
|
||||||
void _saveTabOffsets(
|
void _saveTabOffsets(List<double> tabOffsets, TextDirection textDirection, double width) {
|
||||||
List<double> tabOffsets, TextDirection textDirection, double width) {
|
|
||||||
_tabStripWidth = width;
|
_tabStripWidth = width;
|
||||||
_indicatorPainter?.saveTabOffsets(tabOffsets, textDirection);
|
_indicatorPainter?.saveTabOffsets(tabOffsets, textDirection);
|
||||||
}
|
}
|
||||||
|
@ -626,52 +598,34 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextStyle? textStyle = TextStyle.lerp(
|
final TextStyle? textStyle = TextStyle.lerp(
|
||||||
(widget.unselectedLabelStyle ??
|
(widget.unselectedLabelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith(
|
||||||
tabBarTheme.labelStyle ??
|
|
||||||
DefaultTextStyle.of(context).style)
|
|
||||||
.copyWith(
|
|
||||||
color: widget.unselectedLabelColor,
|
color: widget.unselectedLabelColor,
|
||||||
),
|
),
|
||||||
(widget.labelStyle ??
|
(widget.labelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith(
|
||||||
tabBarTheme.labelStyle ??
|
|
||||||
DefaultTextStyle.of(context).style)
|
|
||||||
.copyWith(
|
|
||||||
color: widget.labelColor,
|
color: widget.labelColor,
|
||||||
),
|
),
|
||||||
animationValue);
|
animationValue);
|
||||||
|
|
||||||
final Color? textColor = Color.lerp(
|
final Color? textColor = Color.lerp(widget.unselectedLabelColor, widget.labelColor, animationValue);
|
||||||
widget.unselectedLabelColor, widget.labelColor, animationValue);
|
|
||||||
|
|
||||||
final Color? borderColor = Color.lerp(
|
final Color? borderColor = Color.lerp(widget.unselectedBorderColor, widget.borderColor, animationValue);
|
||||||
widget.unselectedBorderColor, widget.borderColor, animationValue);
|
|
||||||
|
|
||||||
BoxDecoration? boxDecoration = BoxDecoration.lerp(
|
BoxDecoration? boxDecoration = BoxDecoration.lerp(
|
||||||
BoxDecoration(
|
BoxDecoration(
|
||||||
color: widget.unselectedDecoration?.color ??
|
color: widget.unselectedDecoration?.color ?? widget.unselectedBackgroundColor ?? Colors.transparent,
|
||||||
widget.unselectedBackgroundColor ??
|
|
||||||
Colors.transparent,
|
|
||||||
boxShadow: widget.unselectedDecoration?.boxShadow,
|
boxShadow: widget.unselectedDecoration?.boxShadow,
|
||||||
gradient: widget.unselectedDecoration?.gradient,
|
gradient: widget.unselectedDecoration?.gradient,
|
||||||
borderRadius: widget.useToggleButtonStyle
|
borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius),
|
||||||
? null
|
|
||||||
: BorderRadius.circular(widget.borderRadius),
|
|
||||||
),
|
),
|
||||||
BoxDecoration(
|
BoxDecoration(
|
||||||
color: widget.decoration?.color ??
|
color: widget.decoration?.color ?? widget.backgroundColor ?? Colors.transparent,
|
||||||
widget.backgroundColor ??
|
|
||||||
Colors.transparent,
|
|
||||||
boxShadow: widget.decoration?.boxShadow,
|
boxShadow: widget.decoration?.boxShadow,
|
||||||
gradient: widget.decoration?.gradient,
|
gradient: widget.decoration?.gradient,
|
||||||
borderRadius: widget.useToggleButtonStyle
|
borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius),
|
||||||
? null
|
|
||||||
: BorderRadius.circular(widget.borderRadius),
|
|
||||||
),
|
),
|
||||||
animationValue);
|
animationValue);
|
||||||
|
|
||||||
if (widget.useToggleButtonStyle &&
|
if (widget.useToggleButtonStyle && widget.borderWidth > 0 && boxDecoration != null) {
|
||||||
widget.borderWidth > 0 &&
|
|
||||||
boxDecoration != null) {
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
boxDecoration = boxDecoration.copyWith(
|
boxDecoration = boxDecoration.copyWith(
|
||||||
border: Border(
|
border: Border(
|
||||||
|
@ -705,13 +659,11 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
return Padding(
|
return Padding(
|
||||||
key: _tabKeys[index],
|
key: _tabKeys[index],
|
||||||
// padding for the buttons
|
// padding for the buttons
|
||||||
padding:
|
padding: widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin,
|
||||||
widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin,
|
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => _handleTap(index),
|
onPressed: () => _handleTap(index),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
elevation: WidgetStateProperty.all(
|
elevation: WidgetStateProperty.all(widget.useToggleButtonStyle ? 0 : widget.elevation),
|
||||||
widget.useToggleButtonStyle ? 0 : widget.elevation),
|
|
||||||
|
|
||||||
/// give a pretty small minimum size
|
/// give a pretty small minimum size
|
||||||
minimumSize: WidgetStateProperty.all(const Size(10, 10)),
|
minimumSize: WidgetStateProperty.all(const Size(10, 10)),
|
||||||
|
@ -777,14 +729,11 @@ class _FlutterFlowButtonTabBarState extends State<FlutterFlowButtonTabBar>
|
||||||
|
|
||||||
if (_controller!.length == 0) {
|
if (_controller!.length == 0) {
|
||||||
return Container(
|
return Container(
|
||||||
height: _kTabHeight +
|
height: _kTabHeight + widget.labelPadding.vertical + widget.buttonMargin.vertical,
|
||||||
widget.labelPadding.vertical +
|
|
||||||
widget.buttonMargin.vertical,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Widget> wrappedTabs =
|
final List<Widget> wrappedTabs = List<Widget>.generate(widget.tabs.length, (int index) {
|
||||||
List<Widget>.generate(widget.tabs.length, (int index) {
|
|
||||||
return _buildStyledTab(widget.tabs[index], index);
|
return _buildStyledTab(widget.tabs[index], index);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'package:flutter/scheduler.dart';
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
||||||
|
|
||||||
class FlutterFlowCheckboxGroup extends StatefulWidget {
|
class FlutterFlowCheckboxGroup extends StatefulWidget {
|
||||||
const FlutterFlowCheckboxGroup({
|
const FlutterFlowCheckboxGroup({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -38,8 +37,7 @@ class FlutterFlowCheckboxGroup extends StatefulWidget {
|
||||||
final TextStyle? unselectedTextStyle;
|
final TextStyle? unselectedTextStyle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FlutterFlowCheckboxGroup> createState() =>
|
State<FlutterFlowCheckboxGroup> createState() => _FlutterFlowCheckboxGroupState();
|
||||||
_FlutterFlowCheckboxGroupState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||||
|
@ -87,8 +85,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final option = widget.options[index];
|
final option = widget.options[index];
|
||||||
final selected = selectedValues.contains(option);
|
final selected = selectedValues.contains(option);
|
||||||
final unselectedTextStyle =
|
final unselectedTextStyle = widget.unselectedTextStyle ?? widget.textStyle;
|
||||||
widget.unselectedTextStyle ?? widget.textStyle;
|
|
||||||
return Theme(
|
return Theme(
|
||||||
data: ThemeData(unselectedWidgetColor: widget.checkboxBorderColor),
|
data: ThemeData(unselectedWidgetColor: widget.checkboxBorderColor),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
@ -102,9 +99,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||||
if (isSelected == null) {
|
if (isSelected == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isSelected
|
isSelected ? checkboxValues.add(option) : checkboxValues.remove(option);
|
||||||
? checkboxValues.add(option)
|
|
||||||
: checkboxValues.remove(option);
|
|
||||||
widget.controller.value = List.from(checkboxValues);
|
widget.controller.value = List.from(checkboxValues);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
@ -112,8 +107,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||||
activeColor: widget.activeColor,
|
activeColor: widget.activeColor,
|
||||||
checkColor: widget.checkColor,
|
checkColor: widget.checkColor,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius: widget.checkboxBorderRadius ?? BorderRadius.zero,
|
||||||
widget.checkboxBorderRadius ?? BorderRadius.zero,
|
|
||||||
),
|
),
|
||||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
|
@ -123,8 +117,7 @@ class _FlutterFlowCheckboxGroupState extends State<FlutterFlowCheckboxGroup> {
|
||||||
padding: widget.labelPadding ?? EdgeInsets.zero,
|
padding: widget.labelPadding ?? EdgeInsets.zero,
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.options[index],
|
widget.options[index],
|
||||||
style:
|
style: selected ? widget.textStyle : unselectedTextStyle,
|
||||||
selected ? widget.textStyle : unselectedTextStyle,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'form_field_controller.dart';
|
import 'form_field_controller.dart';
|
||||||
|
|
||||||
|
|
||||||
class FlutterFlowDropDown<T> extends StatefulWidget {
|
class FlutterFlowDropDown<T> extends StatefulWidget {
|
||||||
const FlutterFlowDropDown({
|
const FlutterFlowDropDown({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -87,13 +86,10 @@ class FlutterFlowDropDown<T> extends StatefulWidget {
|
||||||
class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
bool get isMultiSelect => widget.isMultiSelect;
|
bool get isMultiSelect => widget.isMultiSelect;
|
||||||
FormFieldController<T?> get controller => widget.controller!;
|
FormFieldController<T?> get controller => widget.controller!;
|
||||||
FormFieldController<List<T>?> get multiSelectController =>
|
FormFieldController<List<T>?> get multiSelectController => widget.multiSelectController!;
|
||||||
widget.multiSelectController!;
|
|
||||||
|
|
||||||
T? get currentValue {
|
T? get currentValue {
|
||||||
final value = isMultiSelect
|
final value = isMultiSelect ? multiSelectController.value?.firstOrNull : controller.value;
|
||||||
? multiSelectController.value?.firstOrNull
|
|
||||||
: controller.value;
|
|
||||||
return widget.options.contains(value) ? value : null;
|
return widget.options.contains(value) ? value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,17 +97,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
if (!isMultiSelect || multiSelectController.value == null) {
|
if (!isMultiSelect || multiSelectController.value == null) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return widget.options
|
return widget.options.toSet().intersection(multiSelectController.value!.toSet());
|
||||||
.toSet()
|
|
||||||
.intersection(multiSelectController.value!.toSet());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<T, String> get optionLabels => Map.fromEntries(
|
Map<T, String> get optionLabels => Map.fromEntries(
|
||||||
widget.options.asMap().entries.map(
|
widget.options.asMap().entries.map(
|
||||||
(option) => MapEntry(
|
(option) => MapEntry(
|
||||||
option.value,
|
option.value,
|
||||||
widget.optionLabels == null ||
|
widget.optionLabels == null || widget.optionLabels!.length < option.key + 1
|
||||||
widget.optionLabels!.length < option.key + 1
|
|
||||||
? option.value.toString()
|
? option.value.toString()
|
||||||
: widget.optionLabels![option.key],
|
: widget.optionLabels![option.key],
|
||||||
),
|
),
|
||||||
|
@ -130,8 +123,7 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
if (isMultiSelect) {
|
if (isMultiSelect) {
|
||||||
_listener =
|
_listener = () => widget.onMultiSelectChanged!(multiSelectController.value);
|
||||||
() => widget.onMultiSelectChanged!(multiSelectController.value);
|
|
||||||
multiSelectController.addListener(_listener);
|
multiSelectController.addListener(_listener);
|
||||||
} else {
|
} else {
|
||||||
_listener = () => widget.onChanged!(controller.value);
|
_listener = () => widget.onChanged!(controller.value);
|
||||||
|
@ -166,22 +158,16 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: _useDropdown2() ? EdgeInsets.zero : widget.margin,
|
padding: _useDropdown2() ? EdgeInsets.zero : widget.margin,
|
||||||
child: widget.hidesUnderline
|
child: widget.hidesUnderline ? DropdownButtonHideUnderline(child: dropdownWidget) : dropdownWidget,
|
||||||
? DropdownButtonHideUnderline(child: dropdownWidget)
|
|
||||||
: dropdownWidget,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _useDropdown2() =>
|
bool _useDropdown2() =>
|
||||||
widget.isMultiSelect ||
|
widget.isMultiSelect || widget.isSearchable || !widget.isOverButton || widget.maxHeight != null;
|
||||||
widget.isSearchable ||
|
|
||||||
!widget.isOverButton ||
|
|
||||||
widget.maxHeight != null;
|
|
||||||
|
|
||||||
Widget _buildDropdownWidget() =>
|
Widget _buildDropdownWidget() => _useDropdown2() ? _buildDropdown() : _buildLegacyDropdown();
|
||||||
_useDropdown2() ? _buildDropdown() : _buildLegacyDropdown();
|
|
||||||
|
|
||||||
Widget _buildLegacyDropdown() {
|
Widget _buildLegacyDropdown() {
|
||||||
return DropdownButtonFormField<T>(
|
return DropdownButtonFormField<T>(
|
||||||
|
@ -195,20 +181,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
dropdownColor: widget.fillColor,
|
dropdownColor: widget.fillColor,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: widget.labelText == null || widget.labelText!.isEmpty
|
labelText: widget.labelText == null || widget.labelText!.isEmpty ? null : widget.labelText,
|
||||||
? null
|
|
||||||
: widget.labelText,
|
|
||||||
labelStyle: widget.labelTextStyle,
|
labelStyle: widget.labelTextStyle,
|
||||||
border: widget.hidesUnderline
|
border: widget.hidesUnderline ? InputBorder.none : const UnderlineInputBorder(),
|
||||||
? InputBorder.none
|
|
||||||
: const UnderlineInputBorder(),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Text? _createHintText() => widget.hintText != null
|
Text? _createHintText() => widget.hintText != null ? Text(widget.hintText!, style: widget.textStyle) : null;
|
||||||
? Text(widget.hintText!, style: widget.textStyle)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
List<DropdownMenuItem<T>> _createMenuItems() => widget.options
|
List<DropdownMenuItem<T>> _createMenuItems() => widget.options
|
||||||
.map(
|
.map(
|
||||||
|
@ -229,14 +209,11 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
child: StatefulBuilder(
|
child: StatefulBuilder(
|
||||||
builder: (context, menuSetState) {
|
builder: (context, menuSetState) {
|
||||||
final isSelected =
|
final isSelected = multiSelectController.value?.contains(item) ?? false;
|
||||||
multiSelectController.value?.contains(item) ?? false;
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
multiSelectController.value ??= [];
|
multiSelectController.value ??= [];
|
||||||
isSelected
|
isSelected ? multiSelectController.value!.remove(item) : multiSelectController.value!.add(item);
|
||||||
? multiSelectController.value!.remove(item)
|
|
||||||
: multiSelectController.value!.add(item);
|
|
||||||
multiSelectController.update();
|
multiSelectController.update();
|
||||||
// This rebuilds the StatefulWidget to update the button's text.
|
// This rebuilds the StatefulWidget to update the button's text.
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
@ -269,11 +246,9 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
Widget _buildDropdown() {
|
Widget _buildDropdown() {
|
||||||
final overlayColor = WidgetStateProperty.resolveWith<Color?>((states) =>
|
final overlayColor = WidgetStateProperty.resolveWith<Color?>(
|
||||||
states.contains(WidgetState.focused) ? Colors.transparent : null);
|
(states) => states.contains(WidgetState.focused) ? Colors.transparent : null);
|
||||||
final iconStyleData = widget.icon != null
|
final iconStyleData = widget.icon != null ? IconStyleData(icon: widget.icon!) : const IconStyleData();
|
||||||
? IconStyleData(icon: widget.icon!)
|
|
||||||
: const IconStyleData();
|
|
||||||
return DropdownButton2<T>(
|
return DropdownButton2<T>(
|
||||||
value: currentValue,
|
value: currentValue,
|
||||||
hint: _createHintText(),
|
hint: _createHintText(),
|
||||||
|
@ -299,19 +274,14 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
maxHeight: widget.maxHeight,
|
maxHeight: widget.maxHeight,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
),
|
),
|
||||||
onChanged: widget.disabled
|
onChanged: widget.disabled ? null : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val),
|
||||||
? null
|
|
||||||
: (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val),
|
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
selectedItemBuilder: (context) => widget.options
|
selectedItemBuilder: (context) => widget.options
|
||||||
.map((item) => Align(
|
.map((item) => Align(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
alignment: AlignmentDirectional.centerStart,
|
||||||
child: Text(
|
child: Text(
|
||||||
isMultiSelect
|
isMultiSelect
|
||||||
? currentValues
|
? currentValues.where((v) => optionLabels.containsKey(v)).map((v) => optionLabels[v]).join(', ')
|
||||||
.where((v) => optionLabels.containsKey(v))
|
|
||||||
.map((v) => optionLabels[v])
|
|
||||||
.join(', ')
|
|
||||||
: optionLabels[item]!,
|
: optionLabels[item]!,
|
||||||
style: widget.textStyle,
|
style: widget.textStyle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
@ -351,9 +321,7 @@ class _FlutterFlowDropDownState<T> extends State<FlutterFlowDropDown<T>> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
searchMatchFn: (item, searchValue) {
|
searchMatchFn: (item, searchValue) {
|
||||||
return (optionLabels[item.value] ?? '')
|
return (optionLabels[item.value] ?? '').toLowerCase().contains(searchValue.toLowerCase());
|
||||||
.toLowerCase()
|
|
||||||
.contains(searchValue.toLowerCase());
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FlutterFlowIconButton extends StatefulWidget {
|
class FlutterFlowIconButton extends StatefulWidget {
|
||||||
const FlutterFlowIconButton({
|
const FlutterFlowIconButton({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -92,12 +90,10 @@ class _FlutterFlowIconButtonState extends State<FlutterFlowIconButton> {
|
||||||
),
|
),
|
||||||
iconColor: WidgetStateProperty.resolveWith<Color?>(
|
iconColor: WidgetStateProperty.resolveWith<Color?>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.disabled) &&
|
if (states.contains(WidgetState.disabled) && widget.disabledIconColor != null) {
|
||||||
widget.disabledIconColor != null) {
|
|
||||||
return widget.disabledIconColor;
|
return widget.disabledIconColor;
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.hoverIconColor != null) {
|
||||||
widget.hoverIconColor != null) {
|
|
||||||
return widget.hoverIconColor;
|
return widget.hoverIconColor;
|
||||||
}
|
}
|
||||||
return iconColor;
|
return iconColor;
|
||||||
|
@ -105,12 +101,10 @@ class _FlutterFlowIconButtonState extends State<FlutterFlowIconButton> {
|
||||||
),
|
),
|
||||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.disabled) &&
|
if (states.contains(WidgetState.disabled) && widget.disabledColor != null) {
|
||||||
widget.disabledColor != null) {
|
|
||||||
return widget.disabledColor;
|
return widget.disabledColor;
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.hoverColor != null) {
|
||||||
widget.hoverColor != null) {
|
|
||||||
return widget.hoverColor;
|
return widget.hoverColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
Widget wrapWithModel<T extends FlutterFlowModel>({
|
Widget wrapWithModel<T extends FlutterFlowModel>({
|
||||||
required T model,
|
required T model,
|
||||||
required Widget child,
|
required Widget child,
|
||||||
|
@ -112,8 +111,7 @@ class FlutterFlowDynamicModels<T extends FlutterFlowModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
S? getValueAtIndex<S>(int index, S? Function(T) getValue) {
|
S? getValueAtIndex<S>(int index, S? Function(T) getValue) {
|
||||||
final uniqueKey =
|
final uniqueKey = _childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key;
|
||||||
_childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key;
|
|
||||||
return getValueForKey(uniqueKey, getValue);
|
return getValueForKey(uniqueKey, getValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +161,5 @@ T? _getDefaultValue<T>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension TextValidationExtensions on String? Function(BuildContext, String?)? {
|
extension TextValidationExtensions on String? Function(BuildContext, String?)? {
|
||||||
String? Function(String?)? asValidator(BuildContext context) =>
|
String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null;
|
||||||
this != null ? (val) => this!(context, val) : null;
|
|
||||||
}
|
}
|
|
@ -13,6 +13,7 @@ enum DeviceSize {
|
||||||
tablet,
|
tablet,
|
||||||
desktop,
|
desktop,
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceSize getDeviceSize(BuildContext context) {
|
DeviceSize getDeviceSize(BuildContext context) {
|
||||||
final width = MediaQuery.sizeOf(context).width;
|
final width = MediaQuery.sizeOf(context).width;
|
||||||
if (width < 479) {
|
if (width < 479) {
|
||||||
|
@ -27,8 +28,7 @@ DeviceSize getDeviceSize(BuildContext context) {
|
||||||
abstract class FlutterFlowTheme {
|
abstract class FlutterFlowTheme {
|
||||||
static DeviceSize deviceSize = DeviceSize.mobile;
|
static DeviceSize deviceSize = DeviceSize.mobile;
|
||||||
|
|
||||||
static Future initialize() async =>
|
static Future initialize() async => _prefs = await SharedPreferences.getInstance();
|
||||||
_prefs = await SharedPreferences.getInstance();
|
|
||||||
static ThemeMode get themeMode {
|
static ThemeMode get themeMode {
|
||||||
final darkMode = _prefs?.getBool(kThemeModeKey);
|
final darkMode = _prefs?.getBool(kThemeModeKey);
|
||||||
return darkMode == null
|
return darkMode == null
|
||||||
|
@ -37,14 +37,12 @@ abstract class FlutterFlowTheme {
|
||||||
? ThemeMode.dark
|
? ThemeMode.dark
|
||||||
: ThemeMode.light;
|
: ThemeMode.light;
|
||||||
}
|
}
|
||||||
static void saveThemeMode(ThemeMode mode) => mode == ThemeMode.system
|
|
||||||
? _prefs?.remove(kThemeModeKey)
|
static void saveThemeMode(ThemeMode mode) =>
|
||||||
: _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark);
|
mode == ThemeMode.system ? _prefs?.remove(kThemeModeKey) : _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark);
|
||||||
static FlutterFlowTheme of(BuildContext context) {
|
static FlutterFlowTheme of(BuildContext context) {
|
||||||
deviceSize = getDeviceSize(context);
|
deviceSize = getDeviceSize(context);
|
||||||
return Theme.of(context).brightness == Brightness.dark
|
return Theme.of(context).brightness == Brightness.dark ? DarkModeTheme() : LightModeTheme();
|
||||||
? DarkModeTheme()
|
|
||||||
: LightModeTheme();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Use primary instead')
|
@Deprecated('Use primary instead')
|
||||||
|
@ -145,6 +143,7 @@ abstract class FlutterFlowTheme {
|
||||||
DeviceSize.desktop: DesktopTypography(this),
|
DeviceSize.desktop: DesktopTypography(this),
|
||||||
}[deviceSize]!;
|
}[deviceSize]!;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LightModeTheme extends FlutterFlowTheme {
|
class LightModeTheme extends FlutterFlowTheme {
|
||||||
@Deprecated('Use primary instead')
|
@Deprecated('Use primary instead')
|
||||||
Color get primaryColor => primary;
|
Color get primaryColor => primary;
|
||||||
|
@ -178,6 +177,7 @@ class LightModeTheme extends FlutterFlowTheme {
|
||||||
late Color customColor5 = const Color(0xFF979595);
|
late Color customColor5 = const Color(0xFF979595);
|
||||||
late Color customColor6 = const Color(0xFF525252);
|
late Color customColor6 = const Color(0xFF525252);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DarkModeTheme extends FlutterFlowTheme {
|
class DarkModeTheme extends FlutterFlowTheme {
|
||||||
@Deprecated('Use primary instead')
|
@Deprecated('Use primary instead')
|
||||||
Color get primaryColor => primary;
|
Color get primaryColor => primary;
|
||||||
|
@ -244,6 +244,7 @@ abstract class Typography {
|
||||||
String get bodySmallFamily;
|
String get bodySmallFamily;
|
||||||
TextStyle get bodySmall;
|
TextStyle get bodySmall;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MobileTypography extends Typography {
|
class MobileTypography extends Typography {
|
||||||
MobileTypography(this.theme);
|
MobileTypography(this.theme);
|
||||||
|
|
||||||
|
@ -352,8 +353,8 @@ class MobileTypography extends Typography {
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TabletTypography extends Typography {
|
class TabletTypography extends Typography {
|
||||||
TabletTypography(this.theme);
|
TabletTypography(this.theme);
|
||||||
final FlutterFlowTheme theme;
|
final FlutterFlowTheme theme;
|
||||||
|
@ -462,8 +463,8 @@ class TabletTypography extends Typography {
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
class DesktopTypography extends Typography {
|
|
||||||
|
|
||||||
|
class DesktopTypography extends Typography {
|
||||||
DesktopTypography(this.theme);
|
DesktopTypography(this.theme);
|
||||||
final FlutterFlowTheme theme;
|
final FlutterFlowTheme theme;
|
||||||
String get displayLargeFamily => 'Nunito Sans';
|
String get displayLargeFamily => 'Nunito Sans';
|
||||||
|
|
|
@ -25,7 +25,6 @@ export 'dart:typed_data' show Uint8List;
|
||||||
export 'package:intl/intl.dart';
|
export 'package:intl/intl.dart';
|
||||||
export 'package:page_transition/page_transition.dart';
|
export 'package:page_transition/page_transition.dart';
|
||||||
|
|
||||||
export '/app_state.dart';
|
|
||||||
export 'custom_icons.dart' show FFIcons;
|
export 'custom_icons.dart' show FFIcons;
|
||||||
export 'flutter_flow_model.dart';
|
export 'flutter_flow_model.dart';
|
||||||
export 'internationalization.dart' show FFLocalizations;
|
export 'internationalization.dart' show FFLocalizations;
|
||||||
|
@ -69,8 +68,7 @@ Theme wrapInMaterialDatePickerTheme(
|
||||||
required double iconSize,
|
required double iconSize,
|
||||||
}) {
|
}) {
|
||||||
final baseTheme = Theme.of(context);
|
final baseTheme = Theme.of(context);
|
||||||
final dateTimeMaterialStateForegroundColor =
|
final dateTimeMaterialStateForegroundColor = WidgetStateProperty.resolveWith((states) {
|
||||||
WidgetStateProperty.resolveWith((states) {
|
|
||||||
if (states.contains(WidgetState.disabled)) {
|
if (states.contains(WidgetState.disabled)) {
|
||||||
return pickerForegroundColor.withOpacity(0.60);
|
return pickerForegroundColor.withOpacity(0.60);
|
||||||
}
|
}
|
||||||
|
@ -83,8 +81,7 @@ Theme wrapInMaterialDatePickerTheme(
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
final dateTimeMaterialStateBackgroundColor =
|
final dateTimeMaterialStateBackgroundColor = WidgetStateProperty.resolveWith((states) {
|
||||||
WidgetStateProperty.resolveWith((states) {
|
|
||||||
if (states.contains(WidgetState.selected)) {
|
if (states.contains(WidgetState.selected)) {
|
||||||
return selectedDateTimeBackgroundColor;
|
return selectedDateTimeBackgroundColor;
|
||||||
}
|
}
|
||||||
|
@ -153,8 +150,7 @@ Theme wrapInMaterialDatePickerTheme(
|
||||||
if (states.contains(WidgetState.hovered)) {
|
if (states.contains(WidgetState.hovered)) {
|
||||||
return actionButtonForegroundColor.withOpacity(0.04);
|
return actionButtonForegroundColor.withOpacity(0.04);
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.focused) ||
|
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||||
states.contains(WidgetState.pressed)) {
|
|
||||||
return actionButtonForegroundColor.withOpacity(0.12);
|
return actionButtonForegroundColor.withOpacity(0.12);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -259,8 +255,7 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
if (states.contains(WidgetState.hovered)) {
|
if (states.contains(WidgetState.hovered)) {
|
||||||
return actionButtonForegroundColor.withOpacity(0.04);
|
return actionButtonForegroundColor.withOpacity(0.04);
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.focused) ||
|
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||||
states.contains(WidgetState.pressed)) {
|
|
||||||
return actionButtonForegroundColor.withOpacity(0.12);
|
return actionButtonForegroundColor.withOpacity(0.12);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -272,9 +267,7 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
hourMinuteTextColor: pickerForegroundColor,
|
hourMinuteTextColor: pickerForegroundColor,
|
||||||
dialHandColor: selectedDateTimeBackgroundColor,
|
dialHandColor: selectedDateTimeBackgroundColor,
|
||||||
dialTextColor: WidgetStateColor.resolveWith((states) =>
|
dialTextColor: WidgetStateColor.resolveWith((states) =>
|
||||||
states.contains(WidgetState.selected)
|
states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerDialForegroundColor),
|
||||||
? selectedDateTimeForegroundColor
|
|
||||||
: pickerDialForegroundColor),
|
|
||||||
dayPeriodBorderSide: BorderSide(
|
dayPeriodBorderSide: BorderSide(
|
||||||
color: pickerForegroundColor,
|
color: pickerForegroundColor,
|
||||||
),
|
),
|
||||||
|
@ -283,13 +276,9 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
fontSize: limitedFontSize,
|
fontSize: limitedFontSize,
|
||||||
),
|
),
|
||||||
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
||||||
states.contains(WidgetState.selected)
|
states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerForegroundColor),
|
||||||
? selectedDateTimeForegroundColor
|
dayPeriodColor: WidgetStateColor.resolveWith(
|
||||||
: pickerForegroundColor),
|
(states) => states.contains(WidgetState.selected) ? selectedDateTimeBackgroundColor : Colors.transparent),
|
||||||
dayPeriodColor: WidgetStateColor.resolveWith((states) =>
|
|
||||||
states.contains(WidgetState.selected)
|
|
||||||
? selectedDateTimeBackgroundColor
|
|
||||||
: Colors.transparent),
|
|
||||||
entryModeIconColor: pickerForegroundColor,
|
entryModeIconColor: pickerForegroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -372,8 +361,7 @@ String formatNumber(
|
||||||
break;
|
break;
|
||||||
case FormatType.custom:
|
case FormatType.custom:
|
||||||
final hasLocale = locale != null && locale.isNotEmpty;
|
final hasLocale = locale != null && locale.isNotEmpty;
|
||||||
formattedValue =
|
formattedValue = NumberFormat(format, hasLocale ? locale : null).format(value);
|
||||||
NumberFormat(format, hasLocale ? locale : null).format(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formattedValue.isEmpty) {
|
if (formattedValue.isEmpty) {
|
||||||
|
@ -381,9 +369,7 @@ String formatNumber(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currency != null) {
|
if (currency != null) {
|
||||||
final currencySymbol = currency.isNotEmpty
|
final currencySymbol = currency.isNotEmpty ? currency : NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
||||||
? currency
|
|
||||||
: NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
|
||||||
formattedValue = '$currencySymbol$formattedValue';
|
formattedValue = '$currencySymbol$formattedValue';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,9 +427,7 @@ dynamic getJsonField(
|
||||||
}
|
}
|
||||||
final value = field.first.value;
|
final value = field.first.value;
|
||||||
if (isForList) {
|
if (isForList) {
|
||||||
return value is! Iterable
|
return value is! Iterable ? [value] : (value is List ? value : value.toList());
|
||||||
? [value]
|
|
||||||
: (value is List ? value : value.toList());
|
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -464,8 +448,7 @@ bool get isWeb => kIsWeb;
|
||||||
const kBreakpointSmall = 479.0;
|
const kBreakpointSmall = 479.0;
|
||||||
const kBreakpointMedium = 767.0;
|
const kBreakpointMedium = 767.0;
|
||||||
const kBreakpointLarge = 991.0;
|
const kBreakpointLarge = 991.0;
|
||||||
bool isMobileWidth(BuildContext context) =>
|
bool isMobileWidth(BuildContext context) => MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||||
MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
|
||||||
bool responsiveVisibility({
|
bool responsiveVisibility({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
bool phone = true,
|
bool phone = true,
|
||||||
|
@ -498,28 +481,21 @@ extension FFTextEditingControllerExt on TextEditingController? {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension IterableExt<T> on Iterable<T> {
|
extension IterableExt<T> on Iterable<T> {
|
||||||
List<T> sortedList<S extends Comparable>(
|
List<T> sortedList<S extends Comparable>({S Function(T)? keyOf, bool desc = false}) {
|
||||||
{S Function(T)? keyOf, bool desc = false}) {
|
final sortedAscending = toList()..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
||||||
final sortedAscending = toList()
|
|
||||||
..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
|
||||||
if (desc) {
|
if (desc) {
|
||||||
return sortedAscending.reversed.toList();
|
return sortedAscending.reversed.toList();
|
||||||
}
|
}
|
||||||
return sortedAscending;
|
return sortedAscending;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<S> mapIndexed<S>(S Function(int, T) func) => toList()
|
List<S> mapIndexed<S>(S Function(int, T) func) =>
|
||||||
.asMap()
|
toList().asMap().map((index, value) => MapEntry(index, func(index, value))).values.toList();
|
||||||
.map((index, value) => MapEntry(index, func(index, value)))
|
|
||||||
.values
|
|
||||||
.toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAppLanguage(BuildContext context, String language) =>
|
void setAppLanguage(BuildContext context, String language) => App.of(context).setLocale(language);
|
||||||
App.of(context).setLocale(language);
|
|
||||||
|
|
||||||
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) =>
|
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => App.of(context).setThemeMode(themeMode);
|
||||||
App.of(context).setThemeMode(themeMode);
|
|
||||||
|
|
||||||
void showSnackbar(
|
void showSnackbar(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
|
@ -553,9 +529,7 @@ void showSnackbar(
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
duration: Duration(seconds: duration),
|
duration: Duration(seconds: duration),
|
||||||
backgroundColor: error
|
backgroundColor: error ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success,
|
||||||
? FlutterFlowTheme.of(context).error
|
|
||||||
: FlutterFlowTheme.of(context).success,
|
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
@ -642,9 +616,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
||||||
|
|
||||||
extension FFStringExt on String {
|
extension FFStringExt on String {
|
||||||
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
||||||
maxChars != null && length > maxChars
|
maxChars != null && length > maxChars ? replaceRange(maxChars, null, replacement) : this;
|
||||||
? replaceRange(maxChars, null, replacement)
|
|
||||||
: this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ListFilterExt<T> on Iterable<T?> {
|
extension ListFilterExt<T> on Iterable<T?> {
|
||||||
|
@ -653,16 +625,13 @@ extension ListFilterExt<T> on Iterable<T?> {
|
||||||
|
|
||||||
extension MapFilterExtensions<T> on Map<String, T?> {
|
extension MapFilterExtensions<T> on Map<String, T?> {
|
||||||
Map<String, T> get withoutNulls => Map.fromEntries(
|
Map<String, T> get withoutNulls => Map.fromEntries(
|
||||||
entries
|
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value as T)),
|
||||||
.where((e) => e.value != null)
|
|
||||||
.map((e) => MapEntry(e.key, e.value as T)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MapListContainsExt on List<dynamic> {
|
extension MapListContainsExt on List<dynamic> {
|
||||||
bool containsMap(dynamic map) => map is Map
|
bool containsMap(dynamic map) =>
|
||||||
? any((e) => e is Map && const DeepCollectionEquality().equals(e, map))
|
map is Map ? any((e) => e is Map && const DeepCollectionEquality().equals(e, map)) : contains(map);
|
||||||
: contains(map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ListDivideExt<T extends Widget> on Iterable<T> {
|
extension ListDivideExt<T extends Widget> on Iterable<T> {
|
||||||
|
@ -670,23 +639,17 @@ extension ListDivideExt<T extends Widget> on Iterable<T> {
|
||||||
|
|
||||||
List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty
|
List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty
|
||||||
? []
|
? []
|
||||||
: (enumerate
|
: (enumerate.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t]).expand((i) => i).toList()
|
||||||
.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t])
|
|
||||||
.expand((i) => i)
|
|
||||||
.toList()
|
|
||||||
..removeLast());
|
..removeLast());
|
||||||
|
|
||||||
List<Widget> around(Widget t) => addToStart(t).addToEnd(t);
|
List<Widget> around(Widget t) => addToStart(t).addToEnd(t);
|
||||||
|
|
||||||
List<Widget> addToStart(Widget t) =>
|
List<Widget> addToStart(Widget t) => enumerate.map((e) => e.value).toList()..insert(0, t);
|
||||||
enumerate.map((e) => e.value).toList()..insert(0, t);
|
|
||||||
|
|
||||||
List<Widget> addToEnd(Widget t) =>
|
List<Widget> addToEnd(Widget t) => enumerate.map((e) => e.value).toList()..add(t);
|
||||||
enumerate.map((e) => e.value).toList()..add(t);
|
|
||||||
|
|
||||||
List<Padding> paddingTopEach(double val) =>
|
List<Padding> paddingTopEach(double val) =>
|
||||||
map((w) => Padding(padding: EdgeInsets.only(top: val), child: w))
|
map((w) => Padding(padding: EdgeInsets.only(top: val), child: w)).toList();
|
||||||
.toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension StatefulWidgetExtensions on State<StatefulWidget> {
|
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:flutter/material.dart';
|
||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
|
||||||
|
|
||||||
class FFButtonOptions {
|
class FFButtonOptions {
|
||||||
const FFButtonOptions({
|
const FFButtonOptions({
|
||||||
this.textAlign,
|
this.textAlign,
|
||||||
|
@ -75,16 +74,13 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
|
|
||||||
int get maxLines => widget.options.maxLines ?? 1;
|
int get maxLines => widget.options.maxLines ?? 1;
|
||||||
String? get text =>
|
String? get text => widget.options.textStyle?.fontSize == 0 ? null : widget.text;
|
||||||
widget.options.textStyle?.fontSize == 0 ? null : widget.text;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget textWidget = loading
|
Widget textWidget = loading
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
width: widget.options.width == null
|
width: widget.options.width == null ? _getTextWidth(text, widget.options.textStyle, maxLines) : null,
|
||||||
? _getTextWidth(text, widget.options.textStyle, maxLines)
|
|
||||||
: null,
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 23,
|
width: 23,
|
||||||
|
@ -99,8 +95,7 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
)
|
)
|
||||||
: Text(
|
: Text(
|
||||||
text ?? '',
|
text ?? '',
|
||||||
style:
|
style: text == null ? null : widget.options.textStyle?.withoutColor(),
|
||||||
text == null ? null : widget.options.textStyle?.withoutColor(),
|
|
||||||
textAlign: widget.options.textAlign,
|
textAlign: widget.options.textAlign,
|
||||||
maxLines: maxLines,
|
maxLines: maxLines,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
@ -128,29 +123,24 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
ButtonStyle style = ButtonStyle(
|
ButtonStyle style = ButtonStyle(
|
||||||
shape: WidgetStateProperty.resolveWith<OutlinedBorder>(
|
shape: WidgetStateProperty.resolveWith<OutlinedBorder>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.options.hoverBorderSide != null) {
|
||||||
widget.options.hoverBorderSide != null) {
|
|
||||||
return RoundedRectangleBorder(
|
return RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
|
||||||
side: widget.options.hoverBorderSide!,
|
side: widget.options.hoverBorderSide!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return RoundedRectangleBorder(
|
return RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
|
||||||
side: widget.options.borderSide ?? BorderSide.none,
|
side: widget.options.borderSide ?? BorderSide.none,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
foregroundColor: WidgetStateProperty.resolveWith<Color?>(
|
foregroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.disabled) &&
|
if (states.contains(WidgetState.disabled) && widget.options.disabledTextColor != null) {
|
||||||
widget.options.disabledTextColor != null) {
|
|
||||||
return widget.options.disabledTextColor;
|
return widget.options.disabledTextColor;
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.options.hoverTextColor != null) {
|
||||||
widget.options.hoverTextColor != null) {
|
|
||||||
return widget.options.hoverTextColor;
|
return widget.options.hoverTextColor;
|
||||||
}
|
}
|
||||||
return widget.options.textStyle?.color ?? Colors.white;
|
return widget.options.textStyle?.color ?? Colors.white;
|
||||||
|
@ -158,12 +148,10 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
),
|
),
|
||||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.disabled) &&
|
if (states.contains(WidgetState.disabled) && widget.options.disabledColor != null) {
|
||||||
widget.options.disabledColor != null) {
|
|
||||||
return widget.options.disabledColor;
|
return widget.options.disabledColor;
|
||||||
}
|
}
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.options.hoverColor != null) {
|
||||||
widget.options.hoverColor != null) {
|
|
||||||
return widget.options.hoverColor;
|
return widget.options.hoverColor;
|
||||||
}
|
}
|
||||||
return widget.options.color;
|
return widget.options.color;
|
||||||
|
@ -175,12 +163,11 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
}
|
}
|
||||||
return widget.options.hoverColor == null ? null : Colors.transparent;
|
return widget.options.hoverColor == null ? null : Colors.transparent;
|
||||||
}),
|
}),
|
||||||
padding: WidgetStateProperty.all(widget.options.padding ??
|
padding: WidgetStateProperty.all(
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)),
|
widget.options.padding ?? const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)),
|
||||||
elevation: WidgetStateProperty.resolveWith<double?>(
|
elevation: WidgetStateProperty.resolveWith<double?>(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(WidgetState.hovered) &&
|
if (states.contains(WidgetState.hovered) && widget.options.hoverElevation != null) {
|
||||||
widget.options.hoverElevation != null) {
|
|
||||||
return widget.options.hoverElevation!;
|
return widget.options.hoverElevation!;
|
||||||
}
|
}
|
||||||
return widget.options.elevation ?? 2.0;
|
return widget.options.elevation ?? 2.0;
|
||||||
|
@ -204,8 +191,7 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
|
||||||
border: Border.fromBorderSide(
|
border: Border.fromBorderSide(
|
||||||
widget.options.borderSide ?? BorderSide.none,
|
widget.options.borderSide ?? BorderSide.none,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8),
|
||||||
widget.options.borderRadius ?? BorderRadius.circular(8),
|
|
||||||
),
|
),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
splashRadius: 1.0,
|
splashRadius: 1.0,
|
||||||
|
@ -278,13 +264,12 @@ extension _WithoutColorExtension on TextStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slightly hacky method of getting the layout width of the provided text.
|
// Slightly hacky method of getting the layout width of the provided text.
|
||||||
double? _getTextWidth(String? text, TextStyle? style, int maxLines) =>
|
double? _getTextWidth(String? text, TextStyle? style, int maxLines) => text != null
|
||||||
text != null
|
? (TextPainter(
|
||||||
? (TextPainter(
|
text: TextSpan(text: text, style: style),
|
||||||
text: TextSpan(text: text, style: style),
|
textDirection: TextDirection.ltr,
|
||||||
textDirection: TextDirection.ltr,
|
maxLines: maxLines,
|
||||||
maxLines: maxLines,
|
)..layout())
|
||||||
)..layout())
|
.size
|
||||||
.size
|
.width
|
||||||
.width
|
: null;
|
||||||
: null;
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
|
||||||
class FormFieldController<T> extends ValueNotifier<T?> {
|
class FormFieldController<T> extends ValueNotifier<T?> {
|
||||||
FormFieldController(this.initialValue) : super(initialValue);
|
FormFieldController(this.initialValue) : super(initialValue);
|
||||||
|
|
||||||
|
@ -16,8 +15,7 @@ class FormFieldController<T> extends ValueNotifier<T?> {
|
||||||
class FormListFieldController<T> extends FormFieldController<List<T>> {
|
class FormListFieldController<T> extends FormFieldController<List<T>> {
|
||||||
final List<T>? _initialListValue;
|
final List<T>? _initialListValue;
|
||||||
|
|
||||||
FormListFieldController(super.initialValue)
|
FormListFieldController(super.initialValue) : _initialListValue = List<T>.from(initialValue ?? []);
|
||||||
: _initialListValue = List<T>.from(initialValue ?? []);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void reset() => value = List<T>.from(_initialListValue ?? []);
|
void reset() => value = List<T>.from(_initialListValue ?? []);
|
||||||
|
|
|
@ -9,16 +9,13 @@ class FFLocalizations {
|
||||||
|
|
||||||
final Locale locale;
|
final Locale locale;
|
||||||
|
|
||||||
static FFLocalizations of(BuildContext context) =>
|
static FFLocalizations of(BuildContext context) => Localizations.of<FFLocalizations>(context, FFLocalizations)!;
|
||||||
Localizations.of<FFLocalizations>(context, FFLocalizations)!;
|
|
||||||
|
|
||||||
static List<String> languages() => ['pt', 'en'];
|
static List<String> languages() => ['pt', 'en'];
|
||||||
|
|
||||||
static late SharedPreferences _prefs;
|
static late SharedPreferences _prefs;
|
||||||
static Future initialize() async =>
|
static Future initialize() async => _prefs = await SharedPreferences.getInstance();
|
||||||
_prefs = await SharedPreferences.getInstance();
|
static Future storeLocale(String locale) => _prefs.setString(_kLocaleStorageKey, locale);
|
||||||
static Future storeLocale(String locale) =>
|
|
||||||
_prefs.setString(_kLocaleStorageKey, locale);
|
|
||||||
static Locale? getStoredLocale() {
|
static Locale? getStoredLocale() {
|
||||||
final locale = _prefs.getString(_kLocaleStorageKey);
|
final locale = _prefs.getString(_kLocaleStorageKey);
|
||||||
return locale != null && locale.isNotEmpty ? createLocale(locale) : null;
|
return locale != null && locale.isNotEmpty ? createLocale(locale) : null;
|
||||||
|
@ -26,15 +23,10 @@ class FFLocalizations {
|
||||||
|
|
||||||
String get languageCode => locale.toString();
|
String get languageCode => locale.toString();
|
||||||
String? get languageShortCode =>
|
String? get languageShortCode =>
|
||||||
_languagesWithShortCode.contains(locale.toString())
|
_languagesWithShortCode.contains(locale.toString()) ? '${locale.toString()}_short' : null;
|
||||||
? '${locale.toString()}_short'
|
int get languageIndex => languages().contains(languageCode) ? languages().indexOf(languageCode) : 0;
|
||||||
: null;
|
|
||||||
int get languageIndex => languages().contains(languageCode)
|
|
||||||
? languages().indexOf(languageCode)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
String getText(String key) =>
|
String getText(String key) => (kTranslationsMap[key] ?? {})[locale.toString()] ?? '';
|
||||||
(kTranslationsMap[key] ?? {})[locale.toString()] ?? '';
|
|
||||||
|
|
||||||
String getVariableText({
|
String getVariableText({
|
||||||
String? ptText = '',
|
String? ptText = '',
|
||||||
|
@ -83,15 +75,12 @@ class FFLocalizationsDelegate extends LocalizationsDelegate<FFLocalizations> {
|
||||||
bool isSupported(Locale locale) {
|
bool isSupported(Locale locale) {
|
||||||
final language = locale.toString();
|
final language = locale.toString();
|
||||||
return FFLocalizations.languages().contains(
|
return FFLocalizations.languages().contains(
|
||||||
language.endsWith('_')
|
language.endsWith('_') ? language.substring(0, language.length - 1) : language,
|
||||||
? language.substring(0, language.length - 1)
|
|
||||||
: language,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<FFLocalizations> load(Locale locale) =>
|
Future<FFLocalizations> load(Locale locale) => SynchronousFuture<FFLocalizations>(FFLocalizations(locale));
|
||||||
SynchronousFuture<FFLocalizations>(FFLocalizations(locale));
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool shouldReload(FFLocalizationsDelegate old) => false;
|
bool shouldReload(FFLocalizationsDelegate old) => false;
|
||||||
|
@ -1062,10 +1051,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'FORGOT YOUR PASSWORD?',
|
'en': 'FORGOT YOUR PASSWORD?',
|
||||||
},
|
},
|
||||||
'wu2f7yzo': {
|
'wu2f7yzo': {
|
||||||
'pt':
|
'pt': 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.',
|
||||||
'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.',
|
||||||
'en':
|
|
||||||
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
|
||||||
},
|
},
|
||||||
'mtz8l7ft': {
|
'mtz8l7ft': {
|
||||||
'pt': 'E-mail',
|
'pt': 'E-mail',
|
||||||
|
@ -1180,10 +1167,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'ENTER YOUR PASSWORD',
|
'en': 'ENTER YOUR PASSWORD',
|
||||||
},
|
},
|
||||||
'ujodm2ci': {
|
'ujodm2ci': {
|
||||||
'pt':
|
'pt': 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.',
|
||||||
'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.',
|
||||||
'en':
|
|
||||||
'To generate the QR Code, enter the password registered in the application and click send.',
|
|
||||||
},
|
},
|
||||||
'rfqrdet7': {
|
'rfqrdet7': {
|
||||||
'pt': 'Senha',
|
'pt': 'Senha',
|
||||||
|
|
|
@ -12,8 +12,7 @@ class KeepAliveWidgetWrapper extends StatefulWidget {
|
||||||
State<KeepAliveWidgetWrapper> createState() => _KeepAliveWidgetWrapperState();
|
State<KeepAliveWidgetWrapper> createState() => _KeepAliveWidgetWrapperState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _KeepAliveWidgetWrapperState extends State<KeepAliveWidgetWrapper>
|
class _KeepAliveWidgetWrapperState extends State<KeepAliveWidgetWrapper> with AutomaticKeepAliveClientMixin {
|
||||||
with AutomaticKeepAliveClientMixin {
|
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,5 @@ class LatLng {
|
||||||
int get hashCode => latitude.hashCode + longitude.hashCode;
|
int get hashCode => latitude.hashCode + longitude.hashCode;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(other) =>
|
bool operator ==(other) => other is LatLng && latitude == other.latitude && longitude == other.longitude;
|
||||||
other is LatLng &&
|
|
||||||
latitude == other.latitude &&
|
|
||||||
longitude == other.longitude;
|
|
||||||
}
|
}
|
|
@ -12,8 +12,9 @@ import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
||||||
import 'package:hub/pages/provisional_schedule_page/provisional_schedule_widget.dart';
|
import 'package:hub/pages/provisional_schedule_page/provisional_schedule_widget.dart';
|
||||||
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
||||||
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
|
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
|
||||||
|
import 'package:hub/shared/helpers/base_storage.dart';
|
||||||
|
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||||
|
|
||||||
import 'package:hub/shared/utils/storage_util.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../../shared/utils/dialog_util.dart';
|
import '../../shared/utils/dialog_util.dart';
|
||||||
|
@ -27,7 +28,6 @@ export 'serialization_util.dart';
|
||||||
|
|
||||||
const kTransitionInfoKey = '__transition_info__';
|
const kTransitionInfoKey = '__transition_info__';
|
||||||
|
|
||||||
|
|
||||||
class AppStateNotifier extends ChangeNotifier {
|
class AppStateNotifier extends ChangeNotifier {
|
||||||
AppStateNotifier._();
|
AppStateNotifier._();
|
||||||
|
|
||||||
|
@ -43,15 +43,6 @@ class AppStateNotifier extends ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
final bool isLogged = StorageUtil().isLogged;
|
|
||||||
final bool? haveLocal = StorageUtil().haveLocal;
|
|
||||||
final bool haveUserUUID = StorageUtil().userUUID.isNotEmpty;
|
|
||||||
final bool haveDevUUID = StorageUtil().devUUID.isNotEmpty;
|
|
||||||
final bool isRecovered = StorageUtil().isRecovered;
|
|
||||||
|
|
||||||
log('() => isLogged: $isLogged');
|
|
||||||
log('() => haveLocal: $haveLocal');
|
|
||||||
|
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
initialLocation: '/',
|
initialLocation: '/',
|
||||||
debugLogDiagnostics: true,
|
debugLogDiagnostics: true,
|
||||||
|
@ -87,41 +78,51 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
name: '_initialize',
|
name: '_initialize',
|
||||||
path: '/',
|
path: '/',
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
try {
|
return FutureBuilder<Widget>(
|
||||||
return isLogged && haveDevUUID && haveUserUUID
|
future: () async {
|
||||||
? haveLocal == true
|
final bool isLogged = await StorageHelper().get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true';
|
||||||
? const HomePageWidget()
|
final bool haveLocal = await StorageHelper().get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true';
|
||||||
: const ReceptionPageWidget()
|
final bool haveUserUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false;
|
||||||
: const WelcomePageWidget();
|
final bool haveDevUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false;
|
||||||
} catch (e) {
|
|
||||||
DialogUtil.error(context, e.toString());
|
if (isLogged && haveDevUUID && haveUserUUID) {
|
||||||
return const WelcomePageWidget();
|
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
||||||
}
|
} else {
|
||||||
|
return const WelcomePageWidget();
|
||||||
|
}
|
||||||
|
}(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const Center(child: CircularProgressIndicator());
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
DialogUtil.error(context, snapshot.error.toString());
|
||||||
|
return const WelcomePageWidget();
|
||||||
|
} else {
|
||||||
|
return snapshot.data!;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'forgotPassword',
|
name: 'forgotPassword',
|
||||||
path: '/forgotPassword',
|
path: '/forgotPassword',
|
||||||
builder: (context, params) {
|
builder: (context, params) {
|
||||||
late final String email = params.getParam('email', ParamType.String);
|
late final String email = params.getParam('email', ParamType.String);
|
||||||
late final String token = params.getParam('token', ParamType.String);
|
late final String token = params.getParam('token', ParamType.String);
|
||||||
|
|
||||||
return ForgotPasswordScreen(
|
return ForgotPasswordScreen(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
email: email,
|
email: email,
|
||||||
token: token,
|
token: token,
|
||||||
);
|
);
|
||||||
}
|
}),
|
||||||
),
|
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'homePage',
|
name: 'homePage',
|
||||||
path: '/homePage',
|
path: '/homePage',
|
||||||
builder: (context, params) => HomePageWidget(key: UniqueKey()),
|
builder: (context, params) => HomePageWidget(key: UniqueKey()),
|
||||||
),
|
),
|
||||||
FFRoute(
|
FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()),
|
||||||
name: 'receptionPage',
|
|
||||||
path: '/receptionPage',
|
|
||||||
builder: (context, params) => const ReceptionPageWidget()),
|
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'messageHistoryPage',
|
name: 'messageHistoryPage',
|
||||||
path: '/messageHistoryPage',
|
path: '/messageHistoryPage',
|
||||||
|
@ -236,11 +237,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
||||||
|
|
||||||
extension NavParamExtensions on Map<String, String?> {
|
extension NavParamExtensions on Map<String, String?> {
|
||||||
Map<String, String> get withoutNulls => Map.fromEntries(
|
Map<String, String> get withoutNulls => Map.fromEntries(
|
||||||
entries
|
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value!)),
|
||||||
.where((e) => e.value != null)
|
|
||||||
.map((e) => MapEntry(e.key, e.value!)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NavigationExtensions on BuildContext {
|
extension NavigationExtensions on BuildContext {
|
||||||
void safePop() {
|
void safePop() {
|
||||||
// If there is only one route on the stack, navigate to the initial
|
// If there is only one route on the stack, navigate to the initial
|
||||||
|
@ -252,9 +252,9 @@ extension NavigationExtensions on BuildContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension _GoRouterStateExtensions on GoRouterState {
|
extension _GoRouterStateExtensions on GoRouterState {
|
||||||
Map<String, dynamic> get extraMap =>
|
Map<String, dynamic> get extraMap => extra != null ? extra as Map<String, dynamic> : {};
|
||||||
extra != null ? extra as Map<String, dynamic> : {};
|
|
||||||
Map<String, dynamic> get allParams => <String, dynamic>{}
|
Map<String, dynamic> get allParams => <String, dynamic>{}
|
||||||
..addAll(pathParameters)
|
..addAll(pathParameters)
|
||||||
..addAll(uri.queryParameters)
|
..addAll(uri.queryParameters)
|
||||||
|
@ -263,12 +263,12 @@ extension _GoRouterStateExtensions on GoRouterState {
|
||||||
? extraMap[kTransitionInfoKey] as TransitionInfo
|
? extraMap[kTransitionInfoKey] as TransitionInfo
|
||||||
: TransitionInfo.appDefault();
|
: TransitionInfo.appDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
extension GoRouterLocationExtension on GoRouter {
|
extension GoRouterLocationExtension on GoRouter {
|
||||||
String getCurrentLocation() {
|
String getCurrentLocation() {
|
||||||
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
|
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last;
|
||||||
final RouteMatchList matchList = lastMatch is ImperativeRouteMatch
|
final RouteMatchList matchList =
|
||||||
? lastMatch.matches
|
lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration;
|
||||||
: routerDelegate.currentConfiguration;
|
|
||||||
return matchList.uri.toString();
|
return matchList.uri.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,17 +284,13 @@ class FFParameters {
|
||||||
// Parameters are empty if the params map is empty or if the only parameter
|
// Parameters are empty if the params map is empty or if the only parameter
|
||||||
// present is the special extra parameter reserved for the transition info.
|
// present is the special extra parameter reserved for the transition info.
|
||||||
bool get isEmpty =>
|
bool get isEmpty =>
|
||||||
state.allParams.isEmpty ||
|
state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey));
|
||||||
(state.allParams.length == 1 &&
|
bool isAsyncParam(MapEntry<String, dynamic> param) => asyncParams.containsKey(param.key) && param.value is String;
|
||||||
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);
|
bool get hasFutures => state.allParams.entries.any(isAsyncParam);
|
||||||
Future<bool> completeFutures() => Future.wait(
|
Future<bool> completeFutures() => Future.wait(
|
||||||
state.allParams.entries.where(isAsyncParam).map(
|
state.allParams.entries.where(isAsyncParam).map(
|
||||||
(param) async {
|
(param) async {
|
||||||
final doc = await asyncParams[param.key]!(param.value)
|
final doc = await asyncParams[param.key]!(param.value).onError((_, __) => null);
|
||||||
.onError((_, __) => null);
|
|
||||||
if (doc != null) {
|
if (doc != null) {
|
||||||
futureParamValues[param.key] = doc;
|
futureParamValues[param.key] = doc;
|
||||||
return true;
|
return true;
|
||||||
|
@ -330,6 +326,7 @@ class FFParameters {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FFRoute {
|
class FFRoute {
|
||||||
const FFRoute({
|
const FFRoute({
|
||||||
required this.name,
|
required this.name,
|
||||||
|
@ -367,9 +364,7 @@ class FFRoute {
|
||||||
key: state.pageKey,
|
key: state.pageKey,
|
||||||
child: child,
|
child: child,
|
||||||
transitionDuration: transitionInfo.duration,
|
transitionDuration: transitionInfo.duration,
|
||||||
transitionsBuilder:
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => PageTransition(
|
||||||
(context, animation, secondaryAnimation, child) =>
|
|
||||||
PageTransition(
|
|
||||||
type: transitionInfo.transitionType,
|
type: transitionInfo.transitionType,
|
||||||
duration: transitionInfo.duration,
|
duration: transitionInfo.duration,
|
||||||
reverseDuration: transitionInfo.duration,
|
reverseDuration: transitionInfo.duration,
|
||||||
|
@ -387,6 +382,7 @@ class FFRoute {
|
||||||
routes: routes,
|
routes: routes,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class TransitionInfo {
|
class TransitionInfo {
|
||||||
const TransitionInfo({
|
const TransitionInfo({
|
||||||
required this.hasTransition,
|
required this.hasTransition,
|
||||||
|
@ -400,9 +396,9 @@ class TransitionInfo {
|
||||||
final Duration duration;
|
final Duration duration;
|
||||||
final Alignment? alignment;
|
final Alignment? alignment;
|
||||||
|
|
||||||
static TransitionInfo appDefault() =>
|
static TransitionInfo appDefault() => const TransitionInfo(hasTransition: false);
|
||||||
const TransitionInfo(hasTransition: false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class RootPageContext {
|
class RootPageContext {
|
||||||
const RootPageContext(this.isRootPage, [this.errorRoute]);
|
const RootPageContext(this.isRootPage, [this.errorRoute]);
|
||||||
final bool isRootPage;
|
final bool isRootPage;
|
||||||
|
@ -412,13 +408,11 @@ class RootPageContext {
|
||||||
final rootPageContext = context.read<RootPageContext?>();
|
final rootPageContext = context.read<RootPageContext?>();
|
||||||
final isRootPage = rootPageContext?.isRootPage ?? false;
|
final isRootPage = rootPageContext?.isRootPage ?? false;
|
||||||
final location = GoRouterState.of(context).uri.toString();
|
final location = GoRouterState.of(context).uri.toString();
|
||||||
return isRootPage &&
|
return isRootPage && location != '/' && location != rootPageContext?.errorRoute;
|
||||||
location != '/' &&
|
|
||||||
location != rootPageContext?.errorRoute;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(
|
static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(
|
||||||
value: RootPageContext(true, errorRoute),
|
value: RootPageContext(true, errorRoute),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@ String placeToString(FFPlace place) => jsonEncode({
|
||||||
'zipCode': place.zipCode,
|
'zipCode': place.zipCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
String uploadedFileToString(FFUploadedFile uploadedFile) =>
|
String uploadedFileToString(FFUploadedFile uploadedFile) => uploadedFile.serialize();
|
||||||
uploadedFile.serialize();
|
|
||||||
|
|
||||||
String? serializeParam(
|
String? serializeParam(
|
||||||
dynamic param,
|
dynamic param,
|
||||||
|
@ -137,8 +136,7 @@ FFPlace placeFromString(String placeStr) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FFUploadedFile uploadedFileFromString(String uploadedFileStr) =>
|
FFUploadedFile uploadedFileFromString(String uploadedFileStr) => FFUploadedFile.deserialize(uploadedFileStr);
|
||||||
FFUploadedFile.deserialize(uploadedFileStr);
|
|
||||||
|
|
||||||
enum ParamType {
|
enum ParamType {
|
||||||
int,
|
int,
|
||||||
|
@ -196,9 +194,7 @@ dynamic deserializeParam<T>(
|
||||||
return param == 'true';
|
return param == 'true';
|
||||||
case ParamType.DateTime:
|
case ParamType.DateTime:
|
||||||
final milliseconds = int.tryParse(param);
|
final milliseconds = int.tryParse(param);
|
||||||
return milliseconds != null
|
return milliseconds != null ? DateTime.fromMillisecondsSinceEpoch(milliseconds) : null;
|
||||||
? DateTime.fromMillisecondsSinceEpoch(milliseconds)
|
|
||||||
: null;
|
|
||||||
case ParamType.DateTimeRange:
|
case ParamType.DateTimeRange:
|
||||||
return dateTimeRangeFromString(param);
|
return dateTimeRangeFromString(param);
|
||||||
case ParamType.LatLng:
|
case ParamType.LatLng:
|
||||||
|
|
|
@ -13,5 +13,4 @@ Future<bool> getPermissionStatus(Permission setting) async {
|
||||||
return kPermissionStateToBool[status]!;
|
return kPermissionStateToBool[status]!;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> requestPermission(Permission setting) async =>
|
Future<void> requestPermission(Permission setting) async => await setting.request();
|
||||||
await setting.request();
|
|
||||||
|
|
|
@ -29,16 +29,14 @@ String randomString(
|
||||||
if (digits) {
|
if (digits) {
|
||||||
chars += '0123456789';
|
chars += '0123456789';
|
||||||
}
|
}
|
||||||
return List.generate(randomInteger(minLength, maxLength),
|
return List.generate(randomInteger(minLength, maxLength), (index) => chars[_random.nextInt(chars.length)]).join();
|
||||||
(index) => chars[_random.nextInt(chars.length)]).join();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random date between 1970 and 2025.
|
// Random date between 1970 and 2025.
|
||||||
DateTime randomDate() {
|
DateTime randomDate() {
|
||||||
// Random max must be in range 0 < max <= 2^32.
|
// Random max must be in range 0 < max <= 2^32.
|
||||||
// So we have to generate the time in seconds and then convert to milliseconds.
|
// So we have to generate the time in seconds and then convert to milliseconds.
|
||||||
return DateTime.fromMillisecondsSinceEpoch(
|
return DateTime.fromMillisecondsSinceEpoch(randomInteger(0, 1735689600) * 1000);
|
||||||
randomInteger(0, 1735689600) * 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String randomImageUrl(int width, int height) {
|
String randomImageUrl(int width, int height) {
|
||||||
|
@ -46,6 +44,5 @@ String randomImageUrl(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Color randomColor() {
|
Color randomColor() {
|
||||||
return Color.fromARGB(
|
return Color.fromARGB(255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255));
|
||||||
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,
|
// Remove the first cached result if we have reached the specified limit,
|
||||||
// since we will be adding another.
|
// since we will be adding another.
|
||||||
if (!_requests.containsKey(uniqueQueryKey) &&
|
if (!_requests.containsKey(uniqueQueryKey) && _requests.length >= cacheLimit) {
|
||||||
_requests.length >= cacheLimit) {
|
|
||||||
_requests.remove(_requests.keys.first);
|
_requests.remove(_requests.keys.first);
|
||||||
}
|
}
|
||||||
// Return the cached query result or set it to the new value.
|
// 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.
|
// Create a subscription that stores the latest result in the behavior subject.
|
||||||
final streamSubject = BehaviorSubject<T>();
|
final streamSubject = BehaviorSubject<T>();
|
||||||
_requestSubscriptions[uniqueQueryKey] = requestFn()
|
_requestSubscriptions[uniqueQueryKey] =
|
||||||
.asBroadcastStream()
|
requestFn().asBroadcastStream().listen((result) => streamSubject.add(result));
|
||||||
.listen((result) => streamSubject.add(result));
|
|
||||||
_streamSubjects[uniqueQueryKey] = streamSubject;
|
_streamSubjects[uniqueQueryKey] = streamSubject;
|
||||||
|
|
||||||
return streamSubject.stream;
|
return streamSubject.stream;
|
||||||
|
@ -89,5 +87,4 @@ class StreamRequestManager<T> {
|
||||||
}.forEach(clearRequest);
|
}.forEach(clearRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
String _requestKey(String? key) =>
|
String _requestKey(String? key) => key == null || key.isEmpty ? '__DEFAULT_KEY__' : key;
|
||||||
key == null || key.isEmpty ? '__DEFAULT_KEY__' : key;
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue