Fix: Ajustes no Custom input, custom Select e Upload de media
This commit is contained in:
parent
6eedf2d470
commit
5c59989316
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:easy_debounce/easy_debounce.dart';
|
||||||
import 'package:flutter/material.dart';
|
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';
|
||||||
|
@ -16,8 +17,9 @@ class CustomInputUtil extends StatefulWidget {
|
||||||
final TextInputAction textInputAction;
|
final TextInputAction textInputAction;
|
||||||
final TextInputType keyboardType;
|
final TextInputType keyboardType;
|
||||||
final int maxLength;
|
final int maxLength;
|
||||||
final FormFieldValidator<String>? validator;
|
final String? Function(String?)? validator;
|
||||||
final bool haveMaxLength;
|
final bool haveMaxLength;
|
||||||
|
final void Function(String)? onChanged;
|
||||||
|
|
||||||
CustomInputUtil(
|
CustomInputUtil(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
|
@ -27,6 +29,7 @@ class CustomInputUtil extends StatefulWidget {
|
||||||
required this.suffixIcon,
|
required this.suffixIcon,
|
||||||
this.autoFocus = false,
|
this.autoFocus = false,
|
||||||
required this.focusNode,
|
required this.focusNode,
|
||||||
|
this.onChanged,
|
||||||
this.textInputAction = TextInputAction.next,
|
this.textInputAction = TextInputAction.next,
|
||||||
this.keyboardType = TextInputType.text,
|
this.keyboardType = TextInputType.text,
|
||||||
this.maxLength = 80,
|
this.maxLength = 80,
|
||||||
|
@ -54,8 +57,14 @@ class _CustomInputUtilState extends State<CustomInputUtil> {
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
validator: widget.validator,
|
||||||
autofocus: widget.autoFocus,
|
autofocus: widget.autoFocus,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
|
'${widget.controller}',
|
||||||
|
const Duration(milliseconds: 500),
|
||||||
|
() => setState(() {}),
|
||||||
|
),
|
||||||
textInputAction: widget.textInputAction,
|
textInputAction: widget.textInputAction,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
@ -122,7 +131,6 @@ class _CustomInputUtilState extends State<CustomInputUtil> {
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(widget.maxLength)
|
LengthLimitingTextInputFormatter(widget.maxLength)
|
||||||
],
|
],
|
||||||
validator: widget.validator,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -18,6 +18,7 @@ class CustomSelect extends StatefulWidget {
|
||||||
FormFieldController<String> controller;
|
FormFieldController<String> controller;
|
||||||
dynamic Function(String?)? changed;
|
dynamic Function(String?)? changed;
|
||||||
String? dropDownValue;
|
String? dropDownValue;
|
||||||
|
bool isRequired;
|
||||||
|
|
||||||
CustomSelect({
|
CustomSelect({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -26,6 +27,7 @@ class CustomSelect extends StatefulWidget {
|
||||||
required this.hintText,
|
required this.hintText,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.changed,
|
required this.changed,
|
||||||
|
this.isRequired = false,
|
||||||
this.dropDownValue,
|
this.dropDownValue,
|
||||||
this.isMultiSelect = false,
|
this.isMultiSelect = false,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
@ -99,6 +101,39 @@ class _CustomSelectState extends State<CustomSelect> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (widget.isRequired)
|
||||||
|
if (widget.dropDownValue == null || widget.dropDownValue == '')
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional.only(top: 5, start: 15),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodySmall
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodySmallFamily,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodySmallFamily),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:developer';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -9,13 +10,13 @@ import 'package:hub/flutter_flow/upload_data.dart';
|
||||||
import 'package:hub/flutter_flow/uploaded_file.dart';
|
import 'package:hub/flutter_flow/uploaded_file.dart';
|
||||||
|
|
||||||
class MediaUploadButtonUtil extends StatefulWidget {
|
class MediaUploadButtonUtil extends StatefulWidget {
|
||||||
final FFUploadedFile uploadedFile;
|
final Function(FFUploadedFile) onUploadComplete;
|
||||||
final bool isUploading;
|
bool isUploading;
|
||||||
final String labelText;
|
final String labelText;
|
||||||
|
|
||||||
const MediaUploadButtonUtil(
|
MediaUploadButtonUtil(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.uploadedFile,
|
required this.onUploadComplete,
|
||||||
required this.isUploading,
|
required this.isUploading,
|
||||||
required this.labelText})
|
required this.labelText})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
@ -25,13 +26,12 @@ class MediaUploadButtonUtil extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
||||||
late FFUploadedFile _uploadedFile;
|
FFUploadedFile _uploadedFiles = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
late bool _isUploading;
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_uploadedFile = widget.uploadedFile ?? FFUploadedFile();
|
_uploadedFiles = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
_isUploading = widget.isUploading ?? false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -40,7 +40,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if ((_uploadedFile.bytes?.isNotEmpty ?? false)) {
|
if ((_uploadedFiles.bytes?.isNotEmpty ?? false)) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -48,14 +48,16 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isUploading = false;
|
widget.isUploading = false;
|
||||||
_uploadedFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
_uploadedFiles =
|
||||||
|
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
|
widget.onUploadComplete(_uploadedFiles);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
_uploadedFile.bytes ?? Uint8List.fromList([]),
|
_uploadedFiles.bytes ?? Uint8List.fromList([]),
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -77,7 +79,7 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
||||||
includeDimensions: true,
|
includeDimensions: true,
|
||||||
);
|
);
|
||||||
if (selectedMedia != null) {
|
if (selectedMedia != null) {
|
||||||
setState(() => _isUploading = true);
|
setState(() => widget.isUploading = true);
|
||||||
var selectedUploadedFiles = <FFUploadedFile>[];
|
var selectedUploadedFiles = <FFUploadedFile>[];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -95,15 +97,18 @@ class _MediaUploadButtonUtilState extends State<MediaUploadButtonUtil> {
|
||||||
// blurHash: m.blurHash,
|
// blurHash: m.blurHash,
|
||||||
))
|
))
|
||||||
.toList();
|
.toList();
|
||||||
|
log(selectedUploadedFiles.toString());
|
||||||
} finally {
|
} finally {
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
_isUploading = false;
|
widget.isUploading = false;
|
||||||
}
|
}
|
||||||
if (selectedUploadedFiles.length ==
|
if (selectedUploadedFiles.length ==
|
||||||
selectedMedia.length) {
|
selectedMedia.length) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_uploadedFile = selectedUploadedFiles.first;
|
_uploadedFiles = selectedUploadedFiles.first;
|
||||||
});
|
});
|
||||||
|
widget.onUploadComplete(_uploadedFiles);
|
||||||
|
|
||||||
showUploadMessage(context, 'Success!');
|
showUploadMessage(context, 'Success!');
|
||||||
} else {
|
} else {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
|
@ -3,12 +3,13 @@ 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';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:json_path/fun_sdk.dart';
|
||||||
|
|
||||||
class SubmitButtonUtil extends StatelessWidget {
|
class SubmitButtonUtil extends StatelessWidget {
|
||||||
final String labelText;
|
final String labelText;
|
||||||
final VoidCallback onPressed;
|
Future<void> Function()? onPressed;
|
||||||
|
|
||||||
const SubmitButtonUtil({
|
SubmitButtonUtil({
|
||||||
required this.labelText,
|
required this.labelText,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,17 +1,22 @@
|
||||||
import 'dart:developer';
|
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/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
import '/custom_code/actions/index.dart' as actions;
|
||||||
|
|
||||||
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
late final TabController tabBarController;
|
late final TabController tabBarController;
|
||||||
|
|
||||||
|
ApiCallResponse? petsResponse;
|
||||||
|
|
||||||
// Controller para o Upload de Arquivos
|
// Controller para o Upload de Arquivos
|
||||||
bool isDataUploading = false;
|
bool isDataUploading = false;
|
||||||
FFUploadedFile uploadedLocalFile =
|
FFUploadedFile uploadedLocalFile =
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
|
String? imgBase64;
|
||||||
|
|
||||||
// Controller para o DropDown
|
// Controller para o DropDown
|
||||||
String? dropDownValue1;
|
String? dropDownValue1;
|
||||||
|
@ -23,8 +28,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
// Controller para o TextField
|
// Controller para o TextField
|
||||||
FocusNode? textFieldFocusName;
|
FocusNode? textFieldFocusName;
|
||||||
TextEditingController? textControllerName;
|
TextEditingController? textControllerName;
|
||||||
String? Function(BuildContext, String?)? textControllerNameValidator;
|
String? textControllerNameValidator(BuildContext context, String? val) {
|
||||||
String? _textControllerNameValidator(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',
|
||||||
|
@ -36,11 +40,27 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
|
|
||||||
FocusNode? textFieldFocusSpecies;
|
FocusNode? textFieldFocusSpecies;
|
||||||
TextEditingController? textControllerSpecies;
|
TextEditingController? textControllerSpecies;
|
||||||
String? Function(BuildContext, String?)? textControllerSpeciesValidator;
|
String? textControllerSpeciesValidator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
FocusNode? textFieldFocusRace;
|
FocusNode? textFieldFocusRace;
|
||||||
TextEditingController? textControllerRace;
|
TextEditingController? textControllerRace;
|
||||||
String? Function(BuildContext, String?)? textControllerRaceValidator;
|
String? textControllerRaceValidator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
FocusNode? textFieldFocusColor;
|
FocusNode? textFieldFocusColor;
|
||||||
TextEditingController? textControllerColor;
|
TextEditingController? textControllerColor;
|
||||||
|
@ -49,8 +69,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
DateTime? selectedDate;
|
DateTime? selectedDate;
|
||||||
FocusNode? textFieldFocusData;
|
FocusNode? textFieldFocusData;
|
||||||
TextEditingController? textControllerData;
|
TextEditingController? textControllerData;
|
||||||
String? Function(BuildContext, String?)? textControllerDataValidator;
|
String? textControllerDataValidator(BuildContext context, String? val) {
|
||||||
String? _textControllerDataValidator(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.',
|
||||||
|
@ -74,8 +93,17 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
|
|
||||||
textFieldFocusName = FocusNode();
|
textFieldFocusName = FocusNode();
|
||||||
textControllerName = TextEditingController();
|
textControllerName = TextEditingController();
|
||||||
textControllerNameValidator =
|
// textControllerNameValidator =
|
||||||
(context, value) => _textControllerNameValidator(context, value);
|
// (context, value) => _textControllerNameValidator(context, value);
|
||||||
|
|
||||||
|
textFieldFocusSpecies = FocusNode();
|
||||||
|
textControllerSpecies = TextEditingController();
|
||||||
|
|
||||||
|
textFieldFocusRace = FocusNode();
|
||||||
|
textControllerRace = TextEditingController();
|
||||||
|
|
||||||
|
textFieldFocusColor = FocusNode();
|
||||||
|
textControllerColor = TextEditingController();
|
||||||
|
|
||||||
textFieldFocusData = FocusNode();
|
textFieldFocusData = FocusNode();
|
||||||
textControllerData = TextEditingController(
|
textControllerData = TextEditingController(
|
||||||
|
@ -83,7 +111,9 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
'dd/MM/yyyy',
|
'dd/MM/yyyy',
|
||||||
DateTime.now(),
|
DateTime.now(),
|
||||||
));
|
));
|
||||||
textControllerDataValidator = _textControllerDataValidator;
|
|
||||||
|
textFieldFocusObservation = FocusNode();
|
||||||
|
textControllerObservation = TextEditingController();
|
||||||
|
|
||||||
dropDownValueController1 =
|
dropDownValueController1 =
|
||||||
FormFieldController<String>(dropDownValue1 ??= 'Selecione uma opção');
|
FormFieldController<String>(dropDownValue1 ??= 'Selecione uma opção');
|
||||||
|
@ -117,4 +147,43 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
dropDownValueController1?.dispose();
|
dropDownValueController1?.dispose();
|
||||||
dropDownValueController2?.dispose();
|
dropDownValueController2?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validador do formulário
|
||||||
|
bool isFormValid(BuildContext context) {
|
||||||
|
if (uploadedLocalFile.bytes?.isEmpty ?? true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (textControllerName.text.isEmpty ||
|
||||||
|
textControllerName.text.length > 80 ||
|
||||||
|
textControllerName.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (textControllerSpecies.text.isEmpty ||
|
||||||
|
textControllerSpecies.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (textControllerRace.text.isEmpty || textControllerRace.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (textControllerData.text.isEmpty || textControllerData.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dropDownValue1 == null ||
|
||||||
|
dropDownValue1!.isEmpty ||
|
||||||
|
dropDownValue1 == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dropDownValue2 == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> registerPet() async {
|
||||||
|
if (isFormValid == true) {
|
||||||
|
imgBase64 = await actions.convertImageFileToBase64(
|
||||||
|
uploadedLocalFile,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:easy_debounce/easy_debounce.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -32,7 +33,8 @@ class PetsPageWidget extends StatefulWidget {
|
||||||
State<PetsPageWidget> createState() => _PetsPageWidgetState();
|
State<PetsPageWidget> createState() => _PetsPageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProviderStateMixin {
|
class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
late PetsPageModel _model;
|
late PetsPageModel _model;
|
||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
@ -60,9 +62,11 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
_model.textControllerObservation ??= TextEditingController();
|
_model.textControllerObservation ??= TextEditingController();
|
||||||
_model.textFieldFocusObservation ??= FocusNode();
|
_model.textFieldFocusObservation ??= FocusNode();
|
||||||
|
|
||||||
_model.dropDownValueController1 ??= FormFieldController<String>(_model.dropDownValue1 ??= '');
|
_model.dropDownValueController1 ??=
|
||||||
|
FormFieldController<String>(_model.dropDownValue1 ??= '');
|
||||||
|
|
||||||
_model.dropDownValueController2 ??= FormFieldController<String>(_model.dropDownValue2 ??= '');
|
_model.dropDownValueController2 ??=
|
||||||
|
FormFieldController<String>(_model.dropDownValue2 ??= '');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -71,6 +75,12 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
_model.dispose();
|
_model.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handleUploadComplete(FFUploadedFile uploadedFile) {
|
||||||
|
setState(() {
|
||||||
|
_model.uploadedLocalFile = uploadedFile;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
@ -111,11 +121,11 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
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),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -129,7 +139,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 20),
|
padding: const EdgeInsets.fromLTRB(0, 10, 0, 20),
|
||||||
child: MediaUploadButtonUtil(
|
child: MediaUploadButtonUtil(
|
||||||
uploadedFile: _model.uploadedLocalFile,
|
onUploadComplete: _handleUploadComplete,
|
||||||
isUploading: _model.isDataUploading,
|
isUploading: _model.isDataUploading,
|
||||||
labelText: FFLocalizations.of(context).getVariableText(
|
labelText: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Clique para adicionar a foto de seu Pet',
|
ptText: 'Clique para adicionar a foto de seu Pet',
|
||||||
|
@ -138,8 +148,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
),
|
),
|
||||||
CustomInputUtil(
|
CustomInputUtil(
|
||||||
controller: _model.textControllerName,
|
controller: _model.textControllerName,
|
||||||
validator:
|
validator: _model.textControllerNameValidator
|
||||||
_model.textControllerNameValidator.asValidator(context),
|
.asValidator(context),
|
||||||
focusNode: _model.textFieldFocusName,
|
focusNode: _model.textFieldFocusName,
|
||||||
labelText: FFLocalizations.of(context)
|
labelText: FFLocalizations.of(context)
|
||||||
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
||||||
|
@ -153,6 +163,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
||||||
child: CustomInputUtil(
|
child: CustomInputUtil(
|
||||||
controller: _model.textControllerSpecies,
|
controller: _model.textControllerSpecies,
|
||||||
|
validator: _model.textControllerSpeciesValidator
|
||||||
|
.asValidator(context),
|
||||||
focusNode: _model.textFieldFocusSpecies,
|
focusNode: _model.textFieldFocusSpecies,
|
||||||
labelText: FFLocalizations.of(context).getVariableText(
|
labelText: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Espécie', enText: 'Species'),
|
ptText: 'Espécie', enText: 'Species'),
|
||||||
|
@ -166,6 +178,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
||||||
child: CustomInputUtil(
|
child: CustomInputUtil(
|
||||||
controller: _model.textControllerRace,
|
controller: _model.textControllerRace,
|
||||||
|
validator: _model.textControllerRaceValidator
|
||||||
|
.asValidator(context),
|
||||||
focusNode: _model.textFieldFocusRace,
|
focusNode: _model.textFieldFocusRace,
|
||||||
labelText: FFLocalizations.of(context)
|
labelText: FFLocalizations.of(context)
|
||||||
.getVariableText(ptText: 'Raça', enText: 'Race'),
|
.getVariableText(ptText: 'Raça', enText: 'Race'),
|
||||||
|
@ -179,6 +193,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
||||||
child: CustomInputUtil(
|
child: CustomInputUtil(
|
||||||
controller: _model.textControllerColor,
|
controller: _model.textControllerColor,
|
||||||
|
validator: _model.textControllerColorValidator
|
||||||
|
.asValidator(context),
|
||||||
focusNode: _model.textFieldFocusColor,
|
focusNode: _model.textFieldFocusColor,
|
||||||
labelText: FFLocalizations.of(context)
|
labelText: FFLocalizations.of(context)
|
||||||
.getVariableText(ptText: 'Cor', enText: 'Color'),
|
.getVariableText(ptText: 'Cor', enText: 'Color'),
|
||||||
|
@ -206,7 +222,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
focusNode: _model.textFieldFocusData,
|
focusNode: _model.textFieldFocusData,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
autovalidateMode:
|
autovalidateMode:
|
||||||
AutovalidateMode.onUserInteraction,
|
AutovalidateMode.onUserInteraction,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
@ -214,17 +230,17 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.labelMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context)
|
hintText: FFLocalizations.of(context)
|
||||||
.getVariableText(
|
.getVariableText(
|
||||||
ptText: 'Data de Nascimento',
|
ptText: 'Data de Nascimento',
|
||||||
|
@ -233,25 +249,26 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.labelMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
lineHeight: 1.0,
|
lineHeight: 1.0,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
.customColor6,
|
.customColor6,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -259,44 +276,49 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
.primary,
|
.primary,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context).error,
|
.error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context).error,
|
.error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
suffixIcon: Icon(
|
suffixIcon: Icon(
|
||||||
Icons.date_range,
|
Icons.date_range,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context).accent1,
|
.accent1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontFamily:
|
||||||
.bodyMediumFamily,
|
FlutterFlowTheme.of(context)
|
||||||
letterSpacing: 0.0,
|
.bodyMediumFamily,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
letterSpacing: 0.0,
|
||||||
.containsKey(
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
FlutterFlowTheme.of(context)
|
.containsKey(
|
||||||
.bodyMediumFamily),
|
FlutterFlowTheme.of(context)
|
||||||
lineHeight: 1.8,
|
.bodyMediumFamily),
|
||||||
),
|
lineHeight: 1.8,
|
||||||
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
validator: _model.textControllerDataValidator
|
validator: _model
|
||||||
|
.textControllerDataValidator
|
||||||
.asValidator(context),
|
.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -319,40 +341,44 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
context,
|
context,
|
||||||
child!,
|
child!,
|
||||||
headerBackgroundColor:
|
headerBackgroundColor:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primary,
|
.primary,
|
||||||
headerForegroundColor:
|
headerForegroundColor:
|
||||||
FlutterFlowTheme.of(context).info,
|
FlutterFlowTheme.of(context)
|
||||||
headerTextStyle: FlutterFlowTheme.of(
|
.info,
|
||||||
context)
|
headerTextStyle:
|
||||||
.headlineLarge
|
FlutterFlowTheme.of(context)
|
||||||
.override(
|
.headlineLarge
|
||||||
fontFamily:
|
.override(
|
||||||
FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme
|
||||||
.headlineLargeFamily,
|
.of(context)
|
||||||
fontSize: 32.0,
|
.headlineLargeFamily,
|
||||||
letterSpacing: 0.0,
|
fontSize: 32.0,
|
||||||
fontWeight: FontWeight.w600,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
fontWeight:
|
||||||
.asMap()
|
FontWeight.w600,
|
||||||
.containsKey(FlutterFlowTheme
|
useGoogleFonts: GoogleFonts
|
||||||
.of(context)
|
.asMap()
|
||||||
.headlineLargeFamily),
|
.containsKey(
|
||||||
),
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.headlineLargeFamily),
|
||||||
|
),
|
||||||
pickerBackgroundColor:
|
pickerBackgroundColor:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
pickerForegroundColor:
|
pickerForegroundColor:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
selectedDateTimeBackgroundColor:
|
selectedDateTimeBackgroundColor:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primary,
|
.primary,
|
||||||
selectedDateTimeForegroundColor:
|
selectedDateTimeForegroundColor:
|
||||||
FlutterFlowTheme.of(context).info,
|
FlutterFlowTheme.of(context)
|
||||||
|
.info,
|
||||||
actionButtonForegroundColor:
|
actionButtonForegroundColor:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
iconSize: 24.0,
|
iconSize: 24.0,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -372,17 +398,17 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
_model.textControllerData =
|
_model.textControllerData =
|
||||||
TextEditingController(
|
TextEditingController(
|
||||||
text: dateTimeFormat(
|
text: dateTimeFormat(
|
||||||
'dd/MM/yyyy',
|
'dd/MM/yyyy',
|
||||||
_model.selectedDate,
|
_model.selectedDate,
|
||||||
locale: FFLocalizations.of(context)
|
locale: FFLocalizations.of(context)
|
||||||
.languageCode,
|
.languageCode,
|
||||||
));
|
));
|
||||||
log(_model.textControllerData.text);
|
log(_model.textControllerData.text);
|
||||||
_model.textControllerData?.selection =
|
_model.textControllerData?.selection =
|
||||||
TextSelection.collapsed(
|
TextSelection.collapsed(
|
||||||
offset: _model
|
offset: _model.textControllerData!
|
||||||
.textControllerData!.text.length,
|
.text.length,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -390,7 +416,8 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -412,15 +439,17 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
enText: 'Select the available options',
|
enText: 'Select the available options',
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
style: FlutterFlowTheme.of(context)
|
||||||
fontFamily:
|
.bodySmall
|
||||||
FlutterFlowTheme.of(context).bodySmallFamily,
|
.override(
|
||||||
letterSpacing: 0.0,
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
fontWeight: FontWeight.w600,
|
.bodySmallFamily,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
letterSpacing: 0.0,
|
||||||
FlutterFlowTheme.of(context)
|
fontWeight: FontWeight.w600,
|
||||||
.bodyMediumFamily),
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
),
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -431,13 +460,14 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
controller: _model.dropDownValueController1 ??=
|
controller: _model.dropDownValueController1 ??=
|
||||||
FormFieldController<String>(
|
FormFieldController<String>(
|
||||||
_model.dropDownValue1 ??= ''),
|
_model.dropDownValue1 ??= ''),
|
||||||
|
isRequired: true,
|
||||||
changed: (val) => safeSetState(() {
|
changed: (val) => safeSetState(() {
|
||||||
_model.dropDownValue1 = val;
|
_model.dropDownValue1 = val;
|
||||||
}),
|
}),
|
||||||
dropDownValue: _model.dropDownValue1,
|
dropDownValue: _model.dropDownValue1,
|
||||||
optionsLabel: [
|
optionsLabel: [
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getVariableText(
|
||||||
.getVariableText(ptText: 'Macho', enText: 'Male'),
|
ptText: 'Macho', enText: 'Male'),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Fêmea', enText: 'Female')
|
ptText: 'Fêmea', enText: 'Female')
|
||||||
],
|
],
|
||||||
|
@ -452,18 +482,19 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
controller: _model.dropDownValueController2 ??=
|
controller: _model.dropDownValueController2 ??=
|
||||||
FormFieldController<String>(
|
FormFieldController<String>(
|
||||||
_model.dropDownValue2 ??= ''),
|
_model.dropDownValue2 ??= ''),
|
||||||
|
isRequired: true,
|
||||||
changed: (val) => safeSetState(() {
|
changed: (val) => safeSetState(() {
|
||||||
_model.dropDownValue2 = val;
|
_model.dropDownValue2 = val;
|
||||||
}),
|
}),
|
||||||
optionsLabel: [
|
optionsLabel: [
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getVariableText(
|
||||||
.getVariableText(ptText: 'Mini', enText: 'Mini'),
|
ptText: 'Mini', enText: 'Mini'),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Pequeno', enText: 'Small'),
|
ptText: 'Pequeno', enText: 'Small'),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Médio', enText: 'Medium'),
|
ptText: 'Médio', enText: 'Medium'),
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getVariableText(
|
||||||
.getVariableText(ptText: 'Grande', enText: 'Big'),
|
ptText: 'Grande', enText: 'Big'),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Gigante', enText: 'Giant'),
|
ptText: 'Gigante', enText: 'Giant'),
|
||||||
],
|
],
|
||||||
|
@ -478,25 +509,30 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
24.0, 0, 0.0, 15),
|
24.0, 0, 0.0, 15),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Você tem alguma observação sobre o seu Pet?',
|
ptText:
|
||||||
|
'Você tem alguma observação sobre o seu Pet?',
|
||||||
enText:
|
enText:
|
||||||
'Do you have any observations about your Pet?',
|
'Do you have any observations about your Pet?',
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
style: FlutterFlowTheme.of(context)
|
||||||
fontFamily:
|
.bodySmall
|
||||||
FlutterFlowTheme.of(context).bodySmallFamily,
|
.override(
|
||||||
letterSpacing: 0.0,
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
fontWeight: FontWeight.w600,
|
.bodySmallFamily,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
letterSpacing: 0.0,
|
||||||
FlutterFlowTheme.of(context)
|
fontWeight: FontWeight.w600,
|
||||||
.bodyMediumFamily),
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
),
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
CustomInputUtil(
|
CustomInputUtil(
|
||||||
controller: _model.textControllerObservation,
|
controller: _model.textControllerObservation,
|
||||||
|
validator: _model.textControllerObservationValidator
|
||||||
|
.asValidator(context),
|
||||||
focusNode: _model.textFieldFocusObservation,
|
focusNode: _model.textFieldFocusObservation,
|
||||||
labelText: FFLocalizations.of(context).getVariableText(
|
labelText: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Escreva as suas observações aqui...',
|
ptText: 'Escreva as suas observações aqui...',
|
||||||
|
@ -511,9 +547,12 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
|
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
|
||||||
child: SubmitButtonUtil(
|
child: SubmitButtonUtil(
|
||||||
labelText: FFLocalizations.of(context).getVariableText(
|
labelText: FFLocalizations.of(context)
|
||||||
ptText: 'Cadastrar', enText: 'Register'),
|
.getVariableText(
|
||||||
onPressed: () {}),
|
ptText: 'Cadastrar', enText: 'Register'),
|
||||||
|
onPressed: _model.isFormValid(context)
|
||||||
|
? _model.registerPet
|
||||||
|
: null),
|
||||||
),
|
),
|
||||||
])),
|
])),
|
||||||
],
|
],
|
||||||
|
@ -521,5 +560,3 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -825,18 +825,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.5"
|
version: "10.0.4"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.5"
|
version: "3.0.3"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -913,10 +913,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.1"
|
version: "0.8.0"
|
||||||
material_symbols_icons:
|
material_symbols_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -937,10 +937,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.12.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1358,10 +1358,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.2"
|
version: "0.7.0"
|
||||||
timeago:
|
timeago:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1526,10 +1526,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.5"
|
version: "14.2.1"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
Loading…
Reference in New Issue