update as tiles

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

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

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

Loading…
Cancel
Save