修改 as search text

master
张萌 3 years ago
parent b1b9666b37
commit 683cff887b

@ -1,4 +1,4 @@
{ {
"flutterSdkVersion": "2.0.2", "flutterSdkVersion": "2.8.1",
"flavors": {} "flavors": {}
} }

@ -51,7 +51,7 @@ packages:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -227,7 +227,7 @@ packages:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -288,7 +288,7 @@ packages:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
velocity_x: velocity_x:
dependency: transitive dependency: transitive
description: description:
@ -304,5 +304,5 @@ packages:
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
sdks: sdks:
dart: ">=2.12.0 <3.0.0" dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.0" flutter: ">=2.0.0"

@ -1,6 +1,6 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart';
///TextFiled ///TextFiled
class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
@ -14,6 +14,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.margin, this.margin,
this.onPressed, this.onPressed,
this.height, this.height,
this.prefix,
}) : button = false, }) : button = false,
super(key: key); super(key: key);
@ -28,6 +29,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.margin, this.margin,
this.onPressed, this.onPressed,
this.height, this.height,
this.prefix,
}) : button = true, }) : button = true,
super(key: key); super(key: key);
@ -57,6 +59,9 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
/// ///
final double? height; final double? height;
///
final Widget? prefix;
@override @override
_ASSearchTextFieldState createState() => _ASSearchTextFieldState(); _ASSearchTextFieldState createState() => _ASSearchTextFieldState();
@ -150,10 +155,16 @@ class _ASSearchTextFieldState extends State<ASSearchTextField> {
focusedErrorBorder: _border, focusedErrorBorder: _border,
prefixIcon: Padding( prefixIcon: Padding(
padding: EdgeInsets.only(left: 13.w, right: 8.w), padding: EdgeInsets.only(left: 13.w, right: 8.w),
child: Icon( child: Row(
Icons.search, mainAxisSize: MainAxisSize.min,
size: 16.w, children: [
color: Colors.black, Icon(
Icons.search,
size: 16.w,
color: Colors.black,
),
widget.prefix ?? SizedBox(),
],
), ),
), ),
prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0), prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0),

@ -16,7 +16,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.8.2"
auto_size_text_pk: auto_size_text_pk:
dependency: "direct main" dependency: "direct main"
description: description:
@ -44,14 +44,14 @@ packages:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -192,14 +192,14 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10" version: "0.12.11"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -267,7 +267,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.3.0" version: "0.4.3"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -281,7 +281,7 @@ packages:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
velocity_x: velocity_x:
dependency: "direct main" dependency: "direct main"
description: description:
@ -297,5 +297,5 @@ packages:
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
sdks: sdks:
dart: ">=2.12.0 <3.0.0" dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.0" flutter: ">=2.0.0"

Loading…
Cancel
Save