|
|
@ -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),
|
|
|
|