增加新标签类,整理example

null_safety
张萌 4 years ago
parent c9edb30402
commit 86d09eaac2

@ -13,17 +13,17 @@ class _ExampleBottomButtonState extends State<ExampleBottomButton> {
@override
Widget build(BuildContext context) {
return ASScaffold(
title: 'BottomButton',
title: 'ASBottomButton',
body: Center(),
bottomNavigationBar: Column(
mainAxisSize: MainAxisSize.min,
children: [
ASBottomButton.infinity(
title: 'null',
title: '无渐变infinity',
onPressed: () {},
),
ASBottomButton.gradient(
title: '新增地址',
title: '有渐变gradient',
onPressed: () {},
),
Row(
@ -31,13 +31,13 @@ class _ExampleBottomButtonState extends State<ExampleBottomButton> {
SizedBox(
width: 112.w,
child: ASBottomButton.shortWhite(
title: 'null',
title: 'shortwhite',
onPressed: () {},
),
),
Expanded(
child: ASBottomButton.gradient(
title: 'null',
title: '有渐变gradient',
onPressed: () {},
))
],

@ -1,6 +1,7 @@
import 'package:ansu_ui/scaffold/as_scaffold.dart';
import 'package:ansu_ui/tag/as_tag.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExampleTag extends StatefulWidget {
ExampleTag({Key key}) : super(key: key);
@ -12,16 +13,59 @@ class ExampleTag extends StatefulWidget {
class _ExampaleTagState extends State<ExampleTag> {
@override
Widget build(BuildContext context) {
return ASScaffold(title: 'Tag',
body: Column(
children: [
Row(
return ASScaffold(
title: 'ASTag',
body: Column(
children: [
ASTag.dangerousItem('带电'),
Row(
children: [
Text('yellowSolid'),
Spacer(),
ASTag.yellowSolid('带电'),
],
),
Row(
children: [
Text('redHollow'),
Spacer(),
ASTag.redHollow('带磁'),
],
),
Row(
children: [
Text('yellowHollow'),
Spacer(),
ASTag.yellowHollow('选填'),
],
),
Row(
children: [
Text('redHollow width:45.w'),
Spacer(),
ASTag.redHollow(
'未付款',
width: 45.w,
),
],
),
Row(
children: [
Text('yellowHollowS width:45.w'),
Spacer(),
ASTag.yellowHollowS(
'已付款',
width: 45.w,
),
],
),
Row(
children: [
Text('transport'),
Spacer(),
ASTag.transport('海运'),
],
),
],
),
],
)
);
));
}
}

@ -41,7 +41,7 @@ class ASTag extends StatefulWidget {
this.radius})
: super(key: key);
ASTag.dangerousItem(this.text,
ASTag.yellowSolid(this.text,
{Key key,
this.width,
this.height,
@ -53,6 +53,43 @@ class ASTag extends StatefulWidget {
outline = false,
super(key: key);
ASTag.redHollow(
this.text, {
Key key,
this.width,
this.height,
this.textStyle,
this.radius,
}) : bgColor = Color(0xFFFFFFFF),
textColor = Color(0xFFE50112),
outline = true,
outlineColor = Color(0xFFE50112),
super(key: key);
ASTag.yellowHollow(this.text,
{Key key, this.width, this.height, this.textStyle, this.radius})
: bgColor = Color(0xFFFFFFFF),
textColor = Color(0xFFFFBD32),
outline = true,
outlineColor = Color(0xFFFFBD32),
super(key: key);
ASTag.yellowHollowS(this.text,
{Key key, this.width, this.height, this.textStyle, this.radius})
: bgColor = Color(0xFFFFFFFF),
textColor = Color(0xFFF69A2D),
outline = true,
outlineColor = Color(0xFFF69A2D),
super(key: key);
ASTag.transport(this.text, {Key key, this.textStyle})
: bgColor = Color(0xFFFFFFFF),
textColor = Color(0xFF00B0FF),
outline = true,
outlineColor = Color(0xFF00B0FF),
radius = 3.w,
width = 38.w,
height = 19.w,
super(key: key);
@override
_ASTagState createState() => _ASTagState();
}
@ -68,6 +105,7 @@ class _ASTagState extends State<ASTag> {
color: widget.bgColor ?? Color(0xFFF69A2D),
border: widget.outline
? Border.all(
width: 1.w,
color: widget.outlineColor ?? Color(0xFFE50112),
)
: Border.fromBorderSide(BorderSide.none),

Loading…
Cancel
Save