更新样式
This commit is contained in:
@@ -11,18 +11,21 @@ class SearchWidget extends GetView {
|
||||
String? hint;
|
||||
Function? onChange;
|
||||
Function? findCallback;
|
||||
final EdgeInsetsGeometry? padding; // 新增 padding 参数
|
||||
|
||||
SearchWidget(
|
||||
{required this.keyword,
|
||||
required this.color,
|
||||
this.hint = "请输入关键字",
|
||||
this.findCallback,
|
||||
this.onChange});
|
||||
SearchWidget({
|
||||
required this.keyword,
|
||||
required this.color,
|
||||
this.hint = "请输入关键字",
|
||||
this.findCallback,
|
||||
this.onChange,
|
||||
this.padding, // 传入 padding 参数
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0),
|
||||
padding: padding ?? EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), // 使用传入的 padding 或默认值
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
@@ -42,7 +45,6 @@ class SearchWidget extends GetView {
|
||||
Container(
|
||||
width: 25.rpx,
|
||||
height: 25.rpx,
|
||||
// width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/query.svg',
|
||||
@@ -112,11 +114,6 @@ class SearchWidget extends GetView {
|
||||
color: Colors.black,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
// cursorColor:
|
||||
// FlutterFlowTheme.of(context).primaryText,
|
||||
// validator: _model
|
||||
// .textControllerValidator
|
||||
// .asValidator(context),
|
||||
onChanged: (d) {
|
||||
onChange?.call(d);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user