Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujuanjuan committed Feb 2, 2023
2 parents 505837c + 5c43950 commit d9f7d28
Show file tree
Hide file tree
Showing 44 changed files with 229 additions and 257 deletions.
11 changes: 10 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
include: package:lints/core.yaml
# include: package:lints/recommended.yaml
#include: package:lints/recommended.yaml

analyzer:
exclude:
- doc/**
errors:
deprecated_member_use_from_same_package: ignore
deprecated_member_use: ignore
unused_element: ignore
must_be_immutable: ignore

linter:
rules:
non_constant_identifier_names: false
4 changes: 1 addition & 3 deletions example/lib/sample/components/tag/select_tag_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -150,7 +148,7 @@ class SelectTagExamplePageState extends State<SelectTagExamplePage> {
);
}

double _getTagWidth(context, {int rowCount: 4}) {
double _getTagWidth(context, {int rowCount = 4}) {
double leftRightPadding = 40;
double rowSpace = 12;
return (MediaQuery.of(context).size.width -
Expand Down
2 changes: 0 additions & 2 deletions example/lib/sample/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import 'package:example/sample/home/card_data_config.dart';
import 'package:example/sample/home/group_card.dart';
import 'package:flutter/material.dart';

import '../l10n/l10n.dart';
import 'setting.dart';
/// 主页面
class HomePage extends StatelessWidget {
GlobalKey _moreKey = GlobalKey();

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 4 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
bruno:
path: ../

flutter_easyrefresh: ^2.2.1
lpinyin: ^2.0.3
badges: ^2.0.2
Expand All @@ -34,6 +33,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
dependency_overrides:
bruno:
path: ../


# For information on the generic Dart part of this file, see the
Expand Down
1 change: 0 additions & 1 deletion lib/src/components/appraise/brn_appraise_config.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bruno/src/l10n/brn_intl.dart';
import 'package:flutter/material.dart';
import 'package:bruno/src/components/input/brn_input_text.dart';
import 'package:bruno/src/components/appraise/brn_appraise_interface.dart';
Expand Down
12 changes: 8 additions & 4 deletions lib/src/components/charts/broken_line/brn_line_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class BrnDialItem {
/// x,y 轴刻度值。用于刻度在坐标的真实定位
double value;

BrnDialItem({this.dialText, this.dialTextStyle, this.selectedDialTextStyle,required this.value});
BrnDialItem(
{this.dialText,
this.dialTextStyle,
this.selectedDialTextStyle,
required this.value});
}

class BrnPointData {
Expand Down Expand Up @@ -44,7 +48,7 @@ class BrnPointData {
this.offset = const Offset(0, 0),
this.pointText,
this.pointTextStyle,
this.isClickable: true,
this.isClickable = true,
required this.lineTouchData}) {
pointText ??= '$y';
pointTextStyle ??= TextStyle(
Expand Down Expand Up @@ -72,7 +76,7 @@ class BrnLineTouchData {

BrnLineTouchData({
required this.tipWindowSize,
this.tipOffset: const Offset(0, 0),
this.tipOffset = const Offset(0, 0),
this.onTouch,
});
}
Expand Down Expand Up @@ -125,7 +129,7 @@ class BrnPointsLine {
this.pointInnerColor,
this.isCurve = false,
required this.points,
this.isShowPoint: true,
this.isShowPoint = true,
this.isShowPointText = false,
this.shaderColors,
this.lineColor = Colors.purple}) {
Expand Down
11 changes: 6 additions & 5 deletions lib/src/components/dialog/brn_middle_input_diaolg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BrnMiddleInputDialog {

/// 点击取消/确认按钮之后,是否自动关闭弹窗,默认为 true,关闭
BrnDialogConfig? themeData;

/// 键盘类型
final TextInputType? keyboardType;

Expand All @@ -70,7 +70,7 @@ class BrnMiddleInputDialog {
this.keyboardType,
this.maxLength = 20,
this.maxLines,
this.minLines: 1,
this.minLines = 1,
this.inputFocusNode,
this.inputEditingController,
this.inputFormatters,
Expand Down Expand Up @@ -196,12 +196,13 @@ class BrnMiddleInputDialog {
});
}


Alignment _getMessageAlign(TextAlign messageTextAlign) {
if(messageTextAlign == TextAlign.left || messageTextAlign == TextAlign.start) {
if (messageTextAlign == TextAlign.left ||
messageTextAlign == TextAlign.start) {
return Alignment.centerLeft;
}
if(messageTextAlign == TextAlign.right || messageTextAlign == TextAlign.end) {
if (messageTextAlign == TextAlign.right ||
messageTextAlign == TextAlign.end) {
return Alignment.centerRight;
}
return Alignment.center;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/dialog/brn_multi_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MultiSelectItem {
/// 是否选中
bool isChecked;

MultiSelectItem(this.code, this.content, {this.isChecked: false});
MultiSelectItem(this.code, this.content, {this.isChecked = false});
}

/// 屏幕中间弹出多选列表弹框
Expand Down
34 changes: 17 additions & 17 deletions lib/src/components/dialog/brn_single_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class BrnSingleSelectDialog extends Dialog {
final VoidCallback? onCloseClick;

const BrnSingleSelectDialog(
{this.isClose: true,
this.title: "",
{this.isClose = true,
this.title = "",
this.messageText,
this.messageWidget,
required this.conditions,
Expand All @@ -76,20 +76,21 @@ class BrnSingleSelectDialog extends Dialog {
@override
Widget build(BuildContext context) {
return BrnSingleSelectDialogWidget(
isClose: isClose,
title: title,
messageText: messageText,
messageWidget: messageWidget,
conditions: conditions,
submitText: submitText ?? BrnIntl.of(context).localizedResource.submit,
onSubmitClick: onSubmitClick,
onItemClick: onItemClick,
submitBgColor: submitBgColor,
checkedItem: checkedItem,
customWidget: customWidget,
canDismissOnConfirmClick: canDismissOnConfirmClick,
isCustomFollowScroll: isCustomFollowScroll,
onCloseClick: onCloseClick,);
isClose: isClose,
title: title,
messageText: messageText,
messageWidget: messageWidget,
conditions: conditions,
submitText: submitText ?? BrnIntl.of(context).localizedResource.submit,
onSubmitClick: onSubmitClick,
onItemClick: onItemClick,
submitBgColor: submitBgColor,
checkedItem: checkedItem,
customWidget: customWidget,
canDismissOnConfirmClick: canDismissOnConfirmClick,
isCustomFollowScroll: isCustomFollowScroll,
onCloseClick: onCloseClick,
);
}
}

Expand Down Expand Up @@ -298,7 +299,6 @@ class BrnSingleSelectDialogWidgetState
return const SizedBox.shrink();
}


Widget _buildItem(BuildContext context, int index) {
if (widget.conditions == null) {
return const SizedBox.shrink();
Expand Down
22 changes: 12 additions & 10 deletions lib/src/components/empty/brn_empty_status.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:bruno/src/constants/brn_asset_constants.dart';
import 'package:bruno/src/constants/brn_strings_constants.dart';
import 'package:bruno/src/l10n/brn_intl.dart';
import 'package:bruno/src/theme/brn_theme_configurator.dart';
import 'package:bruno/src/theme/configs/brn_abnormal_state_config.dart';
Expand Down Expand Up @@ -32,21 +31,24 @@ class BrnAbnormalStateUtils {
return BrnAbnormalStateWidget(
img: img ?? BrunoTools.getAssetImage(BrnAsset.noData),
title: BrnIntl.of(context).localizedResource.fetchErrorAndRetry,
operateTexts: <String>[BrnIntl.of(context).localizedResource.clickPageAndRetry],
operateTexts: <String>[
BrnIntl.of(context).localizedResource.clickPageAndRetry
],
action: action,
);
} else if (AbnormalState.networkConnectError == status) {
return BrnAbnormalStateWidget(
img: img ?? BrunoTools.getAssetImage(BrnAsset.networkError),
title: BrnIntl.of(context).localizedResource.netErrorAndRetryLater,
operateTexts: <String>[BrnIntl.of(context).localizedResource.clickPageAndRetry],
operateTexts: <String>[
BrnIntl.of(context).localizedResource.clickPageAndRetry
],
action: action,
);
} else if (AbnormalState.noData == status) {
return BrnAbnormalStateWidget(
img: img ?? BrunoTools.getAssetImage(BrnAsset.noData),
title: BrnIntl.of(context).localizedResource.noDataTip
);
img: img ?? BrunoTools.getAssetImage(BrnAsset.noData),
title: BrnIntl.of(context).localizedResource.noDataTip);
} else {
return const SizedBox.shrink();
}
Expand Down Expand Up @@ -116,14 +118,14 @@ class BrnAbnormalStateWidget extends StatelessWidget {
this.img,
this.title,
this.content,
this.operateAreaType: OperateAreaType.textButton,
this.operateAreaType = OperateAreaType.textButton,
this.operateTexts,
this.action,
this.enablePageTap: false,
this.enablePageTap = false,
this.topOffset,
this.bgColor: Colors.white,
this.bgColor = Colors.white,
this.isCenterVertical = false,
this.topPercent: 0.08,
this.topPercent = 0.08,
this.themeData,
}) {
this.themeData ??= BrnAbnormalStateConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import 'package:bruno/src/components/form/base/brn_form_item_type.dart';
import 'package:bruno/src/components/form/utils/brn_form_util.dart';
import 'package:bruno/src/l10n/brn_intl.dart';
Expand Down Expand Up @@ -92,13 +90,13 @@ class BrnTextQuickSelectFormItem extends StatefulWidget {
BrnTextQuickSelectFormItem(
{Key? key,
this.label,
this.title: "",
this.title = "",
this.subTitle,
this.tipLabel,
this.prefixIconType: BrnPrefixIconType.normal,
this.error: "",
this.isEdit: true,
this.isRequire: false,
this.prefixIconType = BrnPrefixIconType.normal,
this.error = "",
this.isEdit = true,
this.isRequire = false,
this.onAddTap,
this.onRemoveTap,
this.onTip,
Expand All @@ -108,7 +106,7 @@ class BrnTextQuickSelectFormItem extends StatefulWidget {
this.selectBtnList,
this.enableBtnList,
this.btns,
this.isBtnsScroll: false,
this.isBtnsScroll = false,
this.onTap,
this.onBtnSelectChanged,
this.backgroundColor,
Expand All @@ -119,8 +117,9 @@ class BrnTextQuickSelectFormItem extends StatefulWidget {
.getConfig(configId: themeData!.configId)
.formItemConfig
.merge(themeData);
this.themeData = this.themeData!.merge(
BrnFormItemConfig(backgroundColor: backgroundColor));
this.themeData = this
.themeData!
.merge(BrnFormItemConfig(backgroundColor: backgroundColor));
}

@override
Expand Down
32 changes: 16 additions & 16 deletions lib/src/components/form/items/general/brn_radio_input_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import 'dart:math';

import 'package:bruno/src/components/form/base/brn_form_item_type.dart';
Expand Down Expand Up @@ -89,13 +87,13 @@ class BrnRadioInputFormItem extends StatefulWidget {
BrnRadioInputFormItem({
Key? key,
this.label,
this.title: "",
this.title = "",
this.subTitle,
this.tipLabel,
this.prefixIconType: BrnPrefixIconType.normal,
this.error: "",
this.isEdit: true,
this.isRequire: false,
this.prefixIconType = BrnPrefixIconType.normal,
this.error = "",
this.isEdit = true,
this.isRequire = false,
this.onAddTap,
this.onRemoveTap,
this.onTip,
Expand All @@ -112,21 +110,22 @@ class BrnRadioInputFormItem extends StatefulWidget {
.getConfig(configId: this.themeData!.configId)
.formItemConfig
.merge(this.themeData);
this.themeData = this.themeData!.merge(
BrnFormItemConfig(backgroundColor: backgroundColor));
this.themeData = this
.themeData!
.merge(BrnFormItemConfig(backgroundColor: backgroundColor));
this._isAutoLayout = false;
}

BrnRadioInputFormItem.autoLayout({
Key? key,
this.label,
this.title: "",
this.title = "",
this.subTitle,
this.tipLabel,
this.prefixIconType: BrnPrefixIconType.normal,
this.error: "",
this.isEdit: true,
this.isRequire: false,
this.prefixIconType = BrnPrefixIconType.normal,
this.error = "",
this.isEdit = true,
this.isRequire = false,
this.onAddTap,
this.onRemoveTap,
this.onTip,
Expand All @@ -145,8 +144,9 @@ class BrnRadioInputFormItem extends StatefulWidget {
.getConfig(configId: this.themeData!.configId)
.formItemConfig
.merge(this.themeData);
this.themeData = this.themeData!.merge(
BrnFormItemConfig(backgroundColor: backgroundColor));
this.themeData = this
.themeData!
.merge(BrnFormItemConfig(backgroundColor: backgroundColor));
}

@override
Expand Down
Loading

0 comments on commit d9f7d28

Please sign in to comment.