11import 'package:flutter/material.dart' ;
2- import 'package:flutter/services.dart' ;
32
43// Customised TextField
54class MyEditText extends StatefulWidget {
@@ -31,11 +30,8 @@ class _MyEditTextState extends State<MyEditText> {
3130 @override
3231 void initState () {
3332 super .initState ();
34- //widget.controller = TextEditingController(text: widget.text);
3533 // Cursor at the end
36- widget.controller.selection = TextSelection .fromPosition (
37- TextPosition (offset: widget.controller.text.length),
38- );
34+ widget.controller.selection = TextSelection .fromPosition (TextPosition (offset: widget.controller.text.length));
3935 }
4036
4137 @override
@@ -49,32 +45,22 @@ class _MyEditTextState extends State<MyEditText> {
4945 autofocus: widget.autofocus,
5046 maxLines: maxLines,
5147
52- textInputAction:
53- widget.multiline ? TextInputAction .newline : TextInputAction .done,
48+ textInputAction: widget.multiline ? TextInputAction .newline : TextInputAction .done,
5449
5550 decoration: InputDecoration (
5651 hintText: widget.hint,
5752 filled: true ,
5853 fillColor: Theme .of (context).colorScheme.surface,
59- contentPadding:
60- const EdgeInsets .symmetric (horizontal: 8 , vertical: 12 ),
54+ contentPadding: const EdgeInsets .symmetric (horizontal: 8 , vertical: 12 ),
6155 enabledBorder: OutlineInputBorder (
6256 borderRadius: BorderRadius .circular (8 ),
63- borderSide: BorderSide (
64- color: Theme .of (context).colorScheme.outline,
65- width: 1 ,
66- ),
57+ borderSide: BorderSide (color: Theme .of (context).colorScheme.outline, width: 1 ),
6758 ),
6859 focusedBorder: OutlineInputBorder (
6960 borderRadius: BorderRadius .circular (8 ),
70- borderSide: BorderSide (
71- color: Theme .of (context).colorScheme.primary,
72- width: 2 ,
73- ),
74- ),
75- hintStyle: TextStyle (
76- color: Theme .of (context).hintColor,
61+ borderSide: BorderSide (color: Theme .of (context).colorScheme.primary, width: 2 ),
7762 ),
63+ hintStyle: TextStyle (color: Theme .of (context).hintColor),
7864 ),
7965 );
8066 }
0 commit comments