update as edit tile

master
张萌 3 years ago
parent 8f2a0d9a90
commit ead37b3aa6

@ -20,6 +20,12 @@ class _ExampleListTileState extends State<ExampleListTile> {
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<ExampleListTile> {
],
),
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<ExampleListTile> {
),
),
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<ExampleListTile> {
),
),
20.hb,
Row(
children: ['ASOptionTile.single'.text.size(18.sp).black.make()],
),
ASOptionTile(
leading: '基础信息',
items: [],

@ -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<FilteringTextInputFormatter>? 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,
),

Loading…
Cancel
Save