diff --git a/example/lib/widgets/example_listtile.dart b/example/lib/widgets/example_listtile.dart index d06d3de..cb7b47b 100644 --- a/example/lib/widgets/example_listtile.dart +++ b/example/lib/widgets/example_listtile.dart @@ -20,6 +20,12 @@ class _ExampleListTileState extends State { SizedBox( height: 8.w, ), + Row( + children: [ + 'ASOptionTile'.text.size(18.sp).black.make(), + '-ASListTile'.text.size(14.sp).black.make() + ], + ), ASOptionTile( items: [ ASListTile( @@ -54,6 +60,12 @@ class _ExampleListTileState extends State { ], ), 20.hb, + Row( + children: [ + 'ASOptionTile'.text.size(18.sp).black.make(), + '-ASOptionTileItem'.text.size(14.sp).black.make() + ], + ), ASOptionTile( items: List.generate( 3, @@ -65,12 +77,24 @@ class _ExampleListTileState extends State { ), ), 20.hb, + Row( + children: [ + 'ASOptionTile.single'.text.size(18.sp).black.make(), + '-ASEditTile'.text.size(14.sp).black.make() + ], + ), ASOptionTile.single( item: ASEditTile( title: Text('TEST'), ), ), 20.hb, + Row( + children: [ + 'ASOptionTile.single'.text.size(18.sp).black.make(), + '-ASVerticalTileItem'.text.size(14.sp).black.make() + ], + ), ASOptionTile.single( item: ASVerticalTileItem( title: Text('AS Vertical Tile'), @@ -78,6 +102,9 @@ class _ExampleListTileState extends State { ), ), 20.hb, + Row( + children: ['ASOptionTile.single'.text.size(18.sp).black.make()], + ), ASOptionTile( leading: '基础信息', items: [], diff --git a/lib/list_tile/as_edit_tile.dart b/lib/list_tile/as_edit_tile.dart index 7f5dc1c..e3715cd 100644 --- a/lib/list_tile/as_edit_tile.dart +++ b/lib/list_tile/as_edit_tile.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:ansu_ui/styles/as_colors.dart'; import 'package:ansu_ui/extension/num_extension.dart'; @@ -10,6 +11,9 @@ class ASEditTile extends StatelessWidget { final TextEditingController? controller; final Function(String text)? onChange; final Function(String text)? onSubmitted; + final List? inputFormatters; + final TextInputType? keyBoardType; + final TextStyle? hintTextStyle; ASEditTile({ Key? key, this.title, @@ -18,6 +22,8 @@ class ASEditTile extends StatelessWidget { this.prefix, this.onChange, this.onSubmitted, + this.inputFormatters, + this.keyBoardType, this.hintTextStyle, }) : super(key: key); @override Widget build(BuildContext context) { @@ -40,6 +46,8 @@ class ASEditTile extends StatelessWidget { child: TextField( controller: controller, onChanged: onChange, + inputFormatters:inputFormatters, + keyboardType: keyBoardType, onSubmitted: onSubmitted, textAlign: TextAlign.end, style: TextStyle( @@ -52,7 +60,7 @@ class ASEditTile extends StatelessWidget { isDense: true, contentPadding: EdgeInsets.zero, hintText: hintText, - hintStyle: TextStyle( + hintStyle:hintTextStyle?? TextStyle( color: kTextSubColor, fontSize: 14.sp, ),