update search text field

null_safety
张萌 4 years ago
parent f24b1556c6
commit 22615333ba

@ -13,7 +13,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.onSubmitted, this.onSubmitted,
this.margin, this.margin,
this.onPressed, this.onPressed,
this.width, this.height,
}) : button = false, }) : button = false,
super(key: key); super(key: key);
@ -27,7 +27,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.onSubmitted, this.onSubmitted,
this.margin, this.margin,
this.onPressed, this.onPressed,
this.width, this.height,
}) : button = true, }) : button = true,
super(key: key); super(key: key);
@ -55,13 +55,13 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
final VoidCallback onPressed; final VoidCallback onPressed;
/// ///
final double width; final double height;
@override @override
_ASSearchTextFieldState createState() => _ASSearchTextFieldState(); _ASSearchTextFieldState createState() => _ASSearchTextFieldState();
@override @override
Size get preferredSize => Size.fromHeight(42); Size get preferredSize => Size.fromHeight(this.height ?? 42.w);
} }
class _ASSearchTextFieldState extends State<ASSearchTextField> { class _ASSearchTextFieldState extends State<ASSearchTextField> {
@ -81,7 +81,6 @@ class _ASSearchTextFieldState extends State<ASSearchTextField> {
vertical: 3.w, vertical: 3.w,
), ),
child: MaterialButton( child: MaterialButton(
minWidth: widget.width,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
color: Color(0xFFF8F8F8), color: Color(0xFFF8F8F8),
elevation: 0, elevation: 0,

Loading…
Cancel
Save