update button

update check tag
master
张萌 3 years ago
parent e9314cf399
commit f2aceb5c55

@ -64,7 +64,7 @@ class _ExampaleTagState extends State<ExampleTag> {
),
ListTile(
onTap: () => setState(() => _checked = !_checked),
title: Text('ASCheckedTag'),
title: Text('ASCheckTag'),
trailing: ASCheckTag(
checked: _checked,
text: 'TAG'.text.make(),

@ -21,7 +21,7 @@ class ASLongButton extends StatelessWidget {
final TextStyle? textStyle;
///
final Padding? padding;
final EdgeInsetsGeometry? padding;
///
final bool outline;
@ -98,10 +98,10 @@ class ASLongButton extends StatelessWidget {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: onPressed,
child: title is String
? Text(title,
style: textStyle ?? TextStyle(fontSize: 20.sp))
? Text(title, style: textStyle ?? TextStyle(fontSize: 20.sp))
: title,
padding: padding as EdgeInsetsGeometry? ?? EdgeInsets.symmetric(vertical: 8.w),
padding:
padding as EdgeInsetsGeometry? ?? EdgeInsets.symmetric(vertical: 8.w),
shape: RoundedRectangleBorder(
side: outline
? BorderSide(color: outlineColor!, width: 1.w)

@ -5,11 +5,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ASCheckTag extends StatelessWidget {
final bool checked;
final Widget text;
final Widget? text;
const ASCheckTag({
Key? key,
this.checked = false,
required this.text,
this.text,
}) : super(key: key);
@override
@ -39,15 +39,16 @@ class ASCheckTag extends StatelessWidget {
),
),
),
6.wb,
AnimatedDefaultTextStyle(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
style: TextStyle(
color: checked ? Color(0xFF00BF44) : Color(0xFFFF0000),
if (text != null) 6.wb,
if (text != null)
AnimatedDefaultTextStyle(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,
style: TextStyle(
color: checked ? Color(0xFF00BF44) : Color(0xFFFF0000),
),
child: text!,
),
child: text,
),
],
);
}

Loading…
Cancel
Save