diff --git a/example/lib/sample/components/button/big_fu_example.dart b/example/lib/sample/components/button/big_fu_example.dart index 95b8d02f..0431cd52 100644 --- a/example/lib/sample/components/button/big_fu_example.dart +++ b/example/lib/sample/components/button/big_fu_example.dart @@ -1,4 +1,3 @@ -// @dart=2.9 import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/big_ghost_example.dart b/example/lib/sample/components/button/big_ghost_example.dart index 3b3d0e43..e9089d19 100644 --- a/example/lib/sample/components/button/big_ghost_example.dart +++ b/example/lib/sample/components/button/big_ghost_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/big_main_example.dart b/example/lib/sample/components/button/big_main_example.dart index 250f4ce9..827b528c 100644 --- a/example/lib/sample/components/button/big_main_example.dart +++ b/example/lib/sample/components/button/big_main_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/big_outline_example.dart b/example/lib/sample/components/button/big_outline_example.dart index 7adb4d96..74835b5a 100644 --- a/example/lib/sample/components/button/big_outline_example.dart +++ b/example/lib/sample/components/button/big_outline_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/bottom_button_entry_page.dart b/example/lib/sample/components/button/bottom_button_entry_page.dart index ce2ef9cf..314ceeb8 100644 --- a/example/lib/sample/components/button/bottom_button_entry_page.dart +++ b/example/lib/sample/components/button/bottom_button_entry_page.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:example/sample/components/button/common_collection_example.dart'; import 'package:example/sample/components/button/selection_collection_example.dart'; diff --git a/example/lib/sample/components/button/brn_small_outline_example.dart b/example/lib/sample/components/button/brn_small_outline_example.dart index 25d5fae5..f5ad0957 100644 --- a/example/lib/sample/components/button/brn_small_outline_example.dart +++ b/example/lib/sample/components/button/brn_small_outline_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/brn_text_button_panel_example.dart b/example/lib/sample/components/button/brn_text_button_panel_example.dart index 27d0ec77..0ebc055e 100644 --- a/example/lib/sample/components/button/brn_text_button_panel_example.dart +++ b/example/lib/sample/components/button/brn_text_button_panel_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/button_entry_page.dart b/example/lib/sample/components/button/button_entry_page.dart index 427d8fb4..c851ed43 100644 --- a/example/lib/sample/components/button/button_entry_page.dart +++ b/example/lib/sample/components/button/button_entry_page.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:example/sample/components/button/big_main_example.dart'; import 'package:example/sample/components/button/big_outline_example.dart'; diff --git a/example/lib/sample/components/button/button_panel_entry_page.dart b/example/lib/sample/components/button/button_panel_entry_page.dart index ad0a903d..3d6ef593 100644 --- a/example/lib/sample/components/button/button_panel_entry_page.dart +++ b/example/lib/sample/components/button/button_panel_entry_page.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:example/sample/components/button/brn_text_button_panel_example.dart'; import 'package:example/sample/components/button/button_panel_example.dart'; diff --git a/example/lib/sample/components/button/button_panel_example.dart b/example/lib/sample/components/button/button_panel_example.dart index e5b139bc..716e7687 100644 --- a/example/lib/sample/components/button/button_panel_example.dart +++ b/example/lib/sample/components/button/button_panel_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/common_collection_example.dart b/example/lib/sample/components/button/common_collection_example.dart index 7591e4ea..2fcd1863 100644 --- a/example/lib/sample/components/button/common_collection_example.dart +++ b/example/lib/sample/components/button/common_collection_example.dart @@ -252,7 +252,7 @@ class BrnCommonBottomExample extends StatelessWidget { ], ), Text( - '异常案例:按钮文本长为0', + '异常案例:按钮文本长为空串', style: TextStyle( color: Color(0xFF222222), fontSize: 28, diff --git a/example/lib/sample/components/button/icon_button_example.dart b/example/lib/sample/components/button/icon_button_example.dart index bda32e1b..b67f415e 100644 --- a/example/lib/sample/components/button/icon_button_example.dart +++ b/example/lib/sample/components/button/icon_button_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/button/selection_collection_example.dart b/example/lib/sample/components/button/selection_collection_example.dart index f882204b..e7fb766a 100644 --- a/example/lib/sample/components/button/selection_collection_example.dart +++ b/example/lib/sample/components/button/selection_collection_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -9,12 +7,11 @@ class BrnSelectionBottomButtonExample extends StatefulWidget { } class _BrnSelectionBottomButtonExampleState extends State { - BrnMultipleBottomController controller; + BrnMultipleBottomController controller = BrnMultipleBottomController(); @override void initState() { super.initState(); - controller = BrnMultipleBottomController(); } @override diff --git a/example/lib/sample/components/button/small_main_example.dart b/example/lib/sample/components/button/small_main_example.dart index e7fb3e5a..62296eee 100644 --- a/example/lib/sample/components/button/small_main_example.dart +++ b/example/lib/sample/components/button/small_main_example.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; diff --git a/example/lib/sample/components/step/brn_horizontal_step_example.dart b/example/lib/sample/components/step/brn_horizontal_step_example.dart index 376a6a4c..f65c31de 100644 --- a/example/lib/sample/components/step/brn_horizontal_step_example.dart +++ b/example/lib/sample/components/step/brn_horizontal_step_example.dart @@ -142,7 +142,7 @@ class _SliverBrnHorizontalStepsState extends State { final List _list = []; final int value = widget.valueNotifier.value.toInt(); for (int i = 0; i < value; i++) { - _list.add(BrunoStep(stepContentText: ('第${i + 1}步'))); + _list.add(BrunoStep(stepContentText: ('第你好11${i + 1}步'))); } return _list; } diff --git a/lib/src/components/button/brn_big_ghost_button.dart b/lib/src/components/button/brn_big_ghost_button.dart index 47f6702a..c75d2369 100644 --- a/lib/src/components/button/brn_big_ghost_button.dart +++ b/lib/src/components/button/brn_big_ghost_button.dart @@ -19,12 +19,6 @@ import 'package:flutter/material.dart'; /// * [BrnBigMainButton], 大主色调按钮 /// * [BrnBigOutlineButton], 大边框按钮 -/// 默认水平间距 -const double _BHorizontalPadding = 16; - -/// 默认垂直间距 -const double _BVerticalPadding = 8; - class BrnBigGhostButton extends StatelessWidget { ///按钮文案,默认'确认' final String title; @@ -71,8 +65,6 @@ class BrnBigGhostButton extends StatelessWidget { text: title, textColor: titleColor ?? defaultThemeConfig.commonConfig.brandPrimary, fontSize: defaultThemeConfig.bigButtonFontSize, - insertPadding: EdgeInsets.symmetric( - vertical: _BVerticalPadding, horizontal: _BHorizontalPadding), ); } } diff --git a/lib/src/components/button/brn_big_main_button.dart b/lib/src/components/button/brn_big_main_button.dart index 2b2eef22..26e5b8cd 100644 --- a/lib/src/components/button/brn_big_main_button.dart +++ b/lib/src/components/button/brn_big_main_button.dart @@ -27,12 +27,6 @@ import 'brn_normal_button.dart'; /// * [BrnBigGhostButton], 大主色调的幽灵按钮 /// * [BrnBigOutlineButton], 大边框按钮 -/// 默认水平间距 -const double _BHorizontalPadding = 16; - -/// 默认垂直间距 -const double _BVerticalPadding = 8; - class BrnBigMainButton extends StatelessWidget { ///按钮显示文案,默认'确认' final String title; @@ -82,8 +76,6 @@ class BrnBigMainButton extends StatelessWidget { textColor: Colors.white, disableTextColor: defaultThemeConfig.commonConfig.colorTextBaseInverse.withOpacity(0.7), - insertPadding: EdgeInsets.symmetric( - horizontal: _BHorizontalPadding, vertical: _BVerticalPadding), ); } } diff --git a/lib/src/components/button/brn_big_outline_button.dart b/lib/src/components/button/brn_big_outline_button.dart index c059f5c4..b6b6804d 100644 --- a/lib/src/components/button/brn_big_outline_button.dart +++ b/lib/src/components/button/brn_big_outline_button.dart @@ -28,12 +28,6 @@ import 'package:flutter/material.dart'; /// * [BrnBigGhostButton], 大幽灵按钮 /// -/// 默认水平间距 -const double _BHorizontalPadding = 16; - -/// 默认垂直间距 -const double _BVerticalPadding = 8; - /// 默认线宽 const double _BBorderWith = 1; @@ -95,8 +89,6 @@ class BrnBigOutlineButton extends StatelessWidget { width: width ?? double.infinity, height: defaultThemeConfig.bigButtonHeight), onTap: onTap, - insertPadding: EdgeInsets.symmetric( - vertical: _BVerticalPadding, horizontal: _BHorizontalPadding), backgroundColor: Colors.white, disableBackgroundColor: Color(0xffcccccc).withOpacity(0.1), ); diff --git a/lib/src/components/button/brn_icon_button.dart b/lib/src/components/button/brn_icon_button.dart index b3013947..57894d43 100644 --- a/lib/src/components/button/brn_icon_button.dart +++ b/lib/src/components/button/brn_icon_button.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/src/theme/brn_theme_configurator.dart'; import 'package:flutter/material.dart'; @@ -73,7 +71,7 @@ class BrnIconButton extends StatefulWidget { this.padding = 4, this.style, this.mainAxisAlignment = MainAxisAlignment.center, - }); + }): super(key: key); @override _BrnIconButtonState createState() => _BrnIconButtonState(); @@ -82,7 +80,7 @@ class BrnIconButton extends StatefulWidget { class _BrnIconButtonState extends State { @override Widget build(BuildContext context) { - Container? ctn; + Container ctn; // 图文的方向 bottom、文字在下 icon在上 top、文字在上 icon在下 // Left、文字在左 icon在右 right、文字在右 icon在左 if (widget.direction == Direction.bottom) { @@ -95,9 +93,7 @@ class _BrnIconButtonState extends State { children: [ // 图片 Container( - height: widget.iconHeight, - width: widget.iconWidth, - child: widget.iconWidget), + height: widget.iconHeight, width: widget.iconWidth, child: widget.iconWidget), Padding( padding: EdgeInsets.only(top: widget.padding), child: Text( @@ -107,23 +103,27 @@ class _BrnIconButtonState extends State { fontSize: 11, color: BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextSecondary, + .commonConfig + .colorTextSecondary, ), overflow: TextOverflow.ellipsis, ), ) ], )); - } else if (widget.direction == Direction.top) { + } else if (widget.direction == Direction.left) { ctn = Container( height: widget.widgetHeight, width: widget.widgetWidth, - child: Column( + child: Row( mainAxisAlignment: widget.mainAxisAlignment, mainAxisSize: MainAxisSize.min, children: [ + // 图片 + Container( + height: widget.iconHeight, width: widget.iconWidth, child: widget.iconWidget), Padding( - padding: EdgeInsets.only(bottom: widget.padding), + padding: EdgeInsets.only(left: widget.padding), child: Text( widget.name, style: widget.style ?? @@ -131,21 +131,15 @@ class _BrnIconButtonState extends State { fontSize: 11, color: BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextSecondary, + .commonConfig + .colorTextSecondary, ), overflow: TextOverflow.ellipsis, ), - ), - - // 图片 - Container( - child: widget.iconWidget, - height: widget.iconHeight, - width: widget.iconWidth, - ), + ) ], )); - } else if (widget.direction == Direction.left) { + } else if (widget.direction == Direction.right) { ctn = Container( height: widget.widgetHeight, width: widget.widgetWidth, @@ -153,13 +147,8 @@ class _BrnIconButtonState extends State { mainAxisAlignment: widget.mainAxisAlignment, mainAxisSize: MainAxisSize.min, children: [ - // 图片 - Container( - height: widget.iconHeight, - width: widget.iconWidth, - child: widget.iconWidget), Padding( - padding: EdgeInsets.only(left: widget.padding), + padding: EdgeInsets.only(right: widget.padding), child: Text( widget.name, style: widget.style ?? @@ -167,23 +156,27 @@ class _BrnIconButtonState extends State { fontSize: 11, color: BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextSecondary, + .commonConfig + .colorTextSecondary, ), overflow: TextOverflow.ellipsis, ), - ) + ), + // 图片 + Container( + height: widget.iconHeight, width: widget.iconWidth, child: widget.iconWidget), ], )); - } else if (widget.direction == Direction.right) { + } else { ctn = Container( height: widget.widgetHeight, width: widget.widgetWidth, - child: Row( + child: Column( mainAxisAlignment: widget.mainAxisAlignment, mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: EdgeInsets.only(right: widget.padding), + padding: EdgeInsets.only(bottom: widget.padding), child: Text( widget.name, style: widget.style ?? @@ -191,16 +184,19 @@ class _BrnIconButtonState extends State { fontSize: 11, color: BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextSecondary, + .commonConfig + .colorTextSecondary, ), overflow: TextOverflow.ellipsis, ), ), + // 图片 Container( - height: widget.iconHeight, - width: widget.iconWidth, - child: widget.iconWidget), + child: widget.iconWidget, + height: widget.iconHeight, + width: widget.iconWidth, + ), ], )); } @@ -213,6 +209,6 @@ class _BrnIconButtonState extends State { }, ); } - return ctn!; + return ctn; } } diff --git a/lib/src/components/button/brn_normal_button.dart b/lib/src/components/button/brn_normal_button.dart index 0898cbbf..a5dc4e91 100644 --- a/lib/src/components/button/brn_normal_button.dart +++ b/lib/src/components/button/brn_normal_button.dart @@ -1,3 +1,4 @@ +import 'package:bruno/src/constants/brn_constants.dart'; import 'package:bruno/src/utils/brn_multi_click_util.dart'; import 'package:flutter/material.dart'; @@ -7,8 +8,6 @@ const Color _BBackgroundColor = Color(0xFF0984F9); const Color _BDisableBackgroundColor = Color(0xFFCCCCCC); const FontWeight _BFontWeight = FontWeight.bold; const double _BRadius = 6; -const double _BHorizontalPadding = 16; -const double _BVerticalPadding = 8; /// 通用按钮,支持用户设置背景色、是否可用等属性 /// 若[BrnBigMainButton]、[BrnSmallMainButton]、[BrnBigOutlineButton]不能满足用户需要 @@ -80,22 +79,22 @@ class BrnNormalButton extends StatelessWidget { final String text; /// 按钮的文字颜色 默认白色[_BTextColor] - final Color? textColor; + final Color textColor; /// 按钮的文字大小 默认[_BFontSize] - final double? fontSize; + final double fontSize; /// 按钮不可用的文字颜色 final Color? disableTextColor; - /// 按钮不可用背景色 默认[_BDisableBackgroundColor] - final Color? disableBackgroundColor; - /// 按钮背景色 默认[_BBackgroundColor] - final Color? backgroundColor; + final Color backgroundColor; + + /// 按钮不可用背景色 默认[_BDisableBackgroundColor] + final Color disableBackgroundColor; /// 按钮内边距 默认水平[_BHorizontalPadding] 垂直[_BVerticalPadding] - final EdgeInsetsGeometry? insertPadding; + final EdgeInsetsGeometry insertPadding; /// 按钮的修饰 默认实色背景 final Decoration? decoration; @@ -107,68 +106,74 @@ class BrnNormalButton extends StatelessWidget { final TextStyle? textStyle; /// 按钮的文本Weight 默认是[FontWeight.bold] - final FontWeight? fontWeight; + final FontWeight fontWeight; /// 按钮的布局约束 默认是自适应大小 - final BoxConstraints? constraints; + final BoxConstraints constraints; /// 按钮的内部对齐 默认为null final Alignment? alignment; /// 按钮圆角大小 - final BorderRadiusGeometry? borderRadius; + final BorderRadiusGeometry borderRadius; - BrnNormalButton( - {required this.text, - this.backgroundColor, - this.isEnable = true, - this.onTap, - this.insertPadding, - this.decoration, - this.child, - this.textStyle, - this.fontWeight, - this.fontSize, - this.textColor, - this.disableTextColor, - this.disableBackgroundColor, - this.constraints, - this.borderRadius, - this.alignment}); + BrnNormalButton({ + Key? key, + required this.text, + this.backgroundColor = _BBackgroundColor, + this.isEnable = true, + this.onTap, + this.insertPadding = const EdgeInsets.symmetric( + vertical: BrnButtonConstant.verticalPadding, + horizontal: BrnButtonConstant.horizontalPadding), + this.decoration, + this.child, + this.textStyle, + this.fontWeight = _BFontWeight, + this.fontSize = _BFontSize, + this.textColor = _BTextColor, + this.disableTextColor, + this.disableBackgroundColor = _BDisableBackgroundColor, + this.constraints = const BoxConstraints.tightFor(), + this.borderRadius = const BorderRadius.all(Radius.circular(_BRadius)), + this.alignment, + }) : super(key: key); BrnNormalButton.outline({ + Key? key, Color? disableLineColor, Color? lineColor, double radius = 6, double borderWith = 1.0, required this.text, this.isEnable = true, - this.backgroundColor, - this.disableBackgroundColor, + this.backgroundColor = _BBackgroundColor, + this.disableBackgroundColor = _BDisableBackgroundColor, this.alignment, this.child, this.onTap, - this.textColor, - this.fontSize, + this.textColor = _BTextColor, + this.fontWeight = _BFontWeight, + this.fontSize = _BFontSize, this.disableTextColor, - this.insertPadding, + this.insertPadding = const EdgeInsets.symmetric( + vertical: BrnButtonConstant.verticalPadding, + horizontal: BrnButtonConstant.horizontalPadding), this.textStyle, - this.fontWeight, - this.constraints, - this.borderRadius, - }) : decoration = _OutlineBoxDecorationCreator.createOutlineBoxDecoration( + this.constraints = const BoxConstraints.tightFor(), + this.borderRadius = const BorderRadius.all(Radius.circular(_BRadius)), + }) : decoration = _OutlineBoxDecorationCreator.createOutlineBoxDecoration( isEnable: isEnable, disableBackgroundColor: disableBackgroundColor, disableLineColor: disableLineColor, lineColor: lineColor, backgroundColor: backgroundColor, radius: radius, - borderWith: borderWith); + borderWith: borderWith), + super(key: key); @override Widget build(BuildContext context) { - Color? bgColor = _getBackgroundColor(); - return GestureDetector( onTap: () { if (BrnMultiClickUtils.isMultiClick()) { @@ -180,11 +185,9 @@ class BrnNormalButton extends StatelessWidget { }, child: Container( alignment: alignment, - decoration: decoration ?? _getBoxDecoration(bgColor), - constraints: constraints ?? BoxConstraints.tightFor(), - padding: insertPadding ?? - EdgeInsets.symmetric( - vertical: _BVerticalPadding, horizontal: _BHorizontalPadding), + decoration: decoration ?? _getBoxDecoration(_getBackgroundColor()), + constraints: constraints, + padding: insertPadding, child: child ?? Text( text, @@ -196,65 +199,48 @@ class BrnNormalButton extends StatelessWidget { ); } - TextStyle? _getTextStyle() { + TextStyle _getTextStyle() { if (textStyle != null) { - return textStyle; + return textStyle!; } - Color? textColor; + Color textColor; if (isEnable) { textColor = this.textColor; - if (textColor == null) { - textColor = _BTextColor; - } } else { - textColor = this.disableTextColor; - if (textColor == null) { - textColor = (this.textColor ?? _BTextColor).withOpacity(0.7); - } + textColor = this.disableTextColor ?? (this.textColor).withOpacity(0.7); } return TextStyle( - fontSize: fontSize ?? _BFontSize, + fontSize: fontSize, color: textColor, - fontWeight: fontWeight ?? _BFontWeight, + fontWeight: fontWeight, ); } - Color? _getBackgroundColor() { - Color? bgColor; - if (isEnable) { - bgColor = backgroundColor; - if (bgColor == null) { - bgColor = _BBackgroundColor; - } - } else { - bgColor = disableBackgroundColor; - if (bgColor == null) { - bgColor = _BDisableBackgroundColor; - } - } - return bgColor; + Color _getBackgroundColor() { + return isEnable ? backgroundColor : disableBackgroundColor; } BoxDecoration _getBoxDecoration(Color? bgColor) { return BoxDecoration( color: bgColor, - borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(_BRadius)), + borderRadius: borderRadius, ); } } class _OutlineBoxDecorationCreator { - static BoxDecoration createOutlineBoxDecoration( - {required bool isEnable, - Color? disableLineColor, - Color? lineColor, - Color? disableBackgroundColor, - Color? backgroundColor, - double radius = 6, - double borderWith = 1.0}) { + static BoxDecoration createOutlineBoxDecoration({ + required bool isEnable, + Color? disableLineColor, + Color? lineColor, + required Color backgroundColor, + required Color disableBackgroundColor, + double radius = 6, + double borderWith = 1.0, + }) { Color _lineColor = isEnable ? lineColor! : disableLineColor!; - Color? _bgColor = isEnable ? backgroundColor : disableBackgroundColor; + Color _bgColor = isEnable ? backgroundColor : disableBackgroundColor; return BoxDecoration( border: Border.all(color: _lineColor, width: borderWith), diff --git a/lib/src/components/button/brn_small_main_button.dart b/lib/src/components/button/brn_small_main_button.dart index 5ee3876e..4bb05cec 100644 --- a/lib/src/components/button/brn_small_main_button.dart +++ b/lib/src/components/button/brn_small_main_button.dart @@ -1,8 +1,7 @@ - - import 'dart:math'; import 'package:bruno/src/components/button/brn_normal_button.dart'; +import 'package:bruno/src/constants/brn_constants.dart'; import 'package:bruno/src/theme/brn_theme.dart'; import 'package:flutter/material.dart'; @@ -22,12 +21,6 @@ import 'package:flutter/material.dart'; /// /// -/// 默认水平间距 -const double _BHorizontalPadding = 6; - -/// 默认垂直间距 -const double _BVerticalPadding = 8; - /// 默认最小宽度 const double _BMinWidth = 84; @@ -40,11 +33,11 @@ class BrnSmallMainButton extends StatelessWidget { ///是否可用,默认为true。false为不可用:置灰、不可点击。 final bool isEnable; - final Color? textColor; final Color? bgColor; - final double? radius; - final FontWeight? fontWeight; + final Color textColor; + final FontWeight fontWeight; final double? fontSize; + final double? radius; final double? maxWidth; final double? width; @@ -53,45 +46,46 @@ class BrnSmallMainButton extends StatelessWidget { /// 传入属性优先级最高,未传入的走默认配置,更多请看[BrnSmallMainButtonConfig.defaultConfig] const BrnSmallMainButton({ + Key? key, this.title = '确认', this.onTap, this.isEnable = true, - this.textColor, this.bgColor, - this.fontWeight, + this.textColor = Colors.white, + this.fontWeight = FontWeight.w600, this.fontSize, this.radius, this.maxWidth, this.width, this.themeData, - }); + }): super(key: key); @override Widget build(BuildContext context) { BrnButtonConfig defaultThemeConfig = themeData ?? BrnButtonConfig(); - defaultThemeConfig = defaultThemeConfig.merge(BrnButtonConfig( - smallButtonFontSize: fontSize, smallButtonRadius: radius)); + defaultThemeConfig = defaultThemeConfig + .merge(BrnButtonConfig(smallButtonFontSize: fontSize, smallButtonRadius: radius)); defaultThemeConfig = BrnThemeConfigurator.instance .getConfig(configId: defaultThemeConfig.configId) - .buttonConfig.merge(defaultThemeConfig); + .buttonConfig + .merge(defaultThemeConfig); - TextPainter textPainter = - TextPainter(textScaleFactor: MediaQuery.of(context).textScaleFactor); + TextPainter textPainter = TextPainter(textScaleFactor: MediaQuery.of(context).textScaleFactor); return LayoutBuilder( builder: (_, con) { TextStyle style = TextStyle( fontSize: defaultThemeConfig.smallButtonFontSize, - fontWeight: fontWeight ?? FontWeight.w600, - color: textColor ?? Colors.white, + fontWeight: fontWeight, + color: textColor, ); textPainter.textDirection = TextDirection.ltr; textPainter.text = TextSpan(text: title, style: style); textPainter.layout(maxWidth: con.maxWidth); double textWidth = textPainter.width; //按钮本身大小 - double _maxWidth = textWidth + _BHorizontalPadding * 2; + double _maxWidth = textWidth + BrnButtonConstant.horizontalPadding * 2; double _minWidth = min(_BMinWidth, con.maxWidth); //保证最小宽度是 (84、可用空间)的最小值 @@ -118,15 +112,11 @@ class BrnSmallMainButton extends StatelessWidget { ), alignment: Alignment.center, text: title, - backgroundColor: - bgColor ?? defaultThemeConfig.commonConfig.brandPrimary, + backgroundColor: bgColor ?? defaultThemeConfig.commonConfig.brandPrimary, disableBackgroundColor: Color(0xFFCCCCCC), - borderRadius: BorderRadius.all( - Radius.circular(defaultThemeConfig.smallButtonRadius)), + borderRadius: BorderRadius.all(Radius.circular(defaultThemeConfig.smallButtonRadius)), onTap: onTap, textStyle: style, - insertPadding: EdgeInsets.symmetric( - vertical: _BVerticalPadding, horizontal: _BHorizontalPadding), ); }, ); diff --git a/lib/src/components/button/brn_small_outline_button.dart b/lib/src/components/button/brn_small_outline_button.dart index ad43adb2..e415ec20 100644 --- a/lib/src/components/button/brn_small_outline_button.dart +++ b/lib/src/components/button/brn_small_outline_button.dart @@ -3,14 +3,12 @@ import 'dart:math'; import 'package:bruno/src/components/button/brn_normal_button.dart'; +import 'package:bruno/src/constants/brn_constants.dart'; import 'package:bruno/src/theme/brn_theme.dart'; import 'package:flutter/material.dart'; /// 边框 小、次按钮,小灰框,默认按钮确认,支持自定义边框、文字颜色 -Color greyColor = Color(0xffD7D7D7); -Color normalColor = Color(0xffF0F0F0); - /// 小的边框按钮 /// 该按钮有一个最小的宽度84,在此基础上,宽度随着文本内容的多少变更 /// @@ -21,12 +19,6 @@ Color normalColor = Color(0xffF0F0F0); /// 其他按钮如下: /// * [BrnSmallMainButton], 小主色调按钮 -/// 默认水平间距 -const double _BHorizontalPadding = 6; - -/// 默认垂直间距 -const double _BVerticalPadding = 8; - /// 默认最小宽度 const double _BMinWidth = 84; @@ -56,7 +48,7 @@ class BrnSmallOutlineButton extends StatelessWidget { final double? width; ///字体weigh - final FontWeight? fontWeight; + final FontWeight fontWeight; ///字体大小 final double fontSize; @@ -66,6 +58,7 @@ class BrnSmallOutlineButton extends StatelessWidget { /// 传入属性优先级最高,未传入的走默认配置,更多请看[BrnSmallSecondaryOutlineButtonConfig.defaultConfig] const BrnSmallOutlineButton({ + Key? key, this.title = '确认', this.onTap, this.isEnable = true, @@ -74,9 +67,9 @@ class BrnSmallOutlineButton extends StatelessWidget { this.radius, this.width, this.fontSize = 14, - this.fontWeight, + this.fontWeight = FontWeight.w600, this.themeData, - }); + }): super(key: key); @override Widget build(BuildContext context) { @@ -97,7 +90,7 @@ class BrnSmallOutlineButton extends StatelessWidget { builder: (_, con) { TextStyle style = TextStyle( fontSize: defaultThemeConfig.smallButtonFontSize, - fontWeight: fontWeight ?? FontWeight.w600, + fontWeight: fontWeight, ); textPainter.textDirection = TextDirection.ltr; @@ -105,7 +98,7 @@ class BrnSmallOutlineButton extends StatelessWidget { textPainter.layout(maxWidth: con.maxWidth); double textWidth = textPainter.width; double _maxWidth = - textWidth + _BHorizontalPadding * 2 + 2 * _BBorderWith; + textWidth + BrnButtonConstant.horizontalPadding * 2 + 2 * _BBorderWith; double _minWidth = min(_BMinWidth, con.maxWidth); if (_maxWidth <= _minWidth) { @@ -132,8 +125,6 @@ class BrnSmallOutlineButton extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: defaultThemeConfig.smallButtonFontSize, onTap: onTap, - insertPadding: EdgeInsets.symmetric( - vertical: _BVerticalPadding, horizontal: _BHorizontalPadding), backgroundColor: Colors.white, disableBackgroundColor: Color(0xffcccccc).withOpacity(0.1), ); diff --git a/lib/src/components/button/brn_vertical_icon_button.dart b/lib/src/components/button/brn_vertical_icon_button.dart index d594d24d..5576c4e9 100644 --- a/lib/src/components/button/brn_vertical_icon_button.dart +++ b/lib/src/components/button/brn_vertical_icon_button.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/src/components/button/brn_icon_button.dart'; import 'package:flutter/material.dart'; @@ -37,9 +35,12 @@ class BrnVerticalIconButton extends StatelessWidget { /// 按钮点击的回调 final VoidCallback? onTap; - const BrnVerticalIconButton( - {Key? key, required this.name, required this.iconWidget, this.onTap}) - : super(key: key); + const BrnVerticalIconButton({ + Key? key, + required this.name, + required this.iconWidget, + this.onTap, + }) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/src/components/button/collection/brn_bottom_button_panel.dart b/lib/src/components/button/collection/brn_bottom_button_panel.dart index da9bfc01..70f670f7 100644 --- a/lib/src/components/button/collection/brn_bottom_button_panel.dart +++ b/lib/src/components/button/collection/brn_bottom_button_panel.dart @@ -110,10 +110,7 @@ class BrnBottomButtonPanel extends StatelessWidget { List? iconButtonList}) { if ((buttonTitleList.isEmpty) && iconButtonList == null) { - return Container( - height: 0, - width: 0, - ); + return SizedBox.shrink(); } if (buttonTitleList.length >= 2) { return BrnBottomButtonPanel( @@ -146,10 +143,7 @@ class BrnBottomButtonPanel extends StatelessWidget { iconButtonList: iconButtonList, ); } - return Container( - height: 0, - width: 0, - ); + return SizedBox.shrink(); } @override diff --git a/lib/src/components/button/collection/brn_button_panel.dart b/lib/src/components/button/collection/brn_button_panel.dart index 71461dd3..8d2442c4 100644 --- a/lib/src/components/button/collection/brn_button_panel.dart +++ b/lib/src/components/button/collection/brn_button_panel.dart @@ -138,8 +138,7 @@ class _BrnButtonPanelState extends State { } return Padding( - padding: EdgeInsets.fromLTRB( - widget.horizontalPadding, 0, widget.horizontalPadding, 0), + padding: EdgeInsets.fromLTRB(widget.horizontalPadding, 0, widget.horizontalPadding, 0), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: list, @@ -157,9 +156,8 @@ class _BrnButtonPanelState extends State { } Widget _secondaryButton(int btnIndex) { - String? name = _secondaryButtonList[btnIndex].name; BrnSmallOutlineButton button = BrnSmallOutlineButton( - title: name ?? '确认', + title:_secondaryButtonList[btnIndex].name, isEnable: _secondaryButtonList[btnIndex].isEnable, onTap: () { if (widget.secondaryButtonOnTap != null) { @@ -178,7 +176,7 @@ class _BrnButtonPanelState extends State { if (_secondaryButtonList.length > 2) { List list = []; for (int i = 2; i < _secondaryButtonList.length; i++) { - list.add(_secondaryButtonList[i].name ?? ''); + list.add(_secondaryButtonList[i].name); } return GestureDetector( @@ -197,12 +195,8 @@ class _BrnButtonPanelState extends State { maxLines: 1, style: TextStyle( color: _secondaryButtonList[index + 2].isEnable - ? BrnThemeConfigurator.instance - .getConfig() - .commonConfig.colorTextBase - : BrnThemeConfigurator.instance - .getConfig() - .commonConfig.colorTextHint, + ? BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextBase + : BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextHint, fontSize: 16)); }, popDirection: widget.popDirection, @@ -229,13 +223,13 @@ class _BrnButtonPanelState extends State { /// 次按钮的配置类 class BrnButtonPanelConfig { /// 次按钮的名称 - final String? name; + final String name; /// 次按钮的enable状态,默认为true final bool isEnable; BrnButtonPanelConfig({ - this.name, + required this.name, this.isEnable = true, }); } diff --git a/lib/src/components/button/collection/brn_multiple_bottom_button.dart b/lib/src/components/button/collection/brn_multiple_bottom_button.dart index 629498b4..367553c2 100644 --- a/lib/src/components/button/collection/brn_multiple_bottom_button.dart +++ b/lib/src/components/button/collection/brn_multiple_bottom_button.dart @@ -30,10 +30,10 @@ class BrnMultipleBottomButton extends StatefulWidget { /// selectedButtonOnTap, 点击已选的回调,存在三种状态:-1:不可展开(当 value 为 0 的时候),0:收起,1:展开 final void Function(BrnMultipleButtonArrowState)? onSelectedButtonTap; - /// 主按钮的文案,默认为主题色 可以传入自定义 Widget,不传则不展示 + /// 主按钮的文案,默认为主题色 可以传入自定义 Widget 以及 String 类型的文案,不传则不展示 final dynamic mainButton; - /// 次按钮的文案可以传入自定义 Widget,不传则不展示 + /// 次按钮的文案可以传入自定义 Widget 以及 String 类型的文案,不传则不展示 final dynamic subButton; /// 主按钮点击回调 diff --git a/lib/src/components/button/collection/brn_text_button_panel.dart b/lib/src/components/button/collection/brn_text_button_panel.dart index 3084a074..93e2f582 100644 --- a/lib/src/components/button/collection/brn_text_button_panel.dart +++ b/lib/src/components/button/collection/brn_text_button_panel.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/src/components/popup/brn_popup_window.dart'; import 'package:bruno/src/constants/brn_asset_constants.dart'; import 'package:bruno/src/theme/brn_theme_configurator.dart'; @@ -26,19 +24,19 @@ class BrnTextButtonPanel extends StatefulWidget { /// 默认值为PopDirection.bottom final BrnPopupDirection popDirection; - const BrnTextButtonPanel( - {Key? key, - required this.nameList, - this.onTap, - this.popDirection = BrnPopupDirection.bottom}) - : super(key: key); + const BrnTextButtonPanel({ + Key? key, + required this.nameList, + this.onTap, + this.popDirection = BrnPopupDirection.bottom, + }) : super(key: key); @override _BrnTextButtonPanelState createState() => _BrnTextButtonPanelState(); } class _BrnTextButtonPanelState extends State { - late GlobalKey _popWindowKey; + GlobalKey _popWindowKey = GlobalKey(); /// 更多按钮的展开收起状态 bool _isExpanded = false; @@ -46,18 +44,6 @@ class _BrnTextButtonPanelState extends State { /// 展示的文本按钮的最大数目,超过这个数目时展示更多 int _maxNum = 4; - @override - void initState() { - super.initState(); - _popWindowKey = GlobalKey(); - } - - @override - void didUpdateWidget(covariant BrnTextButtonPanel oldWidget) { - super.didUpdateWidget(oldWidget); - _popWindowKey = GlobalKey(); - } - @override Widget build(BuildContext context) { if (widget.nameList.length > 0) { @@ -75,9 +61,7 @@ class _BrnTextButtonPanelState extends State { List widgetList = []; //文本按钮不超过4个,就全不显示 //超过4个的话,就只显示3个,剩下的显示在更多里 - int length = widget.nameList.length <= _maxNum - ? widget.nameList.length - : _maxNum - 1; + int length = widget.nameList.length <= _maxNum ? widget.nameList.length : _maxNum - 1; for (int textIndex = 0; textIndex < length; textIndex++) { Widget operationWidget = _operationWidgetAtIndex(textIndex); widgetList.add(operationWidget); @@ -115,9 +99,7 @@ class _BrnTextButtonPanelState extends State { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, - color: BrnThemeConfigurator.instance - .getConfig() - .commonConfig.brandPrimary), + color: BrnThemeConfigurator.instance.getConfig().commonConfig.brandPrimary), ); return GestureDetector( @@ -187,7 +169,7 @@ class _BrnTextButtonPanelState extends State { }); }); } else { - return Container(); + return SizedBox.shrink(); } } } diff --git a/lib/src/components/selection/bean/brn_selection_common_entity.dart b/lib/src/components/selection/bean/brn_selection_common_entity.dart index 14f96b7a..79472cd7 100644 --- a/lib/src/components/selection/bean/brn_selection_common_entity.dart +++ b/lib/src/components/selection/bean/brn_selection_common_entity.dart @@ -163,8 +163,10 @@ class BrnSelectionEntity { entity.maxSelectedCount = BrnSelectionConstant.maxSelectCount; } entity.extMap = map['ext'] ?? {}; - entity.children = []..addAll((map['children'] as List) + if(map['children'] != null && map['children'] is List) { + entity.children = []..addAll((map['children'] as List) .map((o) => BrnSelectionEntity.fromMap(o))); + } entity.filterType = entity.parserFilterTypeWithType(map['type'] ?? ""); return entity; } diff --git a/lib/src/components/selection/widget/brn_layer_more_selection_page.dart b/lib/src/components/selection/widget/brn_layer_more_selection_page.dart index 1f1d1a2d..68ff1b2a 100644 --- a/lib/src/components/selection/widget/brn_layer_more_selection_page.dart +++ b/lib/src/components/selection/widget/brn_layer_more_selection_page.dart @@ -431,7 +431,7 @@ class _BrnLayerMoreSelectionPageState extends State height: 16, width: 16, child: entity.isSelected - ? BrunoTools.getAssetImage(BrnAsset.selectCheckedStatus) + ? BrunoTools.getAssetImageWithBandColor(BrnAsset.selectCheckedStatus) : BrunoTools.getAssetImage(BrnAsset.iconUnSelect), ) ], diff --git a/lib/src/components/selection/widget/brn_selection_menu_widget.dart b/lib/src/components/selection/widget/brn_selection_menu_widget.dart index b550a3cf..01686e9b 100644 --- a/lib/src/components/selection/widget/brn_selection_menu_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_menu_widget.dart @@ -60,7 +60,7 @@ class _BrnSelectionMenuWidgetState extends State { List menuItemActiveState = []; List menuItemHighlightState = []; BrnSelectionListViewController listViewController = BrnSelectionListViewController(); - late ScrollController _scrollController; + ScrollController? _scrollController; late StreamSubscription _refreshTitleSubscription; @@ -82,7 +82,7 @@ class _BrnSelectionMenuWidgetState extends State { if (widget.extraScrollController != null) { _scrollController = widget.extraScrollController!; - _scrollController.addListener(_closeSelectionPopupWindow); + _scrollController!.addListener(_closeSelectionPopupWindow); } for (BrnSelectionEntity parentEntity in widget.data) { @@ -111,7 +111,7 @@ class _BrnSelectionMenuWidgetState extends State { } dispose() { - _scrollController.removeListener(_closeSelectionPopupWindow); + _scrollController?.removeListener(_closeSelectionPopupWindow); _refreshTitleSubscription.cancel(); _closeSelectionPopupWindowSubscription.cancel(); listViewController.hide(); diff --git a/lib/src/components/step/brn_horizontal_steps.dart b/lib/src/components/step/brn_horizontal_steps.dart index 4e54ba82..07c4749c 100644 --- a/lib/src/components/step/brn_horizontal_steps.dart +++ b/lib/src/components/step/brn_horizontal_steps.dart @@ -1,8 +1,10 @@ +import 'package:bruno/src/components/line/brn_line.dart'; import 'package:bruno/src/constants/brn_asset_constants.dart'; import 'package:bruno/src/theme/brn_theme_configurator.dart'; import 'package:bruno/src/utils/brn_tools.dart'; import 'package:flutter/material.dart'; +const double _kItemSidePadding = 5; /// 描述: 横向步骤条,是一种常见的导航形式,它具有导航通用的属性:告知用户”我在哪/我能去哪“, /// 步骤数目就相当于告知用户--能去哪或者说流程将要经历什么。 /// 通用组件步骤条分为三个状态:完成态/进行态/等待态,三种状态在样式上均加以区分 @@ -44,10 +46,8 @@ class BrnHorizontalStepsState extends State { return widget.controller?.currentIndex ?? 0; } - Color stepContentTextColor(int index) { - return index > _currentIndex - ? const Color(0xFFCCCCCC) - : const Color(0xFF222222); + Color _getStepContentTextColor(int index) { + return index > _currentIndex ? const Color(0xFFCCCCCC) : const Color(0xFF222222); } void _handleStepStateListenerTick() { @@ -74,8 +74,8 @@ class BrnHorizontalStepsState extends State { @override void didUpdateWidget(covariant BrnHorizontalSteps oldWidget) { super.didUpdateWidget(oldWidget); - final bool isControllerDiff = oldWidget.controller != null && - widget.controller != oldWidget.controller; + final bool isControllerDiff = + oldWidget.controller != null && widget.controller != oldWidget.controller; final bool isCountDiff = widget.steps.length != oldWidget.steps.length; if (isControllerDiff || isCountDiff) { oldWidget.controller?.removeListener(_handleStepStateListenerTick); @@ -85,10 +85,6 @@ class BrnHorizontalStepsState extends State { @override Widget build(BuildContext context) { - return _buildHorizontalSteps(); - } - - Widget _buildHorizontalSteps() { /// 单独一个widget组件,用于返回需要生成的内容widget Widget content; final List childrenList = []; @@ -97,14 +93,11 @@ class BrnHorizontalStepsState extends State { final int lastIndex = length - 1; for (int i = 0; i < length; i += 1) { childrenList.add(_applyStepItem(steps[i], i)); - if (i < lastIndex) { - childrenList.add(_applyLineItem(i)); - } } content = Container( height: 78, - padding: const EdgeInsets.fromLTRB(28, 0, 28, 0), child: Row( + mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: childrenList, ), @@ -112,6 +105,31 @@ class BrnHorizontalStepsState extends State { return content; } + Widget _applyStepItem(BrunoStep step, int index) { + return Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _applyStepAndLine(step, index), + _applyStepContent(step, index), + ], + ), + ); + } + + Widget _applyStepAndLine(BrunoStep step, int index) { + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + index == 0 ? Expanded(child: SizedBox.shrink()) : _applyLineItem(index, true), + _applyStepIcon(step, index), + index == widget.steps.length - 1 + ? Expanded(child: SizedBox.shrink()) + : _applyLineItem(index, false), + ], + ); + } + Widget _applyStepIcon(BrunoStep step, int index) { Widget icon; if (widget.controller?.isCompleted == true) { @@ -145,26 +163,29 @@ class BrnHorizontalStepsState extends State { return icon; } - Widget _applyStepItem(BrunoStep step, int index) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _applyStepIcon(step, index), - _applyStepContent(step, index), - ], - ); - } - - Widget _applyLineItem(int index) { + Widget _applyLineItem(int index, bool isLeft) { return Expanded( child: Container( - margin: const EdgeInsets.fromLTRB(0, 0, 0, 28), - color: index >= _currentIndex ? const Color(0xFFE7E7E7) : _primary, - height: 1, + alignment: Alignment.center, + child: BrnLine( + height: 1, + leftInset: isLeft ? 0 : _kItemSidePadding, + rightInset: isLeft ? _kItemSidePadding : 0, + color: _getLineColor(index, isLeft), + ), ), ); } + Color _getLineColor(int index, bool isLeft) { + if (index < _currentIndex) { + return _primary; + } else if (_currentIndex == index && isLeft) { + return _primary; + } + return const Color(0xFFE7E7E7); + } + Widget _getIndexIcon(int index) { Widget icon; switch (index) { @@ -193,12 +214,14 @@ class BrnHorizontalStepsState extends State { return stepContent; } return Container( - margin: const EdgeInsets.only(top: 6), + margin: const EdgeInsets.only(top: 6, left: _kItemSidePadding, right: _kItemSidePadding), child: Text( step.stepContentText ?? '', + maxLines: 1, + overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 14, - color: stepContentTextColor(index), + color: _getStepContentTextColor(index), ), ), ); @@ -217,8 +240,7 @@ class BrnHorizontalStepsState extends State { } /// 使用组件默认的icon - return BrunoTools.getAssetSizeImage(BrnAsset.iconStepCompleted, 20, 20, - color: _primary); + return BrunoTools.getAssetSizeImage(BrnAsset.iconStepCompleted, 20, 20, color: _primary); } Widget _getDoingIcon(BrunoStep step) { @@ -233,8 +255,7 @@ class BrnHorizontalStepsState extends State { return doingIcon; } // 使用组件默认的icon - return BrunoTools.getAssetSizeImage(BrnAsset.iconStepDoing, 20, 20, - color: _primary); + return BrunoTools.getAssetSizeImage(BrnAsset.iconStepDoing, 20, 20, color: _primary); } } diff --git a/lib/src/components/tabbar/normal/brn_tab_bar.dart b/lib/src/components/tabbar/normal/brn_tab_bar.dart index 6f8f9dba..dde8b4a3 100644 --- a/lib/src/components/tabbar/normal/brn_tab_bar.dart +++ b/lib/src/components/tabbar/normal/brn_tab_bar.dart @@ -157,7 +157,7 @@ class BrnTabBar extends StatefulWidget { BrnTabBarState createState() => BrnTabBarState(closeController); } -/// BrnTabBarBadge的ta分配模式 +/// BrnTabBarBadge的tab分配模式 enum BrnTabBarBadgeMode { /// 原始的默认TabBar的分配模式 origin, diff --git a/lib/src/constants/brn_constants.dart b/lib/src/constants/brn_constants.dart index 72dbc7e5..f08bee66 100644 --- a/lib/src/constants/brn_constants.dart +++ b/lib/src/constants/brn_constants.dart @@ -78,3 +78,11 @@ class BrnShareItemConstants { class BrnSelectionConstant { static const int maxSelectCount = 65535; } + +class BrnButtonConstant { + /// 默认水平间距 + static const double horizontalPadding = 6; + + /// 默认垂直间距 + static const double verticalPadding = 8; +} \ No newline at end of file