fix: kurang element is touched

This commit is contained in:
Golek 2022-12-06 16:55:29 +07:00
parent f50576936e
commit 774d05a735
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class InputFile extends StatefulWidget {
this.allowMultiple = false, this.allowMultiple = false,
this.allowedExtensions = const ['jpg', 'jpeg', 'png', 'gif'], this.allowedExtensions = const ['jpg', 'jpeg', 'png', 'gif'],
required this.inputLabel, required this.inputLabel,
this.isTouched = false,
this.isError = false, this.isError = false,
this.messageError, this.messageError,
}) : super(key: key); }) : super(key: key);
@ -26,6 +27,7 @@ class InputFile extends StatefulWidget {
final bool? allowMultiple; final bool? allowMultiple;
final List<String>? allowedExtensions; final List<String>? allowedExtensions;
final String inputLabel; final String inputLabel;
final bool? isTouched;
final bool? isError; final bool? isError;
final String? messageError; final String? messageError;
@ -129,7 +131,7 @@ class _InputFileState extends State<InputFile> {
width: 335, width: 335,
child: IntrinsicHeight( child: IntrinsicHeight(
child: DashedRect( child: DashedRect(
color: widget.isError! color: widget.isError! && widget.isTouched!
? theme.dangerMainColor // jika error dan touched ? theme.dangerMainColor // jika error dan touched
: theme.neutral50Color, : theme.neutral50Color,
strokeWidth: 2.0, strokeWidth: 2.0,