diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index de7d397..b8e6b4f 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "2.0.2", + "flutterSdkVersion": "2.8.1", "flavors": {} } \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index cf3b2c7..af1cb3a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -51,7 +51,7 @@ packages: name: characters url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -227,7 +227,7 @@ packages: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.7.0" path: dependency: transitive description: @@ -288,7 +288,7 @@ packages: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" velocity_x: dependency: transitive description: @@ -304,5 +304,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0" diff --git a/lib/text_field/as_search_text_field.dart b/lib/text_field/as_search_text_field.dart index 9dff27a..7d7c18b 100644 --- a/lib/text_field/as_search_text_field.dart +++ b/lib/text_field/as_search_text_field.dart @@ -1,6 +1,6 @@ +import 'package:ansu_ui/styles/as_colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:ansu_ui/styles/as_colors.dart'; ///TextFiled class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { @@ -14,6 +14,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { this.margin, this.onPressed, this.height, + this.prefix, }) : button = false, super(key: key); @@ -28,6 +29,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { this.margin, this.onPressed, this.height, + this.prefix, }) : button = true, super(key: key); @@ -57,6 +59,9 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { ///高度 final double? height; + ///搜索内容筛选 + final Widget? prefix; + @override _ASSearchTextFieldState createState() => _ASSearchTextFieldState(); @@ -150,10 +155,16 @@ class _ASSearchTextFieldState extends State { focusedErrorBorder: _border, prefixIcon: Padding( padding: EdgeInsets.only(left: 13.w, right: 8.w), - child: Icon( - Icons.search, - size: 16.w, - color: Colors.black, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.search, + size: 16.w, + color: Colors.black, + ), + widget.prefix ?? SizedBox(), + ], ), ), prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0), diff --git a/pubspec.lock b/pubspec.lock index 2d2f415..321e64b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -16,7 +16,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.1" + version: "2.8.2" auto_size_text_pk: dependency: "direct main" description: @@ -44,14 +44,14 @@ packages: name: characters url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: @@ -192,14 +192,14 @@ packages: name: matcher url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.10" + version: "0.12.11" meta: dependency: transitive description: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.7.0" path: dependency: transitive description: @@ -267,7 +267,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.0" + version: "0.4.3" typed_data: dependency: transitive description: @@ -281,7 +281,7 @@ packages: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" velocity_x: dependency: "direct main" description: @@ -297,5 +297,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0"