Merge branch 'master' of 192.168.2.201:laiiihz/ansu_ui

* 'master' of 192.168.2.201:laiiihz/ansu_ui:
  修改tag
  颜色规范化调整
  颜色规范化
  更新颜色代码
  tag修改
  tag修改
null_safety
小赖 4 years ago
commit 3564cb0472

@ -18,6 +18,11 @@ List<ColorObject> colorObjects = [
name: '主要暗色', name: '主要暗色',
codeName: 'kDarkColor', codeName: 'kDarkColor',
), ),
ColorObject(
color: Color(0x73000000),
name: '次暗色',
codeName: 'kSubDarkColor',
),
ColorObject( ColorObject(
color: kDarkColor, color: kDarkColor,
name: '文本默认颜色', name: '文本默认颜色',
@ -28,6 +33,11 @@ List<ColorObject> colorObjects = [
name: '次文本颜色', name: '次文本颜色',
codeName: 'kTextSubColor', codeName: 'kTextSubColor',
), ),
ColorObject(
color: Color(0xD9FFFFFF),
name: '亮文本颜色',
codeName: 'kLightTextColor',
),
ColorObject( ColorObject(
color: Color(0xFFF6B72D), color: Color(0xFFF6B72D),
name: '主题色', name: '主题色',
@ -43,4 +53,19 @@ List<ColorObject> colorObjects = [
name: '背景色', name: '背景色',
codeName: 'kBackgroundColor', codeName: 'kBackgroundColor',
), ),
ColorObject(
color: Color(0xFFF69A2D),
name: '暗主题色',
codeName: 'kDarkPrimaryColor',
),
ColorObject(
color: Color(0xFFFFB600),
name: '亮主题色',
codeName: 'kLightPrimaryColor',
),
ColorObject(
color: Color(0xFFE50112),
name: '次主题色',
codeName: 'kSecondaryColor',
),
]; ];

@ -19,15 +19,15 @@ class _ExampaleTagState extends State<ExampleTag> {
children: [ children: [
ListTile( ListTile(
title: Text('yellowSolid'), title: Text('yellowSolid'),
trailing: ASTag.yellowSolid('带电'), trailing: ASTag.yellowSolid('带电',),
), ),
ListTile( ListTile(
title: Text('redHollow'), title: Text('redHollow'),
trailing: ASTag.redHollow('带磁'), trailing: ASTag.redHollow('带磁',width: 36.w,),
), ),
ListTile( ListTile(
title: Text('yellowHollow'), title: Text('yellowHollow'),
trailing: ASTag.yellowHollow('选填'), trailing: ASTag.yellowHollow('选填',width: 36.w,),
), ),
ListTile( ListTile(
title: Text('redHollow'), title: Text('redHollow'),

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -82,7 +83,7 @@ class ASBottomButton extends StatefulWidget {
this.begin, this.begin,
this.end}) this.end})
: colors = [Color(0xFFFFA700), Color(0xFFFFBD00)], : colors = [Color(0xFFFFA700), Color(0xFFFFBD00)],
textColor = Color(0xFFFFFFFF), textColor = kLightTextColor,
width = double.infinity, width = double.infinity,
super(key: key); super(key: key);
ASBottomButton.shortWhite({ ASBottomButton.shortWhite({
@ -97,7 +98,7 @@ class ASBottomButton extends StatefulWidget {
this.begin, this.begin,
this.end, this.end,
}) : colors = [Color(0xFFFBFBFB), Color(0xFFFFFFFF)], }) : colors = [Color(0xFFFBFBFB), Color(0xFFFFFFFF)],
textColor = Color(0xFFFFB800), textColor = kPrimaryColor,
width = double.infinity, width = double.infinity,
super(key: key); super(key: key);
@ -119,7 +120,7 @@ class _ASBottomButtonState extends State<ASBottomButton> {
), ),
child: MaterialButton( child: MaterialButton(
onPressed: widget.onPressed, onPressed: widget.onPressed,
textColor: widget.textColor ?? Color(0xFFFFFFFF), textColor: widget.textColor ?? kLightTextColor,
disabledColor: widget.disableColor, disabledColor: widget.disableColor,
disabledTextColor: widget.disableTextColor, disabledTextColor: widget.disableTextColor,
padding: widget.padding ?? padding: widget.padding ??

@ -90,8 +90,8 @@ class ASButton extends StatefulWidget {
this.disableTextColor, this.disableTextColor,
this.splashColor}) this.splashColor})
: outline = true, : outline = true,
outlineColor = Color(0x73000000), outlineColor = kDarkColor,
textColor = Color(0xD9000000), textColor = kTextColor,
super(key: key); super(key: key);
ASButton.warn( ASButton.warn(
@ -106,8 +106,8 @@ class ASButton extends StatefulWidget {
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.splashColor}) this.splashColor})
: bgcolor = Color(0xFFFFB600), : bgcolor = kLightPrimaryColor,
textColor = Color(0xD9FFFFFF), textColor = kLightTextColor,
outline = false, outline = false,
super(key: key); super(key: key);
ASButton.operation( ASButton.operation(
@ -123,7 +123,7 @@ class ASButton extends StatefulWidget {
this.disableTextColor, this.disableTextColor,
this.splashColor}) this.splashColor})
: bgcolor = Color(0xFFF2F2F2), : bgcolor = Color(0xFFF2F2F2),
textColor = Color(0xD9000000), textColor =kTextColor,
outline = false, outline = false,
super(key: key); super(key: key);
ASButton.order({ ASButton.order({
@ -133,13 +133,13 @@ class ASButton extends StatefulWidget {
this.outlineColor, this.outlineColor,
this.width, this.width,
this.splashColor, this.splashColor,
}) : bgcolor = Color(0xFFFFBD32), }) : bgcolor = kLightPrimaryColor,
textColor = Color(0xFF0000000), textColor = kTextColor,
textStyle = TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold), textStyle = TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold),
radius = 5.w, radius = 5.w,
outline = false, outline = false,
disableColor = Color(0xFFFFDF9B), disableColor = Color(0xFFFFDF9B),
disableTextColor = Color(0x73000000), disableTextColor = kTextSubColor,
padding = EdgeInsets.symmetric(vertical: 8.w), padding = EdgeInsets.symmetric(vertical: 8.w),
super(key: key); super(key: key);
@ -153,7 +153,7 @@ class _ASButtonState extends State<ASButton> {
return MaterialButton( return MaterialButton(
disabledColor: widget.disableColor, disabledColor: widget.disableColor,
disabledTextColor: widget.disableTextColor, disabledTextColor: widget.disableTextColor,
textColor: widget.textColor ?? Color(0xFFFFB600), textColor: widget.textColor ?? kLightPrimaryColor,
minWidth: widget.width ?? 75.w, minWidth: widget.width ?? 75.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: widget.onPressed, onPressed: widget.onPressed,

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -61,7 +62,7 @@ class ASGradientButton extends StatefulWidget {
this.onPressed, this.onPressed,
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
}) : textColor = Color(0xD9FFFFFF), }) : textColor = kLightTextColor,
radius = 19.w, radius = 19.w,
colors = [Color(0xFFF89B14), Color(0xFFF86B14)], colors = [Color(0xFFF89B14), Color(0xFFF86B14)],
width = 100.w, width = 100.w,
@ -102,7 +103,7 @@ class _ASGradientButtonState extends State<ASGradientButton> {
gradient: LinearGradient( gradient: LinearGradient(
begin: widget.begin ?? Alignment.topCenter, begin: widget.begin ?? Alignment.topCenter,
end: widget.end ?? Alignment.bottomCenter, end: widget.end ?? Alignment.bottomCenter,
colors: widget.colors ?? [Color(0xFFFFA700), Color(0xFFFFBD00)], colors: widget.colors ?? [kDarkPrimaryColor, kLightPrimaryColor],
), ),
borderRadius: BorderRadius.circular(widget.radius ?? 20.w), borderRadius: BorderRadius.circular(widget.radius ?? 20.w),
), ),

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -66,8 +67,8 @@ class ASLongButton extends StatefulWidget {
this.onPressed, this.onPressed,
this.width, this.width,
this.disableTextColor, this.disableTextColor,
}) : bgColor = Color(0xFFF6B72D), }) : bgColor = kDarkPrimaryColor,
textColor = Color(0xFFFFFFFF), textColor = kTextColor,
outline = false, outline = false,
disableColor = Color(0xFFC1BDB5), disableColor = Color(0xFFC1BDB5),
super(key: key); super(key: key);
@ -81,10 +82,10 @@ class ASLongButton extends StatefulWidget {
this.width, this.width,
this.disableColor, this.disableColor,
this.disableTextColor}) this.disableTextColor})
: bgColor = Color(0xFFFFFFFF), : bgColor = kForegroundColor,
textColor = Color(0xFFF6B72D), textColor = kDarkPrimaryColor,
outline = true, outline = true,
outlineColor = Color(0xFFF6B72D), outlineColor = kDarkPrimaryColor,
super(key: key); super(key: key);
@override @override
_ASLongButtonState createState() => _ASLongButtonState(); _ASLongButtonState createState() => _ASLongButtonState();
@ -96,7 +97,7 @@ class _ASLongButtonState extends State<ASLongButton> {
return MaterialButton( return MaterialButton(
minWidth: widget.width ?? 280.w, minWidth: widget.width ?? 280.w,
disabledColor: widget.disableColor, disabledColor: widget.disableColor,
textColor: widget.textColor ?? Color(0xFFFFFFFF), textColor: widget.textColor ?? kLightTextColor,
disabledTextColor: widget.disableTextColor, disabledTextColor: widget.disableTextColor,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: widget.onPressed, onPressed: widget.onPressed,
@ -110,7 +111,7 @@ class _ASLongButtonState extends State<ASLongButton> {
? BorderSide(color: widget.outlineColor, width: 1.w) ? BorderSide(color: widget.outlineColor, width: 1.w)
: BorderSide.none, : BorderSide.none,
borderRadius: BorderRadius.circular(widget.radius ?? 22.5.w)), borderRadius: BorderRadius.circular(widget.radius ?? 22.5.w)),
color: widget.bgColor ?? Color(0xFFFFFFFF), color: widget.bgColor ?? kForegroundColor,
elevation: 0, elevation: 0,
// // focusElevation: 0, // // focusElevation: 0,
// // hoverElevation: 0, // // hoverElevation: 0,

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -41,7 +42,7 @@ class _ASListTileState extends State<ASListTile> {
maxLines: 1, maxLines: 1,
overflow: TextOverflow.visible, overflow: TextOverflow.visible,
softWrap: false, softWrap: false,
style: TextStyle(color: Color(0xD9000000), fontSize: 14.sp), style: TextStyle(color: kTextColor, fontSize: 14.sp),
), ),
), ),
Expanded( Expanded(
@ -49,7 +50,7 @@ class _ASListTileState extends State<ASListTile> {
? Text( ? Text(
widget.text, widget.text,
maxLines: 2, maxLines: 2,
style: TextStyle(color: Color(0xA6000000), fontSize: 14.sp), style: TextStyle(color: kTextSubColor, fontSize: 14.sp),
) )
: widget.text, : widget.text,
), ),

@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
/// ///
const Color kDarkColor = Color(0xFF333333); const Color kDarkColor = Color(0xFF333333);
///
const Color kSubDarkColor = Color(0x73000000);
/// ///
const Color kTextColor = kDarkColor; const Color kTextColor = kDarkColor;
@ -20,3 +23,15 @@ const Color kBackgroundColor = Color(0xFFF6F6F6);
/// ///
const Color kDangerColor = Color(0xFFE50112); const Color kDangerColor = Color(0xFFE50112);
///
const Color kDarkPrimaryColor = Color(0xFFF69A2D);
///
const Color kLightPrimaryColor = Color(0xFFFFB600);
///
const Color kLightTextColor = Color(0xD9FFFFFF);
///
const Color kSecondaryColor = Color(0xFFE50112);

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -28,6 +29,9 @@ class ASTag extends StatefulWidget {
/// ///
final double radius; final double radius;
///
final EdgeInsetsGeometry padding;
ASTag( ASTag(
{Key key, {Key key,
this.width, this.width,
@ -38,7 +42,8 @@ class ASTag extends StatefulWidget {
this.textStyle, this.textStyle,
this.outline = false, this.outline = false,
this.outlineColor, this.outlineColor,
this.radius}) this.radius,
this.padding})
: super(key: key); : super(key: key);
ASTag.yellowSolid(this.text, ASTag.yellowSolid(this.text,
@ -47,9 +52,10 @@ class ASTag extends StatefulWidget {
this.height, this.height,
this.textStyle, this.textStyle,
this.outlineColor, this.outlineColor,
this.radius}) this.radius,
: bgColor = Color(0xFFF69A2D), this.padding})
textColor = Color(0xFFFFFFFF), : bgColor = kDarkPrimaryColor,
textColor = kLightTextColor,
outline = false, outline = false,
super(key: key); super(key: key);
@ -60,29 +66,40 @@ class ASTag extends StatefulWidget {
this.height, this.height,
this.textStyle, this.textStyle,
this.radius, this.radius,
}) : bgColor = Color(0xFFFFFFFF), this.padding,
textColor = Color(0xFFE50112), }) : bgColor = kForegroundColor,
textColor = kSecondaryColor,
outline = true, outline = true,
outlineColor = Color(0xFFE50112), outlineColor = kSecondaryColor,
super(key: key); super(key: key);
ASTag.yellowHollow(this.text, ASTag.yellowHollow(this.text,
{Key key, this.width, this.height, this.textStyle, this.radius}) {Key key,
: bgColor = Color(0xFFFFFFFF), this.width,
textColor = Color(0xFFFFBD32), this.height,
this.textStyle,
this.radius,
this.padding})
: bgColor = kForegroundColor,
textColor = kPrimaryColor,
outline = true, outline = true,
outlineColor = Color(0xFFFFBD32), outlineColor = kPrimaryColor,
super(key: key); super(key: key);
ASTag.yellowHollowS(this.text, ASTag.yellowHollowS(this.text,
{Key key, this.width, this.height, this.textStyle, this.radius}) {Key key,
: bgColor = Color(0xFFFFFFFF), this.width,
textColor = Color(0xFFF69A2D), this.height,
this.textStyle,
this.radius,
this.padding})
: bgColor = kForegroundColor,
textColor = kDarkPrimaryColor,
outline = true, outline = true,
outlineColor = Color(0xFFF69A2D), outlineColor = kDarkPrimaryColor,
super(key: key); super(key: key);
ASTag.transport(this.text, {Key key, this.textStyle}) ASTag.transport(this.text, {Key key, this.textStyle, this.padding})
: bgColor = Color(0xFFFFFFFF), : bgColor = kForegroundColor,
textColor = Color(0xFF00B0FF), textColor = Color(0xFF00B0FF),
outline = true, outline = true,
outlineColor = Color(0xFF00B0FF), outlineColor = Color(0xFF00B0FF),
@ -98,15 +115,15 @@ class _ASTagState extends State<ASTag> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
alignment: Alignment.center, padding: widget.padding ?? EdgeInsets.symmetric(horizontal: 6.w,vertical: 2.w),
width: widget.width ?? 36.w, width: widget.width,
height: widget.height ?? 18.w, height: widget.height,
decoration: BoxDecoration( decoration: BoxDecoration(
color: widget.bgColor ?? Color(0xFFF69A2D), color: widget.bgColor ?? kDarkPrimaryColor,
border: widget.outline border: widget.outline
? Border.all( ? Border.all(
width: 1.w, width: 1.w,
color: widget.outlineColor ?? Color(0xFFE50112), color: widget.outlineColor ?? kSecondaryColor,
) )
: Border.fromBorderSide(BorderSide.none), : Border.fromBorderSide(BorderSide.none),
borderRadius: BorderRadius.circular(widget.radius ?? 9.w)), borderRadius: BorderRadius.circular(widget.radius ?? 9.w)),

Loading…
Cancel
Save