update as edit tile

master
张萌 3 years ago
parent 8f2a0d9a90
commit ead37b3aa6

@ -20,6 +20,12 @@ class _ExampleListTileState extends State<ExampleListTile> {
SizedBox( SizedBox(
height: 8.w, height: 8.w,
), ),
Row(
children: [
'ASOptionTile'.text.size(18.sp).black.make(),
'-ASListTile'.text.size(14.sp).black.make()
],
),
ASOptionTile( ASOptionTile(
items: [ items: [
ASListTile( ASListTile(
@ -54,6 +60,12 @@ class _ExampleListTileState extends State<ExampleListTile> {
], ],
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile'.text.size(18.sp).black.make(),
'-ASOptionTileItem'.text.size(14.sp).black.make()
],
),
ASOptionTile( ASOptionTile(
items: List.generate( items: List.generate(
3, 3,
@ -65,12 +77,24 @@ class _ExampleListTileState extends State<ExampleListTile> {
), ),
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile.single'.text.size(18.sp).black.make(),
'-ASEditTile'.text.size(14.sp).black.make()
],
),
ASOptionTile.single( ASOptionTile.single(
item: ASEditTile( item: ASEditTile(
title: Text('TEST'), title: Text('TEST'),
), ),
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile.single'.text.size(18.sp).black.make(),
'-ASVerticalTileItem'.text.size(14.sp).black.make()
],
),
ASOptionTile.single( ASOptionTile.single(
item: ASVerticalTileItem( item: ASVerticalTileItem(
title: Text('AS Vertical Tile'), title: Text('AS Vertical Tile'),
@ -78,6 +102,9 @@ class _ExampleListTileState extends State<ExampleListTile> {
), ),
), ),
20.hb, 20.hb,
Row(
children: ['ASOptionTile.single'.text.size(18.sp).black.make()],
),
ASOptionTile( ASOptionTile(
leading: '基础信息', leading: '基础信息',
items: [], items: [],

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart'; import 'package:ansu_ui/styles/as_colors.dart';
import 'package:ansu_ui/extension/num_extension.dart'; import 'package:ansu_ui/extension/num_extension.dart';
@ -10,6 +11,9 @@ class ASEditTile extends StatelessWidget {
final TextEditingController? controller; final TextEditingController? controller;
final Function(String text)? onChange; final Function(String text)? onChange;
final Function(String text)? onSubmitted; final Function(String text)? onSubmitted;
final List<FilteringTextInputFormatter>? inputFormatters;
final TextInputType? keyBoardType;
final TextStyle? hintTextStyle;
ASEditTile({ ASEditTile({
Key? key, Key? key,
this.title, this.title,
@ -18,6 +22,8 @@ class ASEditTile extends StatelessWidget {
this.prefix, this.prefix,
this.onChange, this.onChange,
this.onSubmitted, this.onSubmitted,
this.inputFormatters,
this.keyBoardType, this.hintTextStyle,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -40,6 +46,8 @@ class ASEditTile extends StatelessWidget {
child: TextField( child: TextField(
controller: controller, controller: controller,
onChanged: onChange, onChanged: onChange,
inputFormatters:inputFormatters,
keyboardType: keyBoardType,
onSubmitted: onSubmitted, onSubmitted: onSubmitted,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
@ -52,7 +60,7 @@ class ASEditTile extends StatelessWidget {
isDense: true, isDense: true,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
hintText: hintText, hintText: hintText,
hintStyle: TextStyle( hintStyle:hintTextStyle?? TextStyle(
color: kTextSubColor, color: kTextSubColor,
fontSize: 14.sp, fontSize: 14.sp,
), ),

Loading…
Cancel
Save