ajustes de inputs com apenas numeros, mascaras, textos
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rkm/widgets/title_input.dart';
|
||||
import '../config/color_palette.dart';
|
||||
import '../controllers/format_txt.dart';
|
||||
import 'error_default.dart';
|
||||
import 'input_text.dart';
|
||||
|
||||
@@ -20,6 +22,8 @@ class InputWithSubtitle extends StatelessWidget {
|
||||
int maxLines;
|
||||
Color colorBorder;
|
||||
String typeInput;
|
||||
int maxLength;
|
||||
List<TextInputFormatter> inputFormatters;
|
||||
|
||||
InputWithSubtitle({
|
||||
required this.subtitle,
|
||||
@@ -36,8 +40,10 @@ class InputWithSubtitle extends StatelessWidget {
|
||||
this.maxLines = 1,
|
||||
this.colorBorder = ColorPalette.white,
|
||||
required this.onChanged,
|
||||
this.widthError = 0.7
|
||||
});
|
||||
this.widthError = 0.7,
|
||||
this.maxLength = 200,
|
||||
List<TextInputFormatter>? inputFormatters, // Alteração aqui
|
||||
}) : inputFormatters = inputFormatters ?? [FormatText()];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -57,6 +63,8 @@ class InputWithSubtitle extends StatelessWidget {
|
||||
maxLines:maxLines,
|
||||
colorBorder: colorBorder,
|
||||
onChanged: onChanged,
|
||||
maxLength: maxLength,
|
||||
inputFormatters: inputFormatters,
|
||||
),
|
||||
typeInput=='normal'&&(enabled&&mandatory) && (labelInput=='Nome' && splited.length<=1) ?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(),
|
||||
typeInput!='normal'&&(enabled&&mandatory)&& errorInput!=''?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(),
|
||||
|
||||
Reference in New Issue
Block a user