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: '主要暗色',
codeName: 'kDarkColor',
),
ColorObject(
color: Color(0x73000000),
name: '次暗色',
codeName: 'kSubDarkColor',
),
ColorObject(
color: kDarkColor,
name: '文本默认颜色',
@ -28,6 +33,11 @@ List<ColorObject> colorObjects = [
name: '次文本颜色',
codeName: 'kTextSubColor',
),
ColorObject(
color: Color(0xD9FFFFFF),
name: '亮文本颜色',
codeName: 'kLightTextColor',
),
ColorObject(
color: Color(0xFFF6B72D),
name: '主题色',
@ -43,4 +53,19 @@ List<ColorObject> colorObjects = [
name: '背景色',
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: [
ListTile(
title: Text('yellowSolid'),
trailing: ASTag.yellowSolid('带电'),
trailing: ASTag.yellowSolid('带电',),
),
ListTile(
title: Text('redHollow'),
trailing: ASTag.redHollow('带磁'),
trailing: ASTag.redHollow('带磁',width: 36.w,),
),
ListTile(
title: Text('yellowHollow'),
trailing: ASTag.yellowHollow('选填'),
trailing: ASTag.yellowHollow('选填',width: 36.w,),
),
ListTile(
title: Text('redHollow'),

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

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

@ -1,3 +1,4 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -61,7 +62,7 @@ class ASGradientButton extends StatefulWidget {
this.onPressed,
this.disableColor,
this.disableTextColor,
}) : textColor = Color(0xD9FFFFFF),
}) : textColor = kLightTextColor,
radius = 19.w,
colors = [Color(0xFFF89B14), Color(0xFFF86B14)],
width = 100.w,
@ -102,7 +103,7 @@ class _ASGradientButtonState extends State<ASGradientButton> {
gradient: LinearGradient(
begin: widget.begin ?? Alignment.topCenter,
end: widget.end ?? Alignment.bottomCenter,
colors: widget.colors ?? [Color(0xFFFFA700), Color(0xFFFFBD00)],
colors: widget.colors ?? [kDarkPrimaryColor, kLightPrimaryColor],
),
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_screenutil/flutter_screenutil.dart';
@ -66,8 +67,8 @@ class ASLongButton extends StatefulWidget {
this.onPressed,
this.width,
this.disableTextColor,
}) : bgColor = Color(0xFFF6B72D),
textColor = Color(0xFFFFFFFF),
}) : bgColor = kDarkPrimaryColor,
textColor = kTextColor,
outline = false,
disableColor = Color(0xFFC1BDB5),
super(key: key);
@ -81,10 +82,10 @@ class ASLongButton extends StatefulWidget {
this.width,
this.disableColor,
this.disableTextColor})
: bgColor = Color(0xFFFFFFFF),
textColor = Color(0xFFF6B72D),
: bgColor = kForegroundColor,
textColor = kDarkPrimaryColor,
outline = true,
outlineColor = Color(0xFFF6B72D),
outlineColor = kDarkPrimaryColor,
super(key: key);
@override
_ASLongButtonState createState() => _ASLongButtonState();
@ -96,7 +97,7 @@ class _ASLongButtonState extends State<ASLongButton> {
return MaterialButton(
minWidth: widget.width ?? 280.w,
disabledColor: widget.disableColor,
textColor: widget.textColor ?? Color(0xFFFFFFFF),
textColor: widget.textColor ?? kLightTextColor,
disabledTextColor: widget.disableTextColor,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: widget.onPressed,
@ -110,7 +111,7 @@ class _ASLongButtonState extends State<ASLongButton> {
? BorderSide(color: widget.outlineColor, width: 1.w)
: BorderSide.none,
borderRadius: BorderRadius.circular(widget.radius ?? 22.5.w)),
color: widget.bgColor ?? Color(0xFFFFFFFF),
color: widget.bgColor ?? kForegroundColor,
elevation: 0,
// // focusElevation: 0,
// // hoverElevation: 0,

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

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

Loading…
Cancel
Save