|
@@ -60,6 +60,12 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
|
_executionStateNotifier.addListener(() {
|
|
_executionStateNotifier.addListener(() {
|
|
setState(() {});
|
|
setState(() {});
|
|
});
|
|
});
|
|
|
|
+ if (widget.initialValue != null) {
|
|
|
|
+ _textController.value = TextEditingValue(
|
|
|
|
+ text: widget.initialValue!,
|
|
|
|
+ selection: TextSelection.collapsed(offset: widget.initialValue!.length),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
super.initState();
|
|
super.initState();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,12 +78,6 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- if (widget.initialValue != null) {
|
|
|
|
- _textController.value = TextEditingValue(
|
|
|
|
- text: widget.initialValue!,
|
|
|
|
- selection: TextSelection.collapsed(offset: widget.initialValue!.length),
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
final colorScheme = getEnteColorScheme(context);
|
|
final colorScheme = getEnteColorScheme(context);
|
|
final textTheme = getEnteTextTheme(context);
|
|
final textTheme = getEnteTextTheme(context);
|
|
var textInputChildren = <Widget>[];
|
|
var textInputChildren = <Widget>[];
|
|
@@ -96,6 +96,7 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
|
hintText: widget.hintText,
|
|
hintText: widget.hintText,
|
|
hintStyle: textTheme.body.copyWith(color: colorScheme.textMuted),
|
|
hintStyle: textTheme.body.copyWith(color: colorScheme.textMuted),
|
|
filled: true,
|
|
filled: true,
|
|
|
|
+ fillColor: colorScheme.fillFaint,
|
|
contentPadding: const EdgeInsets.fromLTRB(
|
|
contentPadding: const EdgeInsets.fromLTRB(
|
|
12,
|
|
12,
|
|
12,
|
|
12,
|
|
@@ -110,7 +111,7 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
|
borderRadius: BorderRadius.circular(8),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
),
|
|
suffixIcon: Padding(
|
|
suffixIcon: Padding(
|
|
- padding: const EdgeInsets.only(right: 12),
|
|
|
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
child: AnimatedSwitcher(
|
|
child: AnimatedSwitcher(
|
|
duration: const Duration(milliseconds: 175),
|
|
duration: const Duration(milliseconds: 175),
|
|
switchInCurve: Curves.easeInExpo,
|
|
switchInCurve: Curves.easeInExpo,
|
|
@@ -129,9 +130,9 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
|
),
|
|
),
|
|
suffixIconConstraints: const BoxConstraints(
|
|
suffixIconConstraints: const BoxConstraints(
|
|
maxHeight: 24,
|
|
maxHeight: 24,
|
|
- maxWidth: 36,
|
|
|
|
|
|
+ maxWidth: 48,
|
|
minHeight: 24,
|
|
minHeight: 24,
|
|
- minWidth: 36,
|
|
|
|
|
|
+ minWidth: 48,
|
|
),
|
|
),
|
|
prefixIcon: widget.prefixIcon != null
|
|
prefixIcon: widget.prefixIcon != null
|
|
? Icon(
|
|
? Icon(
|