From 22615333ba26af5b488214cc987276fc0179680f Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 1 Dec 2020 10:14:21 +0800 Subject: [PATCH] update search text field --- lib/text_field/as_search_text_field.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/text_field/as_search_text_field.dart b/lib/text_field/as_search_text_field.dart index ce1340e..66f8acd 100644 --- a/lib/text_field/as_search_text_field.dart +++ b/lib/text_field/as_search_text_field.dart @@ -13,7 +13,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { this.onSubmitted, this.margin, this.onPressed, - this.width, + this.height, }) : button = false, super(key: key); @@ -27,7 +27,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { this.onSubmitted, this.margin, this.onPressed, - this.width, + this.height, }) : button = true, super(key: key); @@ -55,13 +55,13 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { final VoidCallback onPressed; ///高度 - final double width; + final double height; @override _ASSearchTextFieldState createState() => _ASSearchTextFieldState(); @override - Size get preferredSize => Size.fromHeight(42); + Size get preferredSize => Size.fromHeight(this.height ?? 42.w); } class _ASSearchTextFieldState extends State { @@ -81,7 +81,6 @@ class _ASSearchTextFieldState extends State { vertical: 3.w, ), child: MaterialButton( - minWidth: widget.width, padding: EdgeInsets.zero, color: Color(0xFFF8F8F8), elevation: 0,