添加渐变按钮

null_safety
张萌 4 years ago
parent f0efe06eef
commit bd07e09b4a

@ -14,16 +14,16 @@ class _ExampleButtonState extends State<ExampleButton> {
return ASScaffold(
title: 'Button',
body: ListView(
children: [ ASButton.delete(title: '删除订单',onpressed: (){},),
ASButton.info(title: '删除订单',onpressed: (){},),
ASButton.warn(title: '删除订单',onpressed: (){},),
ASButton.opration(title: '删除订单',onpressed: (){},),
children: [ ASButton.delete(title: '删除订单',onPressed: (){},),
ASButton.info(title: '删除订单',onPressed: (){},),
ASButton.warn(title: '删除订单',onPressed: (){},),
ASButton.opration(title: '删除订单',onPressed: (){},),
SizedBox(height: 12.w),
ASLongButton.solid(title: '确认',onpressed: (){},),
ASLongButton.hollow(title: '确认',onpressed: (){},),
ASLongButton.solid(title: '确认',onPressed: (){},),
ASLongButton.hollow(title: '确认',onPressed: (){},),
Padding(
padding: EdgeInsets.symmetric(horizontal: 100.w),
child: ASLongButton.solid(title: 'null',onpressed:(){} ),
child: ASLongButton.solid(title: 'null',onPressed:(){} ),
),
],
),

@ -1,6 +1,5 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleScaffold extends StatefulWidget {
ExampleScaffold({Key key}) : super(key: key);

@ -42,8 +42,8 @@ class _MyHomePageState extends State<MyHomePage> {
title: '安速组件',
body: ListView(
children: [
ASButton.info(title:'Button',onpressed: () => Get.to(ExampleButton())),
ASButton.info(title:'Scaffold', onpressed:() => Get.to(ExampleScaffold())),
ASButton.info(title:'Button',onPressed: () => Get.to(ExampleButton())),
ASButton.info(title:'Scaffold', onPressed:() => Get.to(ExampleScaffold())),
],
),
);

@ -30,7 +30,7 @@ class ASButton extends StatefulWidget {
final EdgeInsets padding;
///
final VoidCallback onpressed;
final VoidCallback onPressed;
///
final double width;
@ -44,7 +44,7 @@ class ASButton extends StatefulWidget {
this.textStyle,
this.padding,
@required this.title,
this.onpressed,
this.onPressed,
this.width,
}) : super(key: key);
@ -54,7 +54,7 @@ class ASButton extends StatefulWidget {
this.padding,
this.radius,
this.bgcolor,
this.onpressed,
this.onPressed,
@required this.title,
this.width})
: outline = true,
@ -69,7 +69,7 @@ class ASButton extends StatefulWidget {
this.textStyle,
this.padding,
@required this.title,
this.onpressed,
this.onPressed,
this.width})
: outline = true,
outlineColor = Color(0x73000000),
@ -83,7 +83,7 @@ class ASButton extends StatefulWidget {
this.textStyle,
this.padding,
@required this.title,
this.onpressed,
this.onPressed,
this.width})
: bgcolor = Color(0xFFFFB600),
textColor = Color(0xD9FFFFFF),
@ -96,7 +96,7 @@ class ASButton extends StatefulWidget {
this.textStyle,
this.padding,
@required this.title,
this.onpressed,
this.onPressed,
this.width})
: bgcolor = Color(0xFFF2F2F2),
textColor = Color(0xD9000000),
@ -113,7 +113,7 @@ class _ASButtonState extends State<ASButton> {
return MaterialButton(
minWidth: widget.width ?? 75.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: widget.onpressed,
onPressed: widget.onPressed,
child: widget.title is String
? Text(widget.title,
style: widget.textStyle ??

@ -29,7 +29,7 @@ class ASLongButton extends StatefulWidget {
final Color outlineColor;
///
final VoidCallback onpressed;
final VoidCallback onPressed;
///
final double width;
@ -44,7 +44,7 @@ class ASLongButton extends StatefulWidget {
this.padding,
this.outline = false,
this.outlineColor,
this.onpressed,
this.onPressed,
this.width})
: super(key: key);
@ -55,7 +55,7 @@ class ASLongButton extends StatefulWidget {
this.outlineColor,
this.radius,
@required this.title,
this.onpressed,
this.onPressed,
this.width,
}) : bgColor = Color(0xFFF6B72D),
textColor = Color(0xFFFFFFFF),
@ -66,7 +66,7 @@ class ASLongButton extends StatefulWidget {
this.radius,
this.textStyle,
this.padding,
this.onpressed,
this.onPressed,
@required this.title,
this.width})
: bgColor = Color(0xFFFFFFFF),
@ -85,7 +85,7 @@ class _ASLongButtonState extends State<ASLongButton> {
minWidth: widget.width ?? 280.w,
disabledColor: Color(0xFFC1BDB5),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: widget.onpressed,
onPressed: widget.onPressed,
child: widget.title is String
? Text(widget.title,
style: widget.textStyle ??

Loading…
Cancel
Save