update as tiles

master
张萌 3 years ago
parent 553e70f8b5
commit 264fb000b3

@ -14,6 +14,7 @@ class ASEditTile extends StatelessWidget {
final List<TextInputFormatter>? inputFormatters;
final TextInputType? keyBoardType;
final TextStyle? hintTextStyle;
final Widget? suffix;
ASEditTile({
Key? key,
this.title,
@ -23,13 +24,16 @@ class ASEditTile extends StatelessWidget {
this.onChange,
this.onSubmitted,
this.inputFormatters,
this.keyBoardType, this.hintTextStyle,
this.keyBoardType,
this.hintTextStyle,
this.suffix,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: BoxConstraints(minHeight: 46.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
10.wb,
InkWell(
@ -41,12 +45,15 @@ class ASEditTile extends StatelessWidget {
child: title ?? Text(''),
),
),
prefix ?? SizedBox(),
Offstage(
offstage: prefix == null,
child: prefix,
),
Expanded(
child: TextField(
controller: controller,
onChanged: onChange,
inputFormatters:inputFormatters,
inputFormatters: inputFormatters,
keyboardType: keyBoardType,
onSubmitted: onSubmitted,
textAlign: TextAlign.end,
@ -60,14 +67,19 @@ class ASEditTile extends StatelessWidget {
isDense: true,
contentPadding: EdgeInsets.zero,
hintText: hintText,
hintStyle:hintTextStyle?? TextStyle(
color: kTextSubColor,
fontSize: 14.sp,
),
hintStyle: hintTextStyle ??
TextStyle(
color: kTextSubColor,
fontSize: 14.sp,
),
),
),
),
10.wb,
Offstage(
offstage: suffix == null,
child: suffix,
)
],
),
);

@ -15,6 +15,7 @@ class ASOptionTile extends StatelessWidget {
final EdgeInsetsGeometry? padding;
///
///leading!=null items!=null
final dynamic leading;
///item 使`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile`
@ -36,13 +37,16 @@ class ASOptionTile extends StatelessWidget {
Container(
alignment: Alignment.centerLeft,
child: this.leading is String
? Text(
this.leading,
style: TextStyle(
color: kTextColor,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
)
? Padding(
padding:EdgeInsets.symmetric(vertical: 14.w,horizontal: 10.w),
child: Text(
this.leading,
style: TextStyle(
color: kTextColor,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
),
)
: this.leading,
),
);

Loading…
Cancel
Save