From 7144d06c2df25ebeea64be6ef747f690e3d5a0d1 Mon Sep 17 00:00:00 2001 From: Zach Li Date: Mon, 23 Mar 2026 12:18:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?updata:=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +- CHANGELOG.md | 232 ------------------ README.en-US.md | 188 -------------- README.md | 13 +- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- .../Flutter/ephemeral/flutter_lldb_helper.py | 32 +++ .../ios/Flutter/ephemeral/flutter_lldbinit | 5 + example/ios/Podfile | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 44 ++-- .../contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 5 +- example/ios/Runner/AppDelegate.swift | 2 +- example/ios/Runner/Info.plist | 4 + ...ionsheet_selected_list_custom_example.dart | 13 +- .../actionsheet_selected_list_example.dart | 11 +- .../charts/line/brn_broken_line_example.dart | 30 +-- .../components/guide/force_guide_example.dart | 15 +- .../components/guide/soft_intro_example.dart | 15 +- .../navbar/nav_bar_example_page.dart | 38 +-- ...selectionview_customview_example_page.dart | 11 +- .../components/tabbar/brn_tab_example.dart | 108 ++++---- .../tabbar/brn_tabbar_sticky_example.dart | 18 +- example/lib/sample/home/list_item.dart | 9 +- example/web/main.dart | 4 +- .../actionsheet/brn_common_action_sheet.dart | 2 +- .../appraise/brn_flutter_gif_image.dart | 4 +- .../button/brn_big_ghost_button.dart | 4 +- .../button/brn_big_main_button.dart | 2 +- .../button/brn_big_outline_button.dart | 2 +- .../components/button/brn_normal_button.dart | 2 +- .../button/brn_small_main_button.dart | 3 +- .../button/brn_small_outline_button.dart | 4 +- .../collection/brn_bottom_button_panel.dart | 4 +- .../calendar/brn_calendar_view.dart | 2 +- .../content_card/brn_pair_info_rich_grid.dart | 7 +- .../content_card/brn_pair_info_table.dart | 33 ++- .../card_title/brn_common_card_title.dart | 2 +- .../brn_doughnut_chart.dart | 2 +- .../brn_progress_bar_chart_painter.dart | 4 +- .../charts/broken_line/brn_broken_line.dart | 2 +- .../components/dialog/brn_safe_dialog.dart | 28 +-- .../general/brn_quick_select_input_item.dart | 6 +- .../general/brn_title_select_input_item.dart | 2 +- .../components/guide/brn_flutter_guide.dart | 2 +- lib/src/components/loading/brn_loading.dart | 2 +- lib/src/components/navbar/brn_appbar.dart | 2 +- lib/src/components/navbar/brn_search_bar.dart | 6 +- .../components/picker/base/brn_picker.dart | 11 +- .../components/picker/brn_bottom_picker.dart | 14 +- .../brn_select_tags_with_input_picker.dart | 2 +- .../components/popup/brn_overlay_window.dart | 2 +- .../components/popup/brn_popup_window.dart | 95 ++++--- .../widget/brn_selection_list_widget.dart | 4 +- .../widget/brn_selection_range_widget.dart | 38 ++- lib/src/components/step/brn_step_line.dart | 2 +- .../indicator/brn_triangle_decoration.dart | 4 +- .../components/tabbar/normal/brn_tab_bar.dart | 63 +---- lib/src/components/tag/brn_state_tag.dart | 2 +- .../tag/tagview/brn_select_tag.dart | 2 +- .../components/text/brn_expandable_text.dart | 13 +- lib/src/l10n/brn_resources.dart | 76 +++--- .../theme/base/brn_default_config_utils.dart | 2 +- .../configs/brn_gallery_detail_config.dart | 2 +- .../theme/configs/brn_selection_config.dart | 4 +- lib/src/utils/css/brn_core_funtion.dart | 3 +- pubspec.yaml | 2 +- 66 files changed, 421 insertions(+), 855 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 README.en-US.md create mode 100644 example/ios/Flutter/ephemeral/flutter_lldb_helper.py create mode 100644 example/ios/Flutter/ephemeral/flutter_lldbinit diff --git a/.gitignore b/.gitignore index 19f097df..15adfbad 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ example/ios/Podfile.lock example/pubspec.lock - # IntelliJ related *.iml *.ipr @@ -77,4 +76,6 @@ build/ pubspec.lock # FVM -.fvm + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 0c6be826..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,232 +0,0 @@ -## [3.4.3] - 2023-9-13 - -### Changed - -#### base - -- Fixed the problem that some component documents cannot be viewed [#495](https://github.com/LianjiaTech/bruno/issues/495). - -#### components - -- BrnPopupWindow : fixed issue [#486](https://github.com/LianjiaTech/bruno/issues/486) which is called after initState and whenever the dependencies change thereafter. -- BrnTabBar: fixed the issue [#487](https://github.com/LianjiaTech/bruno/issues/487) of invalid setting of badge. -- BrnStepInputFormItem: fixed the situation where manually input numbers are preceded by 0 [#458](https://github.com/LianjiaTech/bruno/issues/458). - - - -## [3.4.2] - 2023-8-23 - -### Changed - -#### base - -- add dart doc. - - - -## [3.4.1] - 2023-8-4 - -### Changed - -#### base - -- Fix dart analysis check warning. - -#### components - -- **Breaking change**: remove deprecated attribute fontSize in  BrnIconButton, use style instead . - -- **Breaking change**: in order to optimize the use of MediaQueryData.fromWindow and replace it with the official suggested api, add attribute context to the keyOrValueLastQuestionInfo method and valueLastClickInfo method in BrnInfoModal. - -- **Breaking change**: remove deprecated attribute isShowXDialin BrnPointsLine, use isShowXDial in BrnLinePainter instead. - - - -## [3.4.0] - 2023-7-24 - -### Changed - -#### base - -- Adapt flutter sdk 3.10.0. - -#### components - -- **Breaking change**: Since flutter sdk 3.10.0 deletes the brightness and textTheme attributes of Appbar, BrnAppBar BrnSearchAppbar is deleted synchronously. Instead, use themeData. BrnAppBarConfig will support all your needs. For details, see Demo usage. -- BrnSimpleSelection : support theme configuration [#420 ](https://github.com/LianjiaTech/bruno/pull/420) , thanks to **JunCaiLi** . -- Add missing themeData for BrnNormalFormGroup and BrnPortraitRadioGroup [#455](https://github.com/LianjiaTech/bruno/pull/445), thanks to **Kingtous**. -- BrnTabBar : add onTap method for _TabBarOverlayWidget [#393](https://github.com/LianjiaTech/bruno/pull/393). -- BrnExpandFormGroup and BrnNormalFormGroup remove invalid attribute tipLabel. -- BrnIconButton : fix the abnormal position of icons and text. - - - - -## [3.3.0] - 2023-2-1 - -### Changed - -- fix the NullPointerException caused by not configuring BrnIntl [#398](https://github.com/LianjiaTech/bruno/issues/398). -- optimize internal import references. -- adapt flutter sdk 3.7.0 to fix badge reference conflict [#406](https://github.com/LianjiaTech/bruno/issues/406). - - - -## [3.2.0] - 2022-12-29 - -### Changed - -#### base - -- support for localization capabilities. -- add pad theme configuration. -- expend title click area in pickers [#369](https://github.com/LianjiaTech/bruno/issues/369). - -#### components - -- BrnMultiSelectListPicker : add generics for more flexible data transfer [#336](https://github.com/LianjiaTech/bruno/issues/336) . -- BrnLinePainter : add the limit of yDialMax > yDialMin to fix the NaN error when calculating the path [359](https://github.com/LianjiaTech/bruno/issues/359). -- BrnTabBar : fix the overflow error when setting BrnTabBarBadgeMode.origin mode [#340](https://github.com/LianjiaTech/bruno/issues/340). -- BrnAppraise: fix gif file error [#372](https://github.com/LianjiaTech/bruno/issues/372). -- BrnTextInputFormItem: fix attribute textInputAction does not take effect and add attribute obscureText, thank to **echo-LuGuang**. -- BrnAppBar: expand BrnTextAction click area. -- BrnEnhanceNumberCard: fix the number card is not centered [#380](https://github.com/LianjiaTech/bruno/issues/380). - - - -## [3.1.0] - 2022-9-30 - -### Changed - -#### base - -- Adapt flutter sdk 3.3.0 and update dart sdk version to >=2.17.0. -- add BrnSafeDialog[dismiss] instead of Navigator.pop to close the Dialog [#317](https://github.com/LianjiaTech/bruno/issues/317). -- optimize the upper font of form items [#330](https://github.com/LianjiaTech/bruno/issues/330). - -#### components - -- BrnPageLoading : calculated the range of loading based on screen width [#295](https://github.com/LianjiaTech/bruno/issues/295) . -- BrnBottomTabBar : fix attributes selectedTextStyle and unSelectedTextStyle do not take effectc [#285](https://github.com/LianjiaTech/bruno/issues/285) , thanks to **JunCaiLi** . -- BrnSearchText : fix an abnormal display when BrnSearchText sets the innerColor property [#275](https://github.com/LianjiaTech/bruno/issues/275), thanks to **xyhuangjia**. -- BrnBrokenLine: xDial support selected style [#282](https://github.com/LianjiaTech/bruno/issues/282). -- BrnMultiSelectTagsPicker: fix when setting properties layoutStyle value of BrnMultiSelectTagsLayoutStyle. Auto display abnormal [#316](https://github.com/LianjiaTech/bruno/issues/316), thanks to **JunCaiLi**. -- BrnCommonCardTitle: fix the theme customization does not take effect, thanks to **JunCaiLi**. -- BrnMiddleInputDialog: add attribute keyboardType, thanks to **moqi2011**. -- BrnCheckbox: fix unsynchronized internal and external check states [#333](https://github.com/LianjiaTech/bruno/issues/333), thanks to **moqi2011**. -- BrnTextInputFormItem: add attribute focusNode, thanks to **Ives7**. -- BrnProgressChart: fix invalid setting color, background color, and animation [#322](https://github.com/LianjiaTech/bruno/pull/322). -- BrnToast: fix default value error in attribute gravity [#341](https://github.com/LianjiaTech/bruno/issues/341). -- BrnTextInputFormItem: add attribute textInputAction , thanks to **Ives7**. -- BrnIconButton: fix setting attribute fontsize does not take effect [#345](https://github.com/LianjiaTech/bruno/issues/345) and tag deprecated it use style is recommended. -- .BrnSingleSelectCityPage: add attribute emptyImage [#329](https://github.com/LianjiaTech/bruno/issues/329) and optimize default images of BrnAbnormalStateWidget. - - - -## [3.0.0] - 2022-7-8 - -### Changed - -#### base - -- Adapt flutter sdk 3.0.3. -- Add the attribute backgroundColor to the form item and fix issue [#260](https://github.com/LianjiaTech/bruno/issues/260) , thanks to **Kingtous** find it. -- pubspec.yaml : upgrade photo_view version to v0.14.0 and remove provider. - -#### components - -- BrnBottomPicker : fix the title setting in the show method does not take effect [#212](https://github.com/LianjiaTech/bruno/issues/212) , thanks to **laiiihz** . -- BrnStepInputFormItem : fix cursor confusion [#235](https://github.com/LianjiaTech/bruno/issues/235) , thanks to **jixiaoyong** . -- BrnSmallOutlineButton : fix attribute lineColor does not take effect,thanks to **Story5** . -- BrnAddLabel : support theme config. -- BrnBigMainButton : fix the theme configuration borderRadius and fontSize does not take effect [#214](https://github.com/LianjiaTech/bruno/issues/214) . -- BrnCalendarView : optimize the time range selection supports selecting the same day [#200](https://github.com/LianjiaTech/bruno/issues/200) . -- BrnProgressBarChart:remove useless attribute hasMark in class ChartAxis. -- BrnSmallOutlineButton : fix attribute fontWeight does not take effect [#233](https://github.com/LianjiaTech/bruno/issues/233) . -- BrnDialog : fix themeData does not take effec [#259](https://github.com/LianjiaTech/bruno/issues/259) . - - - -## [2.2.0] - 2022-4-29 - -### Changed - -#### base -- Adapt flutter sdk 2.10.5. -- Fix flutter analyze issues. -- Fixed some component theme configurations customization not taking effect [#177](https://github.com/LianjiaTech/bruno/issues/177) . - -#### components - -**New components** BrnSwitchFormItem BrnGeneralFormItem BrnSwitchButton. - -- BrnTitleFormItem: fix isRequire parameter invalid [#179](https://github.com/LianjiaTech/bruno/issues/179). -- BrnTextBlockInputFormItem : change the minLines and maxLines attributes to be nullable [#181](https://github.com/LianjiaTech/bruno/pull/181) thanks to **xiao luobei**. -- BrnSelectionView : fix "unlimited" option not taking effect . -- BrnBottomTabBar: remove the restriction on type by item.length in the construction method. -- BrnPairInfoTable adds a callback attribute onFolded for expanding and collapsing state changes. -- BrnCheckbox: add attribute crossAxisAlignment. -- BrnRadioButton: add attribute crossAxisAlignment. -- BrnMiddleInputDialog: add attribute themeData support theme. -- BrnTextButtonPanel: optimize button display, fix the space cannot be filled in some cases. -- BrnCommonCardTitle: add attribute titleMaxLines and titleOverflow. -- BrnMultiSelectDialog: uses the default contentStyle of BrnDialogConfig. -- BrnScrollableTextDialog: optimize ScrollBar placement and styling. -- BrnSingleSelectDialog: Add click callback for closeIcon. -- BrnSelectionView: optimizes the data display of the [More] filter page, and supports the display of up to 2 rows. -- BrnTextInputFormItem BrnTextBlockInputFormItem BrnTitleSelectInputFormItem : add attribute autofocus and default value is false. -- BrnAppBar theme customization BrnAppBarConfig supports the attribute showDefaultBottom to control the bottom dividing line of the AppBar -- BrnMultiDataPicker: add default delegate implementationBrnDefaultMultiDataPickerDelegate. -- BrnStepInputFormItem: add attribute canManualInput and controller to support manual input function. -- BrnSearchText: add attribute inputFormatterstextInputType. -- BrnAnchorTab: support content dynamic change. -- BrnProgressBarChart: when barChartStyle is BarChartStyle.horizontal support item click callback. - - - -## [2.1.1] - 2022-4-1 - -### Changed - -#### base - -- **Breaking change**: Sound null safety support, thanks to @leftcoding #39#33 @donywan #20 @laiiihz #80#64#59#32#14 @kalifun #36 @jojinshallar #81#75#65#62#56#42 @junlandroid #73 @Kenneth #53 @HappyImp #55 @kkkman22 #23 @AlexV525 #30 -- **Breaking change**: Refer to the dart language specification to optimized constant and enum naming. -- Replace DIN Font with Bebas Font . - -#### components - -- **Breaking change**: remove BrnHorizontalStepsManager and put function forwardStep() backStep() into BrnStepsController thanks to leftcoding. -- **Breaking change**: remove BrnDialogStyle and replace with BrnDialogConfig. -- BrnCalendarView: add BrnCalendarView.single() and BrnCalendarView.range() constructor and had its argument startEndDateChange removed. -- BrnSelectionEntityListBean: fromMap is renamed to fromJson. -- BrnRadioButton: optimize click area [#31](https://github.com/LianjiaTech/bruno/pull/31) , thanks to **a1017480401** . -- BrnScrollableTextDialog: remove Navigator.pop(context) in onSubmit() and hand it over to external processing (user). -- BrnBubbleText: add attribute bgColor and textStyle. -- BrnPairInfoTable: add attribute defaultVerticalAlignment. -- BrnSingleSelectDialog : add attribute messageText and messageWidget. - - - - -### Fixed - -- Fix example error [#71](https://github.com/LianjiaTech/bruno/issues/71) thanks to **leftcoding** fixing this issue. -- Fix BrnPickerTitleConfig titleContent setting is invalid [#70](https://github.com/LianjiaTech/bruno/issues/70). -- Optimize BrnPopupWindow onItemClick logic [#57 ](https://github.com/LianjiaTech/bruno/issues/57) . -- Fix BrnDialog is obscured by keyboard [#7](https://github.com/LianjiaTech/bruno/issues/7) . -- Fix BrnTextSelectFormItem set titlePaddingLg doesn't work [#108](https://github.com/LianjiaTech/bruno/issues/108). -- Fix the bottom text of BrnBottomTabBar cannot be displayed in some cases [#141](https://github.com/LianjiaTech/bruno/issues/141). - -Thanks again to **leftcoding**, **jojinshallar**, **laiiihz**, **donywan**, **kalifun**, **junlandroid**, **Kenneth**, **HappyImp**, **kkkman22** , **a1017480401** and **Alex**. - - - -## [2.0.0] - 2021-12-8 - -- Adapt flutter sdk 2.2.2 - -## [1.0.0] - 2021-12-7 - -- First publish adapt flutter sdk 1.22.4 - diff --git a/README.en-US.md b/README.en-US.md deleted file mode 100644 index 7d054f23..00000000 --- a/README.en-US.md +++ /dev/null @@ -1,188 +0,0 @@ - - -

- - - -

- - - -

Bruno

-
- -An enterprise-class package of Flutter components for mobile applications. - -[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/LianjiaTech/bruno/blob/master/LICENSE) - -
- -
- - [简体中文](./README.md) | English - -
- - - -![](https://img.ljcdn.com/beike/zjz/bruno/img/1638883534391.png) - -Bruno invites you to participate in the research! We will plan the roadmap according to your feedback. A community group has also been set up for developers to communicate and welcome to join:point_down:. - - - - -## ✨ Features - -* Enterprise-class UI designed for mobile applications. -* A set of high-quality Flutter components out of the box. -* Provides the ability to customize theme for different businesses -* Design tools to improve the efficiency of all participants - -### Demo download - -Please download from [Releases](https://github.com/LianjiaTech/bruno/releases) or visit the website of the navigation bar [Online Demo](https://bruno.ke.com/page/demo). - -## Adapted version of Flutter - - -| Bruno Version | Flutter SDK Version | -| ---------- | ---------------- | -| 1.0.0 | 1.22.4 | -| 2.0.0 | 2.2.2 | -| 2.1.1 (support nullsafety) | 2.2.2 | -| 2.2.0 | 2.10.5 | -| 3.0.0 | 3.0.3 | -| 3.1.0 | 3.3.0 | -| 3.2.0 | 3.3.0 | -| 3.3.0 | 3.7.0 | -| 3.4.0 | 3.10.0 | -| 3.4.1 | 3.10.0 | - - -## Preparing for use - -Add the following dependencies to the `pubspec.yaml` file: - -```dart -dependencies: - bruno: version -``` - -## Simple usage - -```dart -import 'package:bruno/bruno.dart'; -... -BrnBubbleText( - maxLines: 3, - text: 'I am first bubble text', -) -``` - -### 🌈 Customize themes - -Reference [custom theme](https://bruno.ke.com/page/guide/theme). - - - -## Contributing - -Please read our [Contributing](https://bruno.ke.com/page/guide/contribution) first. - -Thanks to all the developers who contributed to Bruno ! - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -## 🔗 Links - -- [Homepage](https://bruno.ke.com) -- [All component ](https://bruno.ke.com/page/widgets) -- [Design concept](https://mp.weixin.qq.com/s?__biz=MzIyODcxODY0OA==&mid=2247486048&idx=1&sn=0cc95bd85a54ce0f39f6247d15618ae8&chksm=e84ceb37df3b62216b34c7be041229630eca3d7c4fd3823ebf0520a9f2c99ed2cdf3e677904b&mpshare=1&scene=1&srcid=11012tvWvcYunVGfiPa8EfCT&sharer_sharetime=1635751229200&sharer_shareid=dbde8f595d5b99a8f5cfb27122964615&version=3.1.16.90294) -- [Preparing for use ](https://bruno.ke.com/page/guide/start) -- [Customize themes](https://bruno.ke.com/page/guide/theme) -- [Frequently asked question](https://bruno.ke.com/page/guide/faq) -- [Sketch usage](https://bruno.ke.com/page/guide/sketch) -- [Download of Design](https://bruno.ke.com/download/sketch) - -## Acknowledgements - -As a complete set of standard components, Bruno references the open source packages: - -- [flutter_gifimage](https://github.com/peng8350/flutter_gifimage) -- [expansion_tile_card.dart](https://gist.github.com/Skylled/7ac0f2f99881f7df2a0a850e60ef2df0) -- [photo_view](https://github.com/bluefireteam/photo_view) -- [flutter_intro](https://github.com/tal-tech/flutter_intro) -- [flutter_badges](https://github.com/yako-dev/flutter_badges) -- [lpinyin](https://github.com/flutterchina/lpinyin) -- [azlistview](https://github.com/flutterchina/azlistview) -- [flutter_path_drawing](https://github.com/dnfield/flutter_path_drawing) - -Thanks to the authors above. \ No newline at end of file diff --git a/README.md b/README.md index 3a721b42..1515c0e1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index f2872cf4..d57061dd 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 13.0 diff --git a/example/ios/Flutter/ephemeral/flutter_lldb_helper.py b/example/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 00000000..a88caf99 --- /dev/null +++ b/example/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/example/ios/Flutter/ephemeral/flutter_lldbinit b/example/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 00000000..e3ba6fbe --- /dev/null +++ b/example/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/example/ios/Podfile b/example/ios/Podfile index ff7ef5e8..a18ee29a 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index bacab8cf..757717a2 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -146,7 +146,6 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - DC926F330116FD87C8E402BA /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -163,7 +162,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -208,10 +207,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -244,6 +245,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -256,21 +258,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - DC926F330116FD87C8E402BA /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -346,7 +333,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -369,7 +356,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -436,7 +426,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -485,7 +475,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -509,7 +499,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -544,7 +537,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..fc5ae031 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ @@ -45,11 +46,13 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 3cff9e9e..5c04481b 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -4,7 +4,7 @@ import Flutter /// 如果要调试局部显示 flutter 页面的功能,请打开此开关 let kShouldDebugFlutterInNative = false; -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index ef8f94d8..d2da5e99 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -41,5 +41,9 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart b/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart index 283dc591..bbdfd634 100644 --- a/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart +++ b/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -34,13 +32,14 @@ class SelectedListActionSheetCustomExamplePageState @override Widget build(BuildContext context) { /// 要拦截 Android 的系统返回行为,请务必自行添加以下 WillPopScope 逻辑 - return WillPopScope( - onWillPop: () async { + return PopScope( + canPop: controller.isHidden, // 是否允许系统返回 + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + if (!controller.isHidden) { - controller.dismiss(); - return false; + controller.dismiss(); // 关闭你的弹层 } - return true; }, child: Scaffold( appBar: BrnAppBar( diff --git a/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart b/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart index 10f04ba9..97c21f45 100644 --- a/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart +++ b/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart @@ -33,13 +33,14 @@ class SelectedListActionSheetExamplePageState @override Widget build(BuildContext context) { /// 要拦截 Android 的系统返回行为,请务必自行添加以下 WillPopScope 逻辑 - return WillPopScope( - onWillPop: () async { + return PopScope( + canPop: controller.isHidden, // 是否允许系统返回 + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + if (!controller.isHidden) { - controller.dismiss(); - return false; + controller.dismiss(); // 关闭你的弹层 } - return true; }, child: Scaffold( appBar: BrnAppBar( diff --git a/example/lib/sample/components/charts/line/brn_broken_line_example.dart b/example/lib/sample/components/charts/line/brn_broken_line_example.dart index 890da506..b4851785 100644 --- a/example/lib/sample/components/charts/line/brn_broken_line_example.dart +++ b/example/lib/sample/components/charts/line/brn_broken_line_example.dart @@ -71,8 +71,8 @@ class _BrokenLineExampleState extends State { isCurve: true, points: _linePointsForExample1(brokenData), shaderColors: [ - Colors.green.withOpacity(0.3), - Colors.green.withOpacity(0.01) + Colors.green.withValues(alpha: 0.3), + Colors.green.withValues(alpha: 0.01) ], lineColor: Colors.green, ) @@ -248,8 +248,8 @@ class _BrokenLineExampleState extends State { })), ], shaderColors: [ - Colors.blue.withOpacity(0.3), - Colors.blue.withOpacity(0.01) + Colors.blue.withValues(alpha: 0.3), + Colors.blue.withValues(alpha: 0.01) ], lineColor: Colors.blue, ); @@ -307,8 +307,8 @@ class _BrokenLineExampleState extends State { })), ], shaderColors: [ - Colors.green.withOpacity(0.3), - Colors.green.withOpacity(0.01) + Colors.green.withValues(alpha: 0.3), + Colors.green.withValues(alpha: 0.01) ], lineColor: Colors.green, ); @@ -478,7 +478,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -683,8 +683,8 @@ class _BrokenLineExampleState extends State { })), ], shaderColors: [ - Colors.green.withOpacity(0.3), - Colors.green.withOpacity(0.01) + Colors.green.withValues(alpha: 0.3), + Colors.green.withValues(alpha: 0.01) ], lineColor: Colors.green, ); @@ -835,7 +835,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -1039,8 +1039,8 @@ class _BrokenLineExampleState extends State { })), ], shaderColors: [ - Colors.green.withOpacity(0.3), - Colors.green.withOpacity(0.01) + Colors.green.withValues(alpha: 0.3), + Colors.green.withValues(alpha: 0.01) ], lineColor: Colors.green, ); @@ -1235,7 +1235,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -1438,8 +1438,8 @@ class _BrokenLineExampleState extends State { })), ], shaderColors: [ - Colors.green.withOpacity(0.3), - Colors.green.withOpacity(0.01) + Colors.green.withValues(alpha: 0.3), + Colors.green.withValues(alpha: 0.01) ], lineColor: Colors.green, ); diff --git a/example/lib/sample/components/guide/force_guide_example.dart b/example/lib/sample/components/guide/force_guide_example.dart index 3a0ccc9d..8c526a77 100644 --- a/example/lib/sample/components/guide/force_guide_example.dart +++ b/example/lib/sample/components/guide/force_guide_example.dart @@ -1,5 +1,3 @@ - - import 'dart:async'; import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -55,7 +53,13 @@ class _ForceGuideExampleState extends State { } Widget build(BuildContext context) { - return WillPopScope( + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + + intro.dispose(); + }, child: Scaffold( appBar: BrnAppBar( title: Text( @@ -149,11 +153,6 @@ class _ForceGuideExampleState extends State { }, ), ), - onWillPop: () async { - // destroy guide page when tap back key - intro.dispose(); - return true; - }, ); } } diff --git a/example/lib/sample/components/guide/soft_intro_example.dart b/example/lib/sample/components/guide/soft_intro_example.dart index fcae1e30..19f5399e 100644 --- a/example/lib/sample/components/guide/soft_intro_example.dart +++ b/example/lib/sample/components/guide/soft_intro_example.dart @@ -1,5 +1,3 @@ - - import 'dart:async'; import 'package:bruno/bruno.dart'; @@ -55,7 +53,13 @@ class _SoftGuideExampleState extends State { } Widget build(BuildContext context) { - return WillPopScope( + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + + intro.dispose(); + }, child: Scaffold( appBar: BrnAppBar( title: Text( @@ -149,11 +153,6 @@ class _SoftGuideExampleState extends State { }, ), ), - onWillPop: () async { - // destroy guide page when tap back key - intro.dispose(); - return true; - }, ); } } diff --git a/example/lib/sample/components/navbar/nav_bar_example_page.dart b/example/lib/sample/components/navbar/nav_bar_example_page.dart index 2525a233..14e83207 100644 --- a/example/lib/sample/components/navbar/nav_bar_example_page.dart +++ b/example/lib/sample/components/navbar/nav_bar_example_page.dart @@ -245,14 +245,17 @@ class _NavBarPageState extends State with TickerProviderStateMixin { key: actionKey, iconPressed: () { BrnPopupListWindow.showPopListWindow(context, actionKey, - offset: 10, data: ["aaaa", "bbbbb"], onItemClick: (index, item){ - BrnDialogManager.showConfirmDialog(context, cancel: 'cancel', confirm: 'confirm', message: 'message', onCancel: (){ - Navigator.pop(context); - }); - return true; - }, onDismiss: (){ - BrnToast.show('onDismiss', context); - }); + offset: 10, data: ["aaaa", "bbbbb"], onItemClick: (index, item) { + BrnDialogManager.showConfirmDialog(context, + cancel: 'cancel', + confirm: 'confirm', + message: 'message', onCancel: () { + Navigator.pop(context); + }); + return true; + }, onDismiss: () { + BrnToast.show('onDismiss', context); + }); }, ), ); @@ -324,13 +327,13 @@ class _NavBarPageState extends State with TickerProviderStateMixin { height: 17, padding: EdgeInsets.only(left: 3, right: 3), margin: EdgeInsets.only(left: 6), - decoration: - BoxDecoration(color: Color(0xff8E8E8E).withOpacity(0.15)), + decoration: BoxDecoration( + color: Color(0xff8E8E8E).withValues(alpha: 0.15)), child: Center( child: Text( '住宅', overflow: TextOverflow.ellipsis, - textScaleFactor: 1, + textScaler: TextScaler.linear(1), style: TextStyle( fontSize: 11, height: 1, @@ -518,10 +521,11 @@ class _NavBarPageState extends State with TickerProviderStateMixin { keyLeading, data: ["aaaa", "bbbbb"], onItemClick: (index, data) { - BrnDialogManager.showConfirmDialog(context, cancel: 'cancel', confirm: 'confirm', message: 'message'); + BrnDialogManager.showConfirmDialog(context, + cancel: 'cancel', confirm: 'confirm', message: 'message'); return true; }, - onDismiss: (){ + onDismiss: () { BrnToast.show('onDismiss', context); }, ); @@ -582,12 +586,8 @@ class _NavBarPageState extends State with TickerProviderStateMixin { leadClickCallback: (controller, update) { //controller 是文本控制器,通过controller 可以拿到输入的内容 以及 对输入的内容更改 //update 是setState方法的方法命,update() 就可以刷新输入框 - BrnPopupListWindow.showPopListWindow( - context, - keyLeading, - data: ["aaaa", "bbbbb"], - offset: 10 - ); + BrnPopupListWindow.showPopListWindow(context, keyLeading, + data: ["aaaa", "bbbbb"], offset: 10); }, //输入框 文本内容变化的监听 searchBarInputChangeCallback: (input) { diff --git a/example/lib/sample/components/selection/selectionview_customview_example_page.dart b/example/lib/sample/components/selection/selectionview_customview_example_page.dart index 92f2c551..7f894427 100644 --- a/example/lib/sample/components/selection/selectionview_customview_example_page.dart +++ b/example/lib/sample/components/selection/selectionview_customview_example_page.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -42,8 +40,9 @@ class _SelectionViewExamplePageState @override void initState() { - _currentCalendarSelectedDate = - ValueNotifier(DateTimeFormatter.convertStringToDate(_dateForamt, _filterSelectedDate)); + _currentCalendarSelectedDate = ValueNotifier( + DateTimeFormatter.convertStringToDate( + _dateForamt, _filterSelectedDate)); super.initState(); } @@ -192,8 +191,8 @@ class _SelectionViewExamplePageState ), ), onTap: () { - /// TODO 清除筛选 - _currentCalendarSelectedDate.value = null; + _customHandleCallBack?.call(Map()); + closeCustomFilterView(); }, ), Expanded( diff --git a/example/lib/sample/components/tabbar/brn_tab_example.dart b/example/lib/sample/components/tabbar/brn_tab_example.dart index 5e58e413..2b6df363 100644 --- a/example/lib/sample/components/tabbar/brn_tab_example.dart +++ b/example/lib/sample/components/tabbar/brn_tab_example.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/bruno.dart'; import 'package:example/sample/home/list_item.dart'; import 'package:flutter/material.dart'; @@ -23,62 +21,62 @@ class _BrnTabExampleState extends State @override Widget build(BuildContext context) { - return WillPopScope( - child: Scaffold( - appBar: BrnAppBar( - title: 'BrnTab示例', - ), - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ListItem( - title: "BrnTabBarBadge实现", - isShowLine: false, - ), - Divider(), - Center( - child: OutlinedButton( - onPressed: () { - Navigator.of(context) - .push(new MaterialPageRoute(builder: (context) { - return BrnTabbarStickyExample(); - })); - }, - child: Text("Tabbar点击自动收起example"), - ), + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + + closeWindowController!.closeMoreWindow(); + }, + child: Scaffold( + appBar: BrnAppBar( + title: 'BrnTab示例', + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListItem( + title: "BrnTabBarBadge实现", + isShowLine: false, + ), + Divider(), + Center( + child: OutlinedButton( + onPressed: () { + Navigator.of(context) + .push(new MaterialPageRoute(builder: (context) { + return BrnTabbarStickyExample(); + })); + }, + child: Text("Tabbar点击自动收起example"), ), - Divider(), - _createExpandedMoreTabbarWidgets(), - Divider(), - _createStableTabbar4Widgets(), - Divider(), - _createStableTabbarWidgets(), - Divider(), - _createTabbarBadgeWidgets(), - Divider(), - _createStableTabbarBadgeWidgets(), - Divider(), - _createDividerTabbarWidgets(), - Divider(), - _createCustomTabbarWidgets(), - Divider(), - _createTopTabbarWidgets(), - Divider(), - _createTopTabbarCountWidgets(), - Divider(), - _createOriginWidgets(), - ], - ), + ), + Divider(), + _createExpandedMoreTabbarWidgets(), + Divider(), + _createStableTabbar4Widgets(), + Divider(), + _createStableTabbarWidgets(), + Divider(), + _createTabbarBadgeWidgets(), + Divider(), + _createStableTabbarBadgeWidgets(), + Divider(), + _createDividerTabbarWidgets(), + Divider(), + _createCustomTabbarWidgets(), + Divider(), + _createTopTabbarWidgets(), + Divider(), + _createTopTabbarCountWidgets(), + Divider(), + _createOriginWidgets(), + ], ), ), - onWillPop: () { - if (closeWindowController!.isShow) { - closeWindowController!.closeMoreWindow(); - return Future.value(false); - } - return Future.value(true); - }); + ), + ); } _createExpandedMoreTabbarWidgets() { diff --git a/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart b/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart index 07b682e4..5bb9849c 100644 --- a/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart +++ b/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -37,7 +35,13 @@ class _BrnTabbarStickyExampleState extends State @override Widget build(BuildContext context) { - return WillPopScope( + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + + closeWindowController!.closeMoreWindow(); + }, child: Scaffold( appBar: BrnAppBar( title: 'TabBar Sticky 效果', @@ -86,13 +90,7 @@ class _BrnTabbarStickyExampleState extends State ), ), ), - onWillPop: () { - if (closeWindowController!.isShow) { - closeWindowController!.closeMoreWindow(); - return Future.value(false); - } - return Future.value(true); - }); + ); } Widget buildHeaderWidget() { diff --git a/example/lib/sample/home/list_item.dart b/example/lib/sample/home/list_item.dart index fdf232e6..0e323cbe 100644 --- a/example/lib/sample/home/list_item.dart +++ b/example/lib/sample/home/list_item.dart @@ -1,5 +1,3 @@ - - import 'package:bruno/bruno.dart'; import 'package:flutter/material.dart'; @@ -42,7 +40,8 @@ class ListItem extends StatefulWidget { _ListItemState createState() => _ListItemState(); } -class _ListItemState extends State with AutomaticKeepAliveClientMixin { +class _ListItemState extends State + with AutomaticKeepAliveClientMixin { @override bool get wantKeepAlive => true; @@ -52,8 +51,8 @@ class _ListItemState extends State with AutomaticKeepAliveClientMixin return TextButton( onPressed: widget.onPressed, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.white), - overlayColor: MaterialStateProperty.all(Colors.transparent), + backgroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.transparent), ), child: Container( color: Colors.white, diff --git a/example/web/main.dart b/example/web/main.dart index 6de19551..ad3dacd4 100644 --- a/example/web/main.dart +++ b/example/web/main.dart @@ -1,5 +1,3 @@ - -// TODO: change `my_app` to refer to your app package name. import 'package:example/sample/home/home.dart'; import 'package:flutter/material.dart'; @@ -18,4 +16,4 @@ class MyApp extends StatelessWidget { home: HomePage(), ); } -} \ No newline at end of file +} diff --git a/lib/src/components/actionsheet/brn_common_action_sheet.dart b/lib/src/components/actionsheet/brn_common_action_sheet.dart index 6ab95714..1d79e532 100644 --- a/lib/src/components/actionsheet/brn_common_action_sheet.dart +++ b/lib/src/components/actionsheet/brn_common_action_sheet.dart @@ -109,7 +109,7 @@ class BrnCommonActionSheet extends StatelessWidget { @override Widget build(BuildContext context) { - EdgeInsets padding = MediaQueryData.fromView(View.of(context)).padding; + EdgeInsets padding = MediaQuery.of(context).padding; double maxHeight = MediaQuery.of(context).size.height - padding.top - padding.bottom; diff --git a/lib/src/components/appraise/brn_flutter_gif_image.dart b/lib/src/components/appraise/brn_flutter_gif_image.dart index 757825ca..08a2cd54 100644 --- a/lib/src/components/appraise/brn_flutter_gif_image.dart +++ b/lib/src/components/appraise/brn_flutter_gif_image.dart @@ -1,7 +1,6 @@ import 'dart:ui' as ui show Codec; import 'dart:ui'; -import 'package:bindings_compatible/bindings_compatible.dart'; import 'package:flutter/widgets.dart'; /// 描述: 用于加载gif图, @@ -128,8 +127,7 @@ class GifImageState extends State { dynamic data; AssetBundleImageKey key = await provider.obtainKey(ImageConfiguration()); data = await key.bundle.load(key.name); - ui.Codec codec = await usePaintingBinding() - .instantiateImageCodecWithSize(data.buffer.asUint8List()); + ui.Codec codec = await instantiateImageCodec(data.buffer.asUint8List()); for (int i = 0; i < codec.frameCount; i++) { FrameInfo frameInfo = await codec.getNextFrame(); infos.add(ImageInfo(image: frameInfo.image)); diff --git a/lib/src/components/button/brn_big_ghost_button.dart b/lib/src/components/button/brn_big_ghost_button.dart index 83df8403..fb9fe41a 100644 --- a/lib/src/components/button/brn_big_ghost_button.dart +++ b/lib/src/components/button/brn_big_ghost_button.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; /// 页面中和主题色相关的幽灵按钮 可以支持自定义背景颜色、文字颜色等 /// -/// 和[BrnBigMainButton]相比,该按钮的背景色仅仅是其背景色的withOpacity(0.1) +/// 和[BrnBigMainButton]相比,该按钮的背景色仅仅是其背景色的withValues(alpha: 0.1) /// 并且该按钮不支持不可用状态 /// /// 按钮是圆角矩形的形状,不支持改变形状。 @@ -63,7 +63,7 @@ class BrnBigGhostButton extends StatelessWidget { width: width ?? double.infinity, height: defaultThemeConfig.bigButtonHeight), backgroundColor: bgColor ?? - defaultThemeConfig.commonConfig.brandPrimary.withOpacity(0.05), + defaultThemeConfig.commonConfig.brandPrimary.withValues(alpha: 0.05), onTap: onTap, alignment: Alignment.center, text: title ?? BrnIntl.of(context).localizedResource.confirm, diff --git a/lib/src/components/button/brn_big_main_button.dart b/lib/src/components/button/brn_big_main_button.dart index 8cece517..6e01faca 100644 --- a/lib/src/components/button/brn_big_main_button.dart +++ b/lib/src/components/button/brn_big_main_button.dart @@ -79,7 +79,7 @@ class BrnBigMainButton extends StatelessWidget { onTap: onTap, textColor: Colors.white, disableTextColor: - defaultThemeConfig.commonConfig.colorTextBaseInverse.withOpacity(0.7), + defaultThemeConfig.commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), ); } } diff --git a/lib/src/components/button/brn_big_outline_button.dart b/lib/src/components/button/brn_big_outline_button.dart index c383cb31..444057e5 100644 --- a/lib/src/components/button/brn_big_outline_button.dart +++ b/lib/src/components/button/brn_big_outline_button.dart @@ -91,7 +91,7 @@ class BrnBigOutlineButton extends StatelessWidget { height: defaultThemeConfig.bigButtonHeight), onTap: onTap, backgroundColor: Colors.white, - disableBackgroundColor: Color(0xffcccccc).withOpacity(0.1), + disableBackgroundColor: Color(0xffcccccc).withValues(alpha: 0.1), ); } } diff --git a/lib/src/components/button/brn_normal_button.dart b/lib/src/components/button/brn_normal_button.dart index e456d58e..69dbf9ca 100644 --- a/lib/src/components/button/brn_normal_button.dart +++ b/lib/src/components/button/brn_normal_button.dart @@ -208,7 +208,7 @@ class BrnNormalButton extends StatelessWidget { if (isEnable) { textColor = this.textColor; } else { - textColor = this.disableTextColor ?? (this.textColor).withOpacity(0.7); + textColor = this.disableTextColor ?? (this.textColor).withValues(alpha: 0.7); } return TextStyle( diff --git a/lib/src/components/button/brn_small_main_button.dart b/lib/src/components/button/brn_small_main_button.dart index 506b0948..39da3115 100644 --- a/lib/src/components/button/brn_small_main_button.dart +++ b/lib/src/components/button/brn_small_main_button.dart @@ -87,7 +87,8 @@ class BrnSmallMainButton extends StatelessWidget { .buttonConfig .merge(defaultThemeConfig); - TextPainter textPainter = TextPainter(textScaleFactor: MediaQuery.of(context).textScaleFactor); + TextPainter textPainter = + TextPainter(textScaler: MediaQuery.textScalerOf(context)); return LayoutBuilder( builder: (_, con) { diff --git a/lib/src/components/button/brn_small_outline_button.dart b/lib/src/components/button/brn_small_outline_button.dart index 4bffb2cf..549db402 100644 --- a/lib/src/components/button/brn_small_outline_button.dart +++ b/lib/src/components/button/brn_small_outline_button.dart @@ -86,7 +86,7 @@ class BrnSmallOutlineButton extends StatelessWidget { .buttonConfig.merge(defaultThemeConfig); TextPainter textPainter = - TextPainter(textScaleFactor: MediaQuery.of(context).textScaleFactor); + TextPainter(textScaler: MediaQuery.textScalerOf(context)); return LayoutBuilder( builder: (_, con) { @@ -129,7 +129,7 @@ class BrnSmallOutlineButton extends StatelessWidget { fontSize: defaultThemeConfig.smallButtonFontSize, onTap: onTap, backgroundColor: Colors.white, - disableBackgroundColor: Color(0xffcccccc).withOpacity(0.1), + disableBackgroundColor: Color(0xffcccccc).withValues(alpha: 0.1), ); }, ); 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 d545e161..3cc7f5b5 100644 --- a/lib/src/components/button/collection/brn_bottom_button_panel.dart +++ b/lib/src/components/button/collection/brn_bottom_button_panel.dart @@ -227,7 +227,7 @@ class BrnBottomButtonPanel extends StatelessWidget { ? Colors.white : BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextBaseInverse.withOpacity(0.7), + .commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), ), ), )), @@ -268,7 +268,7 @@ class BrnBottomButtonPanel extends StatelessWidget { ? Colors.white : BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextBaseInverse.withOpacity(0.7), + .commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), ), ), )), diff --git a/lib/src/components/calendar/brn_calendar_view.dart b/lib/src/components/calendar/brn_calendar_view.dart index 4d549b3a..c4b251df 100644 --- a/lib/src/components/calendar/brn_calendar_view.dart +++ b/lib/src/components/calendar/brn_calendar_view.dart @@ -372,7 +372,7 @@ class _CustomCalendarViewState extends State { .getConfig() .commonConfig .brandPrimary - .withOpacity(0.14) + .withValues(alpha: 0.14) : Colors.transparent) : Colors.transparent, // 范围选择两端圆角 diff --git a/lib/src/components/card/content_card/brn_pair_info_rich_grid.dart b/lib/src/components/card/content_card/brn_pair_info_rich_grid.dart index f125da2f..14a0f5cd 100644 --- a/lib/src/components/card/content_card/brn_pair_info_rich_grid.dart +++ b/lib/src/components/card/content_card/brn_pair_info_rich_grid.dart @@ -35,7 +35,6 @@ import 'package:flutter/material.dart'; /// * [BrnPairInfoTable], 单列key-value信息集合组件 /// class BrnRichInfoGrid extends StatelessWidget { - /// 待展示的文本信息 final List? pairInfoList; @@ -97,7 +96,7 @@ class BrnRichInfoGrid extends StatelessWidget { gridWidth = MediaQuery.of(context).size.width; } double itemHeight = - defaultConfig.itemHeight * (MediaQuery.textScaleFactorOf(context)); + MediaQuery.textScalerOf(context).scale(defaultConfig.itemHeight); double itemWidth = (gridWidth - defaultConfig.itemSpacing) / 2; var gridView = GridView.builder( @@ -180,7 +179,6 @@ class BrnRichInfoGrid extends StatelessWidget { /// 用于构建文本信息 class BrnRichGridInfo { - /// final dynamic keyPart; final dynamic valuePart; @@ -256,8 +254,7 @@ class BrnRichGridInfo { bool isShowValueQuestion = valueQuestionCallback != null; bool isShowValueClick = clickTitle.isNotEmpty; - MediaQueryData mediaQuery = MediaQueryData.fromView(View.of(context)); - double screen = mediaQuery.size.width; + double screen = MediaQuery.of(context).size.width; Widget key = Container( constraints: BoxConstraints( diff --git a/lib/src/components/card/content_card/brn_pair_info_table.dart b/lib/src/components/card/content_card/brn_pair_info_table.dart index 3df1f233..fb2ca878 100644 --- a/lib/src/components/card/content_card/brn_pair_info_table.dart +++ b/lib/src/components/card/content_card/brn_pair_info_table.dart @@ -71,7 +71,6 @@ import 'package:flutter/material.dart'; /// * [BrnFollowPairInfo], key-value紧紧相随的的文本组件 /// class BrnPairInfoTable extends StatefulWidget { - /// 文本信息是否对齐 默认不对齐 final bool isValueAlign; @@ -108,19 +107,18 @@ class BrnPairInfoTable extends StatefulWidget { final ValueChanged? onFolded; /// create BrnPairInfoTable - BrnPairInfoTable({ - Key? key, - required this.children, - this.defaultVerticalAlignment = TableCellVerticalAlignment.baseline, - this.isValueAlign = true, - this.expandAtIndex = -1, - this.rowDistance, - this.itemSpacing, - this.isFolded = true, - this.onFolded, - this.customKeyWidth, - this.themeData - }); + BrnPairInfoTable( + {Key? key, + required this.children, + this.defaultVerticalAlignment = TableCellVerticalAlignment.baseline, + this.isValueAlign = true, + this.expandAtIndex = -1, + this.rowDistance, + this.itemSpacing, + this.isFolded = true, + this.onFolded, + this.customKeyWidth, + this.themeData}); @override _BrnPairInfoTableState createState() => _BrnPairInfoTableState(); @@ -742,7 +740,7 @@ class BrnInfoModal { /// clickCallback 可点击文案点击的回调 /// isArrow 是否最右侧存在箭头 static BrnInfoModal valueLastClickInfo( - BuildContext context, + BuildContext context, String keyTitle, String valueTitle, String clickValue, { @@ -834,7 +832,7 @@ class BrnInfoModal { /// valueCallback value的小问号点击的回调 /// /// isArrow 是否最右侧存在箭头 static BrnInfoModal keyOrValueLastQuestionInfo( - BuildContext context, + BuildContext context, String keyTitle, String valueTitle, { bool keyShow = false, @@ -865,8 +863,7 @@ class BrnInfoModal { dynamic keyWidget; if (isArrow) { - MediaQueryData mediaQuery = MediaQueryData.fromView(View.of(context)); - double screen = mediaQuery.size.width; + double screen = MediaQuery.of(context).size.width; if (keyShow) { keyWidget = Container( diff --git a/lib/src/components/card_title/brn_common_card_title.dart b/lib/src/components/card_title/brn_common_card_title.dart index c45a94e5..0f1a3bc4 100644 --- a/lib/src/components/card_title/brn_common_card_title.dart +++ b/lib/src/components/card_title/brn_common_card_title.dart @@ -185,7 +185,7 @@ class BrnCommonCardTitle extends StatelessWidget { subWidget = _subTitleWidgetFromWidget(); } var titleWidget = RichText( - textScaleFactor: MediaQuery.of(context).textScaleFactor, + textScaler: MediaQuery.textScalerOf(context), maxLines: this.titleMaxLines, overflow: this.titleOverflow, text: TextSpan( diff --git a/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart b/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart index a8fbf79d..717c9b93 100644 --- a/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart +++ b/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart @@ -184,7 +184,7 @@ class BrnDoughnut extends CustomPainter { height: textHeight + this.textVerticalPadding * 2); RRect rRect = RRect.fromRectAndRadius(baseRect, Radius.circular(2)); Paint textBackgroundPaint = Paint() - ..color = Colors.black.withOpacity(0.7); + ..color = Colors.black.withValues(alpha: 0.7); canvas.drawRRect(rRect, textBackgroundPaint); textPainter.paint( diff --git a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart index c35ac936..06a524b7 100644 --- a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart +++ b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart @@ -429,7 +429,7 @@ class BrnProgressBarChartPainter extends CustomPainter { // 坐标刻度虚线 _drawDashLineOn(canvas, Offset(currentOffset.dx, currentOffset.dy), - Offset(currentOffset.dx, 0), Colors.black.withOpacity(0.09)); + Offset(currentOffset.dx, 0), Colors.black.withValues(alpha: 0.09)); // 坐标文本 AxisItem axisItem = this.xAxis.axisItemList[xAxisItemIndex]; @@ -557,7 +557,7 @@ class BrnProgressBarChartPainter extends CustomPainter { yAxisItemOffset, Offset(yAxisItemOffset.dx + this.contentRect.width, yAxisItemOffset.dy), - Colors.black.withOpacity(0.09)); + Colors.black.withValues(alpha: 0.09)); } } } diff --git a/lib/src/components/charts/broken_line/brn_broken_line.dart b/lib/src/components/charts/broken_line/brn_broken_line.dart index 4bdcea07..c727948f 100644 --- a/lib/src/components/charts/broken_line/brn_broken_line.dart +++ b/lib/src/components/charts/broken_line/brn_broken_line.dart @@ -264,7 +264,7 @@ class BrnBrokenLineState extends State { borderRadius: BorderRadius.circular(3.0), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), offset: Offset(0.0, 2.0), //阴影xy轴偏移量 blurRadius: 4.0, //阴影模糊程度 ) diff --git a/lib/src/components/dialog/brn_safe_dialog.dart b/lib/src/components/dialog/brn_safe_dialog.dart index fa355318..8f01dae1 100644 --- a/lib/src/components/dialog/brn_safe_dialog.dart +++ b/lib/src/components/dialog/brn_safe_dialog.dart @@ -34,7 +34,6 @@ class BrnSafeDialog { _safeDialogRoute.completer.complete(result); } } catch (e) { - /// TODO 可能会抛出异常, 直接打印到日志区 print(e); } } @@ -78,8 +77,8 @@ class BrnSafeDialog { // 将结果通过 Completer 转发出去 _dialogStates[tag] ??= []; _dialogStates[tag]?.add(safeDialogRoute); - Future future = - Navigator.of(context, rootNavigator: useRootNavigator).push(safeDialogRoute); + Future future = Navigator.of(context, rootNavigator: useRootNavigator) + .push(safeDialogRoute); future.then((result) { _dialogStates[tag]?.remove(safeDialogRoute); if (!safeDialogRoute.completer.isCompleted) { @@ -92,7 +91,6 @@ class BrnSafeDialog { /// 基于 DialogRoute 简单封装了 Completer,用于 Route 结果的转发 class _SafeDialogRoute extends DialogRoute { - /// 转发 Route 结果 final Completer completer = Completer(); @@ -105,14 +103,14 @@ class _SafeDialogRoute extends DialogRoute { String? barrierLabel, bool useSafeArea = true, RouteSettings? settings, - }) : super( - context:context, - builder: builder, - themes: themes, - barrierColor: barrierColor, - barrierDismissible: barrierDismissible, - barrierLabel: barrierLabel, - useSafeArea: useSafeArea, - settings: settings, - ); -} \ No newline at end of file + }) : super( + context: context, + builder: builder, + themes: themes, + barrierColor: barrierColor, + barrierDismissible: barrierDismissible, + barrierLabel: barrierLabel, + useSafeArea: useSafeArea, + settings: settings, + ); +} diff --git a/lib/src/components/form/items/general/brn_quick_select_input_item.dart b/lib/src/components/form/items/general/brn_quick_select_input_item.dart index 12412706..163c12bc 100644 --- a/lib/src/components/form/items/general/brn_quick_select_input_item.dart +++ b/lib/src/components/form/items/general/brn_quick_select_input_item.dart @@ -339,9 +339,9 @@ class QuickButtonsState extends State { padding: EdgeInsets.fromLTRB(6, 0, 6, 0), child: TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(getButtonColor(index)), - overlayColor: MaterialStateProperty.all(Colors.transparent), - padding: MaterialStateProperty.all(EdgeInsets.all(10)), + backgroundColor: WidgetStateProperty.all(getButtonColor(index)), + overlayColor: WidgetStateProperty.all(Colors.transparent), + padding: WidgetStateProperty.all(EdgeInsets.all(10)), ), child: Text( str, diff --git a/lib/src/components/form/items/general/brn_title_select_input_item.dart b/lib/src/components/form/items/general/brn_title_select_input_item.dart index 0fc6b135..9414c2fa 100644 --- a/lib/src/components/form/items/general/brn_title_select_input_item.dart +++ b/lib/src/components/form/items/general/brn_title_select_input_item.dart @@ -373,7 +373,7 @@ class _TitleSelectPopWidgetState extends State { BoxShadow( blurRadius: 2, //阴影范围 spreadRadius: 1, //阴影浓度 - color: Colors.white.withOpacity(0.08), //阴影颜色 + color: Colors.white.withValues(alpha: 0.08), //阴影颜色 ), ], color: Colors.white, diff --git a/lib/src/components/guide/brn_flutter_guide.dart b/lib/src/components/guide/brn_flutter_guide.dart index d434f8f6..89d0c464 100644 --- a/lib/src/components/guide/brn_flutter_guide.dart +++ b/lib/src/components/guide/brn_flutter_guide.dart @@ -40,7 +40,7 @@ class BrnGuide { late Widget _stepWidget; List _configMap = []; List _globalKeys = []; - final Color _maskColor = Colors.black.withOpacity(.6); + final Color _maskColor = Colors.black.withValues(alpha: .6); final Duration _animationDuration = Duration(milliseconds: 300); final _th = _Throttling(duration: Duration(milliseconds: 500)); late Size _lastScreenSize; diff --git a/lib/src/components/loading/brn_loading.dart b/lib/src/components/loading/brn_loading.dart index 17b10cf8..5ed60ea2 100644 --- a/lib/src/components/loading/brn_loading.dart +++ b/lib/src/components/loading/brn_loading.dart @@ -47,7 +47,7 @@ class BrnPageLoading extends StatelessWidget { // 获取实际文字长度 TextPainter textPainter = TextPainter( textDirection: TextDirection.ltr, - textScaleFactor: MediaQuery.of(context).textScaleFactor, + textScaler: MediaQuery.textScalerOf(context), text: TextSpan( text: loadingText, style: TextStyle( diff --git a/lib/src/components/navbar/brn_appbar.dart b/lib/src/components/navbar/brn_appbar.dart index e163619f..dd710279 100644 --- a/lib/src/components/navbar/brn_appbar.dart +++ b/lib/src/components/navbar/brn_appbar.dart @@ -239,7 +239,7 @@ class BrnAppBar extends PreferredSize { if (this.flexibleSpace != null) { flexibleSpace = Container( height: _defaultConfig.appBarHeight + - MediaQueryData.fromView(View.of(context)).padding.top, + MediaQuery.of(context).padding.top, child: this.flexibleSpace, ); } diff --git a/lib/src/components/navbar/brn_search_bar.dart b/lib/src/components/navbar/brn_search_bar.dart index e22cbe58..c1c91574 100644 --- a/lib/src/components/navbar/brn_search_bar.dart +++ b/lib/src/components/navbar/brn_search_bar.dart @@ -208,11 +208,11 @@ class __SearchInputWidgetState extends State<_SearchInputWidget> { valueNotifier = ValueNotifier(false); _focusNode.addListener(_handleFocusChangeListenerTick); if (widget.themeData?.systemOverlayStyle.statusBarBrightness == Brightness.dark) { - _defaultDividerColor = Colors.white.withOpacity(0.2); - _defaultHintTextColor = Colors.white.withOpacity(0.4); + _defaultDividerColor = Colors.white.withValues(alpha: 0.2); + _defaultHintTextColor = Colors.white.withValues(alpha: 0.4); _defaultInputTextColor = Colors.white; _defaultCancelTextColor = Colors.white; - _defaultClearIconColor = Colors.white.withOpacity(0.4); + _defaultClearIconColor = Colors.white.withValues(alpha: 0.4); } else { _defaultDividerColor = BrnThemeConfigurator.instance .getConfig() diff --git a/lib/src/components/picker/base/brn_picker.dart b/lib/src/components/picker/base/brn_picker.dart index 3776a810..822a56c7 100644 --- a/lib/src/components/picker/base/brn_picker.dart +++ b/lib/src/components/picker/base/brn_picker.dart @@ -22,6 +22,9 @@ const double _kSqueeze = 1; /// lens with the same color as the background. const double _kForegroundScreenOpacityFraction = 0.4; +/// Alpha channel as 0–255 from [Color.a]. +int _alphaByte(Color color) => (color.a * 255.0).round() & 0xff; + /// An iOS-styled picker. /// /// Displays its children widgets on a wheel for selection and @@ -234,7 +237,7 @@ class _CupertinoPickerState extends State { // have to just do a color blend. And a due to the way we are layering // the magnifier and the gradient on the background, using a transparent // background color makes the picker look odd. - if (widget.backgroundColor.alpha < 255) return Container(); + if (_alphaByte(widget.backgroundColor) < 255) return Container(); final Color widgetBackgroundColor = widget.backgroundColor; return Positioned.fill( @@ -275,7 +278,7 @@ class _CupertinoPickerState extends State { /// the lens and partially grayed out around it. Widget _buildMagnifierScreen() { final Color foreground = widget.backgroundColor.withAlpha( - (widget.backgroundColor.alpha * _kForegroundScreenOpacityFraction) + (_alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) .toInt()); return IgnorePointer( @@ -313,7 +316,7 @@ class _CupertinoPickerState extends State { Widget _buildUnderMagnifierScreen() { final Color foreground = widget.backgroundColor.withAlpha( - (widget.backgroundColor.alpha * _kForegroundScreenOpacityFraction) + (_alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) .toInt()); return Column( @@ -370,7 +373,7 @@ class _CupertinoPickerState extends State { ); // Adds the appropriate opacity under the magnifier if the background // color is transparent. - if (widget.backgroundColor.alpha < 255) { + if (_alphaByte(widget.backgroundColor) < 255) { result = Stack( children: [ _buildUnderMagnifierScreen(), diff --git a/lib/src/components/picker/brn_bottom_picker.dart b/lib/src/components/picker/brn_bottom_picker.dart index a57b4bce..925e9cbe 100644 --- a/lib/src/components/picker/brn_bottom_picker.dart +++ b/lib/src/components/picker/brn_bottom_picker.dart @@ -115,10 +115,12 @@ class BrnBottomPickerWidgetState extends State @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async { + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + _controller.reverse(); - return true; }, child: Scaffold( backgroundColor: Color(0x33999999), @@ -201,7 +203,8 @@ class BrnBottomPickerWidgetState extends State } else if (widget.confirm is String) { confirmWidget = _buildDefaultConfirm(widget.confirm); } else { - confirmWidget = _buildDefaultConfirm(BrnIntl.of(context).localizedResource.confirm); + confirmWidget = + _buildDefaultConfirm(BrnIntl.of(context).localizedResource.confirm); } return confirmWidget; } @@ -213,7 +216,8 @@ class BrnBottomPickerWidgetState extends State } else if (widget.cancel is String) { cancelWidget = _buildDefaultCancel(widget.cancel); } else { - cancelWidget = _buildDefaultCancel(BrnIntl.of(context).localizedResource.cancel); + cancelWidget = + _buildDefaultCancel(BrnIntl.of(context).localizedResource.cancel); } return cancelWidget; } diff --git a/lib/src/components/picker/brn_select_tags_with_input_picker.dart b/lib/src/components/picker/brn_select_tags_with_input_picker.dart index 8fe8892b..a5f32822 100644 --- a/lib/src/components/picker/brn_select_tags_with_input_picker.dart +++ b/lib/src/components/picker/brn_select_tags_with_input_picker.dart @@ -311,7 +311,7 @@ class _BrnSelectTagsWithInputPickerWidgetState .getConfig() .commonConfig .brandPrimary - .withOpacity(0.14); + .withValues(alpha: 0.14); return Container( color: Colors.white, diff --git a/lib/src/components/popup/brn_overlay_window.dart b/lib/src/components/popup/brn_overlay_window.dart index c5705d18..9e710534 100644 --- a/lib/src/components/popup/brn_overlay_window.dart +++ b/lib/src/components/popup/brn_overlay_window.dart @@ -97,7 +97,7 @@ class _BrnOverlayWindowState extends State { @override Widget build(BuildContext context) { this._showRect = _getWidgetGlobalRect(widget.targetKey); - this._screenSize = View.of(context).physicalSize / View.of(context).devicePixelRatio; + this._screenSize = MediaQuery.of(context).size; if (this._showRect == null) { return const SizedBox.shrink(); } diff --git a/lib/src/components/popup/brn_popup_window.dart b/lib/src/components/popup/brn_popup_window.dart index e0e724f0..25759f7d 100644 --- a/lib/src/components/popup/brn_popup_window.dart +++ b/lib/src/components/popup/brn_popup_window.dart @@ -193,7 +193,8 @@ class _BrnPopupWindowState extends State { void initState() { super.initState(); this._showRect = _getWidgetGlobalRect(widget.popKey); - this._screenSize =PlatformDispatcher.instance.views.first.physicalSize/ PlatformDispatcher.instance.views.first.devicePixelRatio; + this._screenSize = PlatformDispatcher.instance.views.first.physicalSize / + PlatformDispatcher.instance.views.first.devicePixelRatio; _borderColor = (widget.borderColor ?? Colors.transparent).withAlpha(255); _backgroundColor = (widget.backgroundColor ?? Colors.transparent).withAlpha(255); @@ -244,26 +245,30 @@ class _BrnPopupWindowState extends State { Widget build(BuildContext context) { return ExcludeSemantics( excluding: true, - child: WillPopScope( - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - Navigator.pop(context); - }, - child: Material( - color: Colors.transparent, - child: Stack( - children: [ - _buildPopWidget(context), - // triangle arrow - _buildArrowWidget(), - ], - ), + child: PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop || result == true) return; + + Navigator.pop(context); + }, + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + Navigator.pop(context); + }, + child: Material( + color: Colors.transparent, + child: Stack( + children: [ + _buildPopWidget(context), + // triangle arrow + _buildArrowWidget(), + ], ), ), - onWillPop: () { - return Future.value(true); - }), + ), + ), ); } @@ -313,7 +318,7 @@ class _BrnPopupWindowState extends State { // popWindow的弹出样式 Widget _buildPopWidget(BuildContext context) { // 状态栏高度 - double statusBarHeight = MediaQueryData.fromView(View.of(context)).padding.top; + double statusBarHeight = MediaQuery.of(context).padding.top; return Positioned( left: _expandedRight ? _left : null, right: _expandedRight ? null : _right, @@ -486,7 +491,11 @@ class BrnPopupListWindow { VoidCallback? onDismiss, }) { TextStyle textStyle = TextStyle( - color: BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextBase, fontSize: 16); + color: BrnThemeConfigurator.instance + .getConfig() + .commonConfig + .colorTextBase, + fontSize: 16); double arrowHeight = 6.0; Color borderColor = Color(0xffCCCCCC); Color backgroundColor = Colors.white; @@ -497,8 +506,10 @@ class BrnPopupListWindow { double maxHeight = 200; double borderRadius = 4; bool hasCloseIcon = true; - assert(popKey.currentContext != null && popKey.currentContext!.findRenderObject() != null); - if (popKey.currentContext == null || popKey.currentContext!.findRenderObject() == null) return; + assert(popKey.currentContext != null && + popKey.currentContext!.findRenderObject() != null); + if (popKey.currentContext == null || + popKey.currentContext!.findRenderObject() == null) return; Navigator.push( context, BrnPopupRoute( @@ -512,22 +523,24 @@ class BrnPopupListWindow { offset: offset, widget: BrunoTools.isEmpty(data) ? Container( - constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), + constraints: + BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), ) : Container( - constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), + constraints: + BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), child: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 6, bottom: 6), child: Column( - children: - _getItems(context, minWidth, maxWidth, itemBuilder, textStyle, data!, - (index, item) { + children: _getItems(context, minWidth, maxWidth, + itemBuilder, textStyle, data!, (index, item) { if (onItemClick != null) { bool isIntercept = onItemClick(index, item); if (isIntercept) return; } - Navigator.pop(context, {'index': index, 'item': item}); + Navigator.pop( + context, {'index': index, 'item': item}); }), ), ), @@ -559,8 +572,10 @@ class BrnPopupListWindow { double? arrowOffset, BrnPopupListItemClick? onItemClick, VoidCallback? onDismiss}) { - assert(popKey.currentContext != null && popKey.currentContext!.findRenderObject() != null); - if (popKey.currentContext == null || popKey.currentContext!.findRenderObject() == null) return; + assert(popKey.currentContext != null && + popKey.currentContext!.findRenderObject() != null); + if (popKey.currentContext == null || + popKey.currentContext!.findRenderObject() == null) return; double arrowHeight = 6.0; double borderRadius = 4; @@ -568,10 +583,15 @@ class BrnPopupListWindow { double minWidth = 100; double maxWidth = 150; double maxHeight = 200; - Color borderColor = BrnThemeConfigurator.instance.getConfig().commonConfig.dividerColorBase; + Color borderColor = + BrnThemeConfigurator.instance.getConfig().commonConfig.dividerColorBase; Color backgroundColor = Colors.white; TextStyle textStyle = TextStyle( - color: BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextBase, fontSize: 14); + color: BrnThemeConfigurator.instance + .getConfig() + .commonConfig + .colorTextBase, + fontSize: 14); bool hasCloseIcon = true; Navigator.push( @@ -588,15 +608,18 @@ class BrnPopupListWindow { offset: offset, widget: BrunoTools.isEmpty(data) ? Container( - constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), + constraints: + BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), ) : Container( - constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), + constraints: + BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), child: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 6, bottom: 6), child: Column( - children: _getItems(context, minWidth, maxWidth, null, textStyle, data!, + children: _getItems( + context, minWidth, maxWidth, null, textStyle, data!, (index, item) { if (onItemClick != null) { bool isIntercept = onItemClick(index, item); diff --git a/lib/src/components/selection/widget/brn_selection_list_widget.dart b/lib/src/components/selection/widget/brn_selection_list_widget.dart index efc7a305..aa296390 100644 --- a/lib/src/components/selection/widget/brn_selection_list_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_list_widget.dart @@ -17,7 +17,6 @@ typedef SingleListItemSelect = void Function( /// 多列数据选择子组件,内部包含多个 BrnSelectionSingleListWidget // ignore: must_be_immutable class BrnListSelectionGroupWidget extends StatefulWidget { - /// 筛选数据 final BrnSelectionEntity entity; @@ -104,7 +103,6 @@ class _BrnSelectionGroupViewState extends State { List widgetList = []; widgetList.add(_listWidget()); - // TODO 判断是否添加 Bottom if (totalLevel == 1 && widget.entity.filterType == BrnSelectionFilterType.radio) { } else { @@ -232,7 +230,7 @@ class _BrnSelectionGroupViewState extends State { begin: FractionalOffset.topCenter, end: FractionalOffset.bottomCenter, colors: [ - Colors.white.withOpacity(0), + Colors.white.withValues(alpha: 0.0), Colors.white, ], stops: [0, 1.0], diff --git a/lib/src/components/selection/widget/brn_selection_range_widget.dart b/lib/src/components/selection/widget/brn_selection_range_widget.dart index d1d8cc89..4786674a 100644 --- a/lib/src/components/selection/widget/brn_selection_range_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_range_widget.dart @@ -1,4 +1,3 @@ - import 'package:bruno/src/components/button/brn_big_main_button.dart'; import 'package:bruno/src/components/calendar/brn_calendar_view.dart'; import 'package:bruno/src/components/line/brn_line.dart'; @@ -82,7 +81,7 @@ class _BrnRangeSelectionGroupWidgetState @override void initState() { - _screenWidth = View.of(context).physicalSize.width / View.of(context).devicePixelRatio; + _screenWidth = MediaQuery.of(context).size.width; _initData(); _tabController = TabController(vsync: this, length: _firstList.length); if (_firstIndex >= 0) { @@ -216,7 +215,6 @@ class _BrnRangeSelectionGroupWidgetState List _getOneTabContent(BrnSelectionEntity filterItem) { List subFilterList = filterItem.children; - /// TODO 还要添加 Date DateRange 类型的判断。 List tagFilterList = subFilterList .where((f) => f.filterType != BrnSelectionFilterType.range && @@ -237,14 +235,10 @@ class _BrnRangeSelectionGroupWidgetState ///如果指定展示列,则按照指定列展示,否则动态计算宽度。最大不超过四列。 if (widget.rowCount == null) { - int oneCountTagWidth = - (_screenWidth - 40 - 12 * (1 - 1)) ~/ 1; - int twoCountTagWidth = - (_screenWidth - 40 - 12 * (2 - 1)) ~/ 2; - int threeCountTagWidth = - (_screenWidth - 40 - 12 * (3 - 1)) ~/ 3; - int fourCountTagWidth = - (_screenWidth - 40 - 12 * (4 - 1)) ~/ 4; + int oneCountTagWidth = (_screenWidth - 40 - 12 * (1 - 1)) ~/ 1; + int twoCountTagWidth = (_screenWidth - 40 - 12 * (2 - 1)) ~/ 2; + int threeCountTagWidth = (_screenWidth - 40 - 12 * (3 - 1)) ~/ 3; + int fourCountTagWidth = (_screenWidth - 40 - 12 * (4 - 1)) ~/ 4; if (maxWidthSize.width > twoCountTagWidth) { tagWidth = oneCountTagWidth; } else if (threeCountTagWidth < maxWidthSize.width && @@ -257,10 +251,8 @@ class _BrnRangeSelectionGroupWidgetState tagWidth = fourCountTagWidth; } } else { - tagWidth = (_screenWidth - - 40 - - 12 * (widget.rowCount! - 1)) ~/ - widget.rowCount!; + tagWidth = + (_screenWidth - 40 - 12 * (widget.rowCount! - 1)) ~/ widget.rowCount!; } var tagContainer = tagFilterList.isNotEmpty @@ -435,12 +427,15 @@ class _BrnRangeSelectionGroupWidgetState if (!rangeEntity.isValidRange()) { FocusScope.of(context).requestFocus(FocusNode()); if (rangeEntity.filterType == BrnSelectionFilterType.range) { - BrnToast.show(BrnIntl.of(context).localizedResource.enterRangeError, context); + BrnToast.show( + BrnIntl.of(context).localizedResource.enterRangeError, context); } else if (rangeEntity.filterType == BrnSelectionFilterType.dateRange || rangeEntity.filterType == BrnSelectionFilterType.dateRangeCalendar) { - BrnToast.show(BrnIntl.of(context).localizedResource.selectRangeError, context); + BrnToast.show( + BrnIntl.of(context).localizedResource.selectRangeError, + context); } return; } @@ -664,10 +659,11 @@ class _BrnRangeSelectionGroupWidgetState bool _hasCalendarItem(BrnSelectionEntity entity) { bool hasCalendarItem = false; hasCalendarItem = entity.children - .where((_) => - _.filterType == BrnSelectionFilterType.date || - _.filterType == BrnSelectionFilterType.dateRangeCalendar) - .toList().isNotEmpty; + .where((_) => + _.filterType == BrnSelectionFilterType.date || + _.filterType == BrnSelectionFilterType.dateRangeCalendar) + .toList() + .isNotEmpty; /// 查找第二层级 if (!hasCalendarItem) { diff --git a/lib/src/components/step/brn_step_line.dart b/lib/src/components/step/brn_step_line.dart index 91abb76b..bd6d419c 100644 --- a/lib/src/components/step/brn_step_line.dart +++ b/lib/src/components/step/brn_step_line.dart @@ -217,7 +217,7 @@ class _BrnStepLineState extends State { width: 12, decoration: BoxDecoration( shape: BoxShape.circle, - color: color.withOpacity(0.2), + color: color.withValues(alpha: 0.2), ), alignment: Alignment.center, child: Container( diff --git a/lib/src/components/tabbar/indicator/brn_triangle_decoration.dart b/lib/src/components/tabbar/indicator/brn_triangle_decoration.dart index b8eb2021..53bba413 100644 --- a/lib/src/components/tabbar/indicator/brn_triangle_decoration.dart +++ b/lib/src/components/tabbar/indicator/brn_triangle_decoration.dart @@ -110,10 +110,10 @@ class BrnTriangleIndicator extends Decoration { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) return false; - final BrnTriangleIndicator typedOther = other; + final BrnTriangleIndicator typedOther = other as BrnTriangleIndicator; return color == typedOther.color && lineWidth == typedOther.lineWidth && triWidth == typedOther.triWidth && diff --git a/lib/src/components/tabbar/normal/brn_tab_bar.dart b/lib/src/components/tabbar/normal/brn_tab_bar.dart index a92d3783..57e05f32 100644 --- a/lib/src/components/tabbar/normal/brn_tab_bar.dart +++ b/lib/src/components/tabbar/normal/brn_tab_bar.dart @@ -176,12 +176,6 @@ class BrnTabBarState extends State { /// 小红点高度 late double _largeSize; - /// 小红点上偏移量 - double _dy = 0; - - /// 小红点右偏移量 - double _dx = 0; - /// 展开更多的按钮宽度 final double _moreSpacing = 50; @@ -261,7 +255,7 @@ class BrnTabBarState extends State { widget.tabWidth != null || widget.isScroll; return TabBar( - tabAlignment: _isScrollable ? TabAlignment.start : TabAlignment.fill, + indicatorSize: TabBarIndicatorSize.tab, tabs: fillWidgetByDataList(_isScrollable), controller: widget.controller, isScrollable: _isScrollable, @@ -275,7 +269,6 @@ class BrnTabBarState extends State { widget.themeData!.unselectedLabelStyle.generateTextStyle(), dragStartBehavior: widget.dragStartBehavior, dividerColor: Colors.transparent, - dividerHeight: 0, onTap: (index) { if (widget.onTap != null) { widget.onTap!(this, index); @@ -383,7 +376,7 @@ class BrnTabBarState extends State { Widget _wrapOriginWidget( BadgeTab badgeTab, bool lastElement, bool isScrollable) { var _contentWidget = LayoutBuilder(builder: (context, constraints) { - caculateBadgeParams(badgeTab, constraints); + caculateBadgeParams(badgeTab); return Container( alignment: Alignment.center, height: 47, @@ -411,8 +404,7 @@ class BrnTabBarState extends State { color: Color(0xFFFFFFFF), fontSize: 10, height: 1), ), backgroundColor: Colors.red, - alignment: Alignment.topLeft, - offset: Offset(_dx,_dy), + alignment: AlignmentDirectional.topStart, padding: _badgePadding, largeSize: _largeSize, child: Text( @@ -452,7 +444,7 @@ class BrnTabBarState extends State { Widget _wrapAverageWidget( BadgeTab badgeTab, double? minWidth, bool lastElement) { return LayoutBuilder(builder: (context, constraints) { - caculateBadgeParams(badgeTab, constraints); + caculateBadgeParams(badgeTab); return Container( width: minWidth, alignment: Alignment.center, @@ -487,8 +479,7 @@ class BrnTabBarState extends State { style: TextStyle( color: Color(0xFFFFFFFF), fontSize: 10, height: 1), ), - alignment: Alignment.topLeft, - offset: Offset(_dx,_dy), + alignment: AlignmentDirectional.topStart, padding: _badgePadding, largeSize: _largeSize, child: Text(badgeTab.text!, @@ -516,9 +507,7 @@ class BrnTabBarState extends State { } /// 计算小红点尺寸相关参数 - void caculateBadgeParams(BadgeTab badgeTab, BoxConstraints constraints) { - _dy = -5.0; - + void caculateBadgeParams(BadgeTab badgeTab) { if (badgeTab.badgeNum != null) { if (badgeTab.badgeNum! < 10) { _badgePadding = EdgeInsets.only(left: 5.0, right: 5.0); @@ -542,48 +531,8 @@ class BrnTabBarState extends State { _badgePadding = EdgeInsets.only(left: 4.0, right: 4.0); _largeSize = 8.0; _badgeText = ""; - _dy = 1.0; } } - - // 获取 tabTextWidth - TextStyle tabTextStyle = - TextStyle(overflow: TextOverflow.ellipsis, fontSize: 16); - TextPainter _tabTextPainter = TextPainter( - locale: Localizations.localeOf(context), textAlign: TextAlign.center); - _tabTextPainter.textDirection = TextDirection.ltr; - _tabTextPainter.maxLines = 1; - _tabTextPainter.text = TextSpan(text: badgeTab.text, style: tabTextStyle); - _tabTextPainter.layout(maxWidth: constraints.maxWidth); - double _tabTextWidth = _tabTextPainter.width; - - // 获取 badgeTextWidth - TextStyle badgeTextStyle = TextStyle(height: 1, fontSize: 10); - TextPainter _badgeTextPainter = - TextPainter(textScaleFactor: MediaQuery.of(context).textScaleFactor); - _badgeTextPainter.textDirection = TextDirection.ltr; - _badgeTextPainter.maxLines = 1; - _badgeTextPainter.text = TextSpan(text: _badgeText, style: badgeTextStyle); - _badgeTextPainter.layout(maxWidth: constraints.maxWidth); - // 红点内 text 的宽度 - double _badgeTextWidth = _badgeTextPainter.width; - - double _badgeWidth = _badgeTextWidth + _badgePadding.horizontal; - - // 获取外部传入的tab padding值 - EdgeInsets _labelPadding = widget.labelPadding.resolve(TextDirection.ltr); - - if ((_tabTextWidth + _badgeWidth) > - (constraints.maxWidth + _labelPadding.right)) { - // 如果tab文字宽度 + 红点宽度 > 约束宽度(父容器宽度)+ 设置tab 右padding 则将红点左移 红点宽度偏移量 - // if(_badgeWidth > (constraints.maxWidth + _labelPadding.right)){ - // _paddingRight = 0.0; - // }else{ - _dx = constraints.maxWidth + _labelPadding.right - _badgeWidth; - // } - } else { - _dx = _tabTextWidth; - } } /// 展开更多 diff --git a/lib/src/components/tag/brn_state_tag.dart b/lib/src/components/tag/brn_state_tag.dart index f2bde4df..00e2e132 100644 --- a/lib/src/components/tag/brn_state_tag.dart +++ b/lib/src/components/tag/brn_state_tag.dart @@ -36,7 +36,7 @@ class BrnStateTag extends StatelessWidget { textPadding: EdgeInsets.only(bottom: 0, left: 4, right: 4, top: 0), textColor: textColor ?? getTagColor(tagState), backgroundColor: - backgroundColor ?? getTagColor(tagState).withOpacity(0.1), + backgroundColor ?? getTagColor(tagState).withValues(alpha: 0.1), ); } diff --git a/lib/src/components/tag/tagview/brn_select_tag.dart b/lib/src/components/tag/tagview/brn_select_tag.dart index e2be73ec..75c24351 100644 --- a/lib/src/components/tag/tagview/brn_select_tag.dart +++ b/lib/src/components/tag/tagview/brn_select_tag.dart @@ -200,7 +200,7 @@ class _BrnSelectTagState extends State { constraints: BoxConstraints(minWidth: widget.themeData!.tagMinWidth), decoration: BoxDecoration( color: selected - ? (widget.themeData!.selectedTagBackgroundColor.withOpacity(0.12)) + ? (widget.themeData!.selectedTagBackgroundColor.withValues(alpha: 0.12)) : (widget.themeData!.tagBackgroundColor), borderRadius: BorderRadius.circular(widget.themeData!.tagRadius)), width: widget.fixWidthMode ? widget.themeData!.tagWidth : null, diff --git a/lib/src/components/text/brn_expandable_text.dart b/lib/src/components/text/brn_expandable_text.dart index b555c67e..d30806d7 100644 --- a/lib/src/components/text/brn_expandable_text.dart +++ b/lib/src/components/text/brn_expandable_text.dart @@ -72,7 +72,8 @@ class _BrnExpandableTextState extends State { text: span, maxLines: widget.maxLines, textDirection: TextDirection.ltr, - ellipsis: 'EllipseText'); + ellipsis: 'EllipseText', + textScaler: MediaQuery.textScalerOf(context)); tp.layout(maxWidth: size.maxWidth); if (tp.didExceedMaxLines) { if (this._expanded) { @@ -141,12 +142,12 @@ class _BrnExpandableTextState extends State { ); } - Widget _expandedText(context, String text) { + Widget _expandedText(BuildContext context, String text) { return RichText( - textScaleFactor: MediaQuery.of(context).textScaleFactor, + textScaler: MediaQuery.textScalerOf(context), text: TextSpan(text: text, style: _defaultTextStyle(), children: [ - _foldButtonSpan(context), - ])); + _foldButtonSpan(context), + ])); } TextStyle _defaultTextStyle() { @@ -164,7 +165,7 @@ class _BrnExpandableTextState extends State { InlineSpan _foldButtonSpan(context) { return TextSpan( - text: ' '+ BrnIntl.of(context).localizedResource.collapse, + text: ' ' + BrnIntl.of(context).localizedResource.collapse, style: TextStyle( color: BrnThemeConfigurator.instance .getConfig() diff --git a/lib/src/l10n/brn_resources.dart b/lib/src/l10n/brn_resources.dart index 2747f588..2c458e4e 100644 --- a/lib/src/l10n/brn_resources.dart +++ b/lib/src/l10n/brn_resources.dart @@ -1,10 +1,8 @@ - import 'dart:core'; import 'dart:ui'; /// 资源抽象类 abstract class BrnBaseResource { - String get ok; String get cancel; @@ -122,7 +120,6 @@ abstract class BrnBaseResource { /// 中文资源 /// class BrnResourceZh extends BrnBaseResource { - static Locale locale = Locale('zh', 'CN'); @override @@ -143,7 +140,6 @@ class BrnResourceZh extends BrnBaseResource { @override String get enterRangeError => '您输入的区间有误'; -//// TODO @override String get pleaseChoose => '请选择'; @@ -201,20 +197,20 @@ class BrnResourceZh extends BrnBaseResource { @override String get noTagDataTip => '暂未配置可选标签数据'; - List get months =>[ - '01', - '02', - '03', - '04', - '05', - '06', - '07', - '08', - '09', - '10', - '11', - '12', - ]; + List get months => [ + '01', + '02', + '03', + '04', + '05', + '06', + '07', + '08', + '09', + '10', + '11', + '12', + ]; @override List get weekFullName => [ @@ -352,7 +348,6 @@ class BrnResourceZh extends BrnBaseResource { /// en resources /// class BrnResourceEn extends BrnBaseResource { - static Locale locale = Locale('en', 'US'); @override @@ -383,7 +378,8 @@ class BrnResourceEn extends BrnBaseResource { String get reset => 'Reset'; @override - String get confirmClearSelectedList => 'Are you sure you want to clear the selected list?'; + String get confirmClearSelectedList => + 'Are you sure you want to clear the selected list?'; @override String get selectedList => 'Selected list'; @@ -431,20 +427,20 @@ class BrnResourceEn extends BrnBaseResource { String get noTagDataTip => 'Tag data not configured yet'; @override - List get months =>[ - '01', - '02', - '03', - '04', - '05', - '06', - '07', - '08', - '09', - '10', - '11', - '12', - ]; + List get months => [ + '01', + '02', + '03', + '04', + '05', + '06', + '07', + '08', + '09', + '10', + '11', + '12', + ]; @override List get weekFullName => [ @@ -504,7 +500,8 @@ class BrnResourceEn extends BrnBaseResource { String get selected => 'Selected'; @override - String get shareWayTip => 'You can share with customers in the following ways'; + String get shareWayTip => + 'You can share with customers in the following ways'; @override String get max => 'Min'; @@ -513,7 +510,8 @@ class BrnResourceEn extends BrnBaseResource { String get min => 'Max'; @override - String get selectCountLimitTip => 'You have already selected the maximum number'; + String get selectCountLimitTip => + 'You have already selected the maximum number'; @override String get to => 'to'; @@ -525,7 +523,8 @@ class BrnResourceEn extends BrnBaseResource { String get selectCity => 'Select city'; @override - String get filterConditionCountLimited => 'You have selected the maximum number of filters'; + String get filterConditionCountLimited => + 'You have selected the maximum number of filters'; @override String get minValue => 'Min'; @@ -569,7 +568,8 @@ class BrnResourceEn extends BrnBaseResource { String get fetchErrorAndRetry => 'Fetch data fail, please try again'; @override - String get netErrorAndRetryLater => 'Network connection failed, check and try again'; + String get netErrorAndRetryLater => + 'Network connection failed, check and try again'; @override String get noSearchData => 'No search results'; diff --git a/lib/src/theme/base/brn_default_config_utils.dart b/lib/src/theme/base/brn_default_config_utils.dart index c1c69983..9367fbeb 100644 --- a/lib/src/theme/base/brn_default_config_utils.dart +++ b/lib/src/theme/base/brn_default_config_utils.dart @@ -628,7 +628,7 @@ class BrnDefaultConfigUtils { tagRadius: defaultCommonConfig.radiusSm, tagNormalBackgroundColor: defaultCommonConfig.fillBody, tagSelectedBackgroundColor: - defaultCommonConfig.brandPrimary.withOpacity(0.12), + defaultCommonConfig.brandPrimary.withValues(alpha: 0.12), rangeTitleTextStyle: BrnTextStyle( color: defaultCommonConfig.colorTextBase, fontSize: defaultCommonConfig.fontSizeSubHead, diff --git a/lib/src/theme/configs/brn_gallery_detail_config.dart b/lib/src/theme/configs/brn_gallery_detail_config.dart index 60cd9244..fad73cb6 100644 --- a/lib/src/theme/configs/brn_gallery_detail_config.dart +++ b/lib/src/theme/configs/brn_gallery_detail_config.dart @@ -75,7 +75,7 @@ class BrnGalleryDetailConfig extends BrnBaseConfig { _tabBarLabelStyle = BrnTextStyle(color: commonConfig.brandPrimary); _tabBarBackgroundColor = commonConfig.fillBody; _pageBackgroundColor = commonConfig.fillBody; - _bottomBackgroundColor = commonConfig.fillBody.withOpacity(.85); + _bottomBackgroundColor = commonConfig.fillBody.withValues(alpha: .85); _titleStyle = BrnTextStyle(color: commonConfig.colorTextBase); _contentStyle = BrnTextStyle(color: commonConfig.colorTextBase); _actionStyle = BrnTextStyle(color: commonConfig.colorTextSecondary); diff --git a/lib/src/theme/configs/brn_selection_config.dart b/lib/src/theme/configs/brn_selection_config.dart index cec3c9e8..7ca4417f 100644 --- a/lib/src/theme/configs/brn_selection_config.dart +++ b/lib/src/theme/configs/brn_selection_config.dart @@ -110,7 +110,7 @@ class BrnSelectionConfig extends BrnBaseConfig { Color? _tagNormalBackgroundColor; /// tag 选中背景色 - /// 默认为 [BrnCommonConfig.brandPrimary].withOpacity(0.12) + /// 默认为 [BrnCommonConfig.brandPrimary].withValues(alpha: 0.12) Color? _tagSelectedBackgroundColor; /// 输入选项标题文本样式 @@ -372,7 +372,7 @@ class BrnSelectionConfig extends BrnBaseConfig { _middleNormalBgColor ??= selectionConfig._middleNormalBgColor; _deepSelectBgColor ??= selectionConfig._deepSelectBgColor; _deepNormalBgColor ??= selectionConfig._deepNormalBgColor; - _tagSelectedBackgroundColor ??= commonConfig.brandPrimary.withOpacity(0.12); + _tagSelectedBackgroundColor ??= commonConfig.brandPrimary.withValues(alpha: 0.12); _tagNormalBackgroundColor ??= commonConfig.fillBody; _tagRadius ??= commonConfig.radiusSm; _flayerBoldTextStyle = selectionConfig.flayerBoldTextStyle.merge( diff --git a/lib/src/utils/css/brn_core_funtion.dart b/lib/src/utils/css/brn_core_funtion.dart index a214c913..c1e8fdec 100644 --- a/lib/src/utils/css/brn_core_funtion.dart +++ b/lib/src/utils/css/brn_core_funtion.dart @@ -9,7 +9,6 @@ typedef BrnHyperLinkCallback = void Function(String text, String? url); /// 用于将 HTML 标签转为 style class BrnConvert { - /// [cssContent] 带有html 标签文本 /// [linkCallBack] 超链接的点击回调 /// [defaultStyle] 外部传入的默认文本样式 @@ -121,7 +120,7 @@ class BrnConvert { if (stack.isNotEmpty) { tag = stack.last; } - TextSpan textSpan = _createTextSpan(xmlEvent.value, tag); + TextSpan textSpan = _createTextSpan(xmlEvent.text, tag); spans.add(textSpan); } diff --git a/pubspec.yaml b/pubspec.yaml index 94e59b8a..dbfcabae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ issue_tracker: https://github.com/LianjiaTech/bruno/issues environment: sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.7.0' + flutter: '>=3.27.0' dependencies: flutter: From a6ace20c2d9ba17852be5b7995c13a10cbbb9936 Mon Sep 17 00:00:00 2001 From: Zach Li Date: Mon, 23 Mar 2026 13:58:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/android/app/build.gradle | 24 ++--- example/android/build.gradle | 13 --- example/android/gradle.properties | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 7 +- ...ionsheet_selected_list_custom_example.dart | 4 +- .../actionsheet_selected_list_example.dart | 4 +- .../charts/line/brn_broken_line_example.dart | 38 +++---- .../components/guide/force_guide_example.dart | 4 +- .../components/guide/soft_intro_example.dart | 4 +- .../navbar/nav_bar_example_page.dart | 3 +- .../components/tabbar/brn_tab_example.dart | 4 +- .../tabbar/brn_tabbar_sticky_example.dart | 101 +++++++++--------- example/pubspec.yaml | 4 +- .../button/brn_big_ghost_button.dart | 4 +- .../button/brn_big_main_button.dart | 2 +- .../button/brn_big_outline_button.dart | 2 +- .../components/button/brn_normal_button.dart | 2 +- .../button/brn_small_outline_button.dart | 2 +- .../collection/brn_bottom_button_panel.dart | 4 +- .../calendar/brn_calendar_view.dart | 2 +- .../brn_doughnut_chart.dart | 2 +- .../brn_progress_bar_chart_painter.dart | 4 +- .../charts/broken_line/brn_broken_line.dart | 2 +- .../general/brn_title_select_input_item.dart | 2 +- .../components/guide/brn_flutter_guide.dart | 2 +- lib/src/components/navbar/brn_search_bar.dart | 8 +- .../components/picker/base/brn_picker.dart | 18 ++-- .../components/picker/brn_bottom_picker.dart | 5 +- .../brn_select_tags_with_input_picker.dart | 2 +- .../components/popup/brn_popup_window.dart | 4 +- .../widget/brn_selection_list_widget.dart | 2 +- lib/src/components/step/brn_step_line.dart | 2 +- lib/src/components/tag/brn_state_tag.dart | 2 +- .../tag/tagview/brn_select_tag.dart | 2 +- .../theme/base/brn_default_config_utils.dart | 2 +- .../configs/brn_gallery_detail_config.dart | 2 +- .../theme/configs/brn_selection_config.dart | 4 +- pubspec.yaml | 33 +++--- 39 files changed, 146 insertions(+), 186 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index fdfbc163..95fcffb3 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,7 +1,7 @@ plugins { id "com.android.application" - id "kotlin-android" + id "org.jetbrains.kotlin.android" id "dev.flutter.flutter-gradle-plugin" } @@ -15,7 +15,7 @@ if (localPropertiesFile.exists()) { def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") + throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') @@ -29,15 +29,16 @@ if (flutterVersionName == null) { } android { - compileSdkVersion flutter.compileSdkVersion + namespace "com.example.bruno" + compileSdk = flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_11.toString() } sourceSets { @@ -45,18 +46,15 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.beike.bruno" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } @@ -65,7 +63,3 @@ android { flutter { source '../..' } - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/example/android/build.gradle b/example/android/build.gradle index ba84f2c9..bc157bd1 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 4d3226ab..10b17553 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=false \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index c65f92e5..1126aa09 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 8268e0d3..8b4431b7 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -16,15 +16,12 @@ pluginManagement { gradlePluginPortal() } - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false - } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.9.1" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false } - include ':app' \ No newline at end of file diff --git a/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart b/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart index bbdfd634..a71b5714 100644 --- a/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart +++ b/example/lib/sample/components/actionsheet/actionsheet_selected_list_custom_example.dart @@ -34,8 +34,8 @@ class SelectedListActionSheetCustomExamplePageState /// 要拦截 Android 的系统返回行为,请务必自行添加以下 WillPopScope 逻辑 return PopScope( canPop: controller.isHidden, // 是否允许系统返回 - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; if (!controller.isHidden) { controller.dismiss(); // 关闭你的弹层 diff --git a/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart b/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart index 97c21f45..b8651f3a 100644 --- a/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart +++ b/example/lib/sample/components/actionsheet/actionsheet_selected_list_example.dart @@ -35,8 +35,8 @@ class SelectedListActionSheetExamplePageState /// 要拦截 Android 的系统返回行为,请务必自行添加以下 WillPopScope 逻辑 return PopScope( canPop: controller.isHidden, // 是否允许系统返回 - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; if (!controller.isHidden) { controller.dismiss(); // 关闭你的弹层 diff --git a/example/lib/sample/components/charts/line/brn_broken_line_example.dart b/example/lib/sample/components/charts/line/brn_broken_line_example.dart index b4851785..3508b5b7 100644 --- a/example/lib/sample/components/charts/line/brn_broken_line_example.dart +++ b/example/lib/sample/components/charts/line/brn_broken_line_example.dart @@ -71,8 +71,8 @@ class _BrokenLineExampleState extends State { isCurve: true, points: _linePointsForExample1(brokenData), shaderColors: [ - Colors.green.withValues(alpha: 0.3), - Colors.green.withValues(alpha: 0.01) + Colors.green.withAlpha(77), + Colors.green.withAlpha(2) ], lineColor: Colors.green, ) @@ -247,10 +247,7 @@ class _BrokenLineExampleState extends State { return '80'; })), ], - shaderColors: [ - Colors.blue.withValues(alpha: 0.3), - Colors.blue.withValues(alpha: 0.01) - ], + shaderColors: [Colors.blue.withAlpha(77), Colors.blue.withAlpha(2)], lineColor: Colors.blue, ); _pointsLine1 = BrnPointsLine( @@ -306,10 +303,7 @@ class _BrokenLineExampleState extends State { return '80'; })), ], - shaderColors: [ - Colors.green.withValues(alpha: 0.3), - Colors.green.withValues(alpha: 0.01) - ], + shaderColors: [Colors.green.withAlpha(77), Colors.green.withAlpha(2)], lineColor: Colors.green, ); @@ -353,7 +347,8 @@ class _BrokenLineExampleState extends State { BrnDialItem( dialText: '7月', dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)), - selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.amberAccent), + selectedDialTextStyle: + TextStyle(fontSize: 14.0, color: Colors.amberAccent), value: 7, ) ]; @@ -478,7 +473,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.8), + color: Colors.black.withAlpha(204), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -682,10 +677,7 @@ class _BrokenLineExampleState extends State { return '99'; })), ], - shaderColors: [ - Colors.green.withValues(alpha: 0.3), - Colors.green.withValues(alpha: 0.01) - ], + shaderColors: [Colors.green.withAlpha(77), Colors.green.withAlpha(2)], lineColor: Colors.green, ); @@ -835,7 +827,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.8), + color: Colors.black.withAlpha(204), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -1038,10 +1030,7 @@ class _BrokenLineExampleState extends State { return '99'; })), ], - shaderColors: [ - Colors.green.withValues(alpha: 0.3), - Colors.green.withValues(alpha: 0.01) - ], + shaderColors: [Colors.green.withAlpha(77), Colors.green.withAlpha(2)], lineColor: Colors.green, ); @@ -1235,7 +1224,7 @@ class _BrokenLineExampleState extends State { color: Colors.white), )), decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.8), + color: Colors.black.withAlpha(204), borderRadius: BorderRadius.circular(2.0), boxShadow: [ BoxShadow( @@ -1437,10 +1426,7 @@ class _BrokenLineExampleState extends State { return '99'; })), ], - shaderColors: [ - Colors.green.withValues(alpha: 0.3), - Colors.green.withValues(alpha: 0.01) - ], + shaderColors: [Colors.green.withAlpha(77), Colors.green.withAlpha(2)], lineColor: Colors.green, ); diff --git a/example/lib/sample/components/guide/force_guide_example.dart b/example/lib/sample/components/guide/force_guide_example.dart index 8c526a77..d173e0d5 100644 --- a/example/lib/sample/components/guide/force_guide_example.dart +++ b/example/lib/sample/components/guide/force_guide_example.dart @@ -55,8 +55,8 @@ class _ForceGuideExampleState extends State { Widget build(BuildContext context) { return PopScope( canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; intro.dispose(); }, diff --git a/example/lib/sample/components/guide/soft_intro_example.dart b/example/lib/sample/components/guide/soft_intro_example.dart index 19f5399e..ff972645 100644 --- a/example/lib/sample/components/guide/soft_intro_example.dart +++ b/example/lib/sample/components/guide/soft_intro_example.dart @@ -55,8 +55,8 @@ class _SoftGuideExampleState extends State { Widget build(BuildContext context) { return PopScope( canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; intro.dispose(); }, diff --git a/example/lib/sample/components/navbar/nav_bar_example_page.dart b/example/lib/sample/components/navbar/nav_bar_example_page.dart index 14e83207..7cb1727f 100644 --- a/example/lib/sample/components/navbar/nav_bar_example_page.dart +++ b/example/lib/sample/components/navbar/nav_bar_example_page.dart @@ -327,8 +327,7 @@ class _NavBarPageState extends State with TickerProviderStateMixin { height: 17, padding: EdgeInsets.only(left: 3, right: 3), margin: EdgeInsets.only(left: 6), - decoration: BoxDecoration( - color: Color(0xff8E8E8E).withValues(alpha: 0.15)), + decoration: BoxDecoration(color: Color(0xff8E8E8E).withAlpha(38)), child: Center( child: Text( '住宅', diff --git a/example/lib/sample/components/tabbar/brn_tab_example.dart b/example/lib/sample/components/tabbar/brn_tab_example.dart index 2b6df363..e88318f2 100644 --- a/example/lib/sample/components/tabbar/brn_tab_example.dart +++ b/example/lib/sample/components/tabbar/brn_tab_example.dart @@ -23,8 +23,8 @@ class _BrnTabExampleState extends State Widget build(BuildContext context) { return PopScope( canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; closeWindowController!.closeMoreWindow(); }, diff --git a/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart b/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart index 5bb9849c..164c9b56 100644 --- a/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart +++ b/example/lib/sample/components/tabbar/brn_tabbar_sticky_example.dart @@ -36,61 +36,60 @@ class _BrnTabbarStickyExampleState extends State @override Widget build(BuildContext context) { return PopScope( - canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + canPop: false, + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; - closeWindowController!.closeMoreWindow(); - }, - child: Scaffold( - appBar: BrnAppBar( - title: 'TabBar Sticky 效果', - ), - body: NestedScrollView( - controller: scrollController, - headerSliverBuilder: - (BuildContext context, bool innerBoxIsScrolled) { - return [ - buildHeaderWidget(), - SliverOverlapAbsorber( - handle: - NestedScrollView.sliverOverlapAbsorberHandleFor(context), - sliver: SliverPersistentHeader( - pinned: true, - delegate: StickyTabBarDelegate( - child: BrnTabBar( - controller: tabController, - tabs: tabs, - showMore: true, - moreWindowText: "Tabs描述", - onTap: (state, index) { - state.refreshBadgeState(index); - scrollController.animateTo( - globalKey.currentContext!.size!.height, - duration: Duration(milliseconds: 200), - curve: Curves.linear); - }, - onMorePop: () {}, - closeController: closeWindowController, - )), - ), + closeWindowController!.closeMoreWindow(); + }, + child: Scaffold( + appBar: BrnAppBar( + title: 'TabBar Sticky 效果', + ), + body: NestedScrollView( + controller: scrollController, + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { + return [ + buildHeaderWidget(), + SliverOverlapAbsorber( + handle: + NestedScrollView.sliverOverlapAbsorberHandleFor(context), + sliver: SliverPersistentHeader( + pinned: true, + delegate: StickyTabBarDelegate( + child: BrnTabBar( + controller: tabController, + tabs: tabs, + showMore: true, + moreWindowText: "Tabs描述", + onTap: (state, index) { + state.refreshBadgeState(index); + scrollController.animateTo( + globalKey.currentContext!.size!.height, + duration: Duration(milliseconds: 200), + curve: Curves.linear); + }, + onMorePop: () {}, + closeController: closeWindowController, + )), ), - ]; - }, - body: TabBarView( - controller: this.tabController, - children: [ - Center(child: Text('业务一')), - Center(child: Text('业务二')), - Center(child: Text('业务三')), - Center(child: Text('业务四')), - Center(child: Text('业务五')), - Center(child: Text('业务六')), - ], - ), + ), + ]; + }, + body: TabBarView( + controller: this.tabController, + children: [ + Center(child: Text('业务一')), + Center(child: Text('业务二')), + Center(child: Text('业务三')), + Center(child: Text('业务四')), + Center(child: Text('业务五')), + Center(child: Text('业务六')), + ], ), ), - ); + ), + ); } Widget buildHeaderWidget() { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ee05c097..1375a102 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: flutter_easyrefresh: ^2.2.1 lpinyin: ^2.0.3 badges: ^2.0.2 - intl: 0.19.0 + intl: 0.20.2 dev_dependencies: flutter_test: @@ -36,7 +36,7 @@ dev_dependencies: dependency_overrides: bruno: path: ../ - intl: 0.19.0 + intl: 0.20.2 # For information on the generic Dart part of this file, see the diff --git a/lib/src/components/button/brn_big_ghost_button.dart b/lib/src/components/button/brn_big_ghost_button.dart index fb9fe41a..ce7e8e62 100644 --- a/lib/src/components/button/brn_big_ghost_button.dart +++ b/lib/src/components/button/brn_big_ghost_button.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; /// 页面中和主题色相关的幽灵按钮 可以支持自定义背景颜色、文字颜色等 /// -/// 和[BrnBigMainButton]相比,该按钮的背景色仅仅是其背景色的withValues(alpha: 0.1) +/// 和[BrnBigMainButton]相比,该按钮的背景色仅仅是其背景色的withAlpha(13) /// 并且该按钮不支持不可用状态 /// /// 按钮是圆角矩形的形状,不支持改变形状。 @@ -63,7 +63,7 @@ class BrnBigGhostButton extends StatelessWidget { width: width ?? double.infinity, height: defaultThemeConfig.bigButtonHeight), backgroundColor: bgColor ?? - defaultThemeConfig.commonConfig.brandPrimary.withValues(alpha: 0.05), + defaultThemeConfig.commonConfig.brandPrimary.withAlpha(13), onTap: onTap, alignment: Alignment.center, text: title ?? BrnIntl.of(context).localizedResource.confirm, diff --git a/lib/src/components/button/brn_big_main_button.dart b/lib/src/components/button/brn_big_main_button.dart index 6e01faca..0ed24aed 100644 --- a/lib/src/components/button/brn_big_main_button.dart +++ b/lib/src/components/button/brn_big_main_button.dart @@ -79,7 +79,7 @@ class BrnBigMainButton extends StatelessWidget { onTap: onTap, textColor: Colors.white, disableTextColor: - defaultThemeConfig.commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), + defaultThemeConfig.commonConfig.colorTextBaseInverse.withAlpha(178), ); } } diff --git a/lib/src/components/button/brn_big_outline_button.dart b/lib/src/components/button/brn_big_outline_button.dart index 444057e5..0fd0a832 100644 --- a/lib/src/components/button/brn_big_outline_button.dart +++ b/lib/src/components/button/brn_big_outline_button.dart @@ -91,7 +91,7 @@ class BrnBigOutlineButton extends StatelessWidget { height: defaultThemeConfig.bigButtonHeight), onTap: onTap, backgroundColor: Colors.white, - disableBackgroundColor: Color(0xffcccccc).withValues(alpha: 0.1), + disableBackgroundColor: Color(0xffcccccc).withAlpha(26), ); } } diff --git a/lib/src/components/button/brn_normal_button.dart b/lib/src/components/button/brn_normal_button.dart index 69dbf9ca..a72c074a 100644 --- a/lib/src/components/button/brn_normal_button.dart +++ b/lib/src/components/button/brn_normal_button.dart @@ -208,7 +208,7 @@ class BrnNormalButton extends StatelessWidget { if (isEnable) { textColor = this.textColor; } else { - textColor = this.disableTextColor ?? (this.textColor).withValues(alpha: 0.7); + textColor = this.disableTextColor ?? (this.textColor).withAlpha(178); } return TextStyle( diff --git a/lib/src/components/button/brn_small_outline_button.dart b/lib/src/components/button/brn_small_outline_button.dart index 549db402..f189da40 100644 --- a/lib/src/components/button/brn_small_outline_button.dart +++ b/lib/src/components/button/brn_small_outline_button.dart @@ -129,7 +129,7 @@ class BrnSmallOutlineButton extends StatelessWidget { fontSize: defaultThemeConfig.smallButtonFontSize, onTap: onTap, backgroundColor: Colors.white, - disableBackgroundColor: Color(0xffcccccc).withValues(alpha: 0.1), + disableBackgroundColor: Color(0xffcccccc).withAlpha(26), ); }, ); 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 3cc7f5b5..1bd0485a 100644 --- a/lib/src/components/button/collection/brn_bottom_button_panel.dart +++ b/lib/src/components/button/collection/brn_bottom_button_panel.dart @@ -227,7 +227,7 @@ class BrnBottomButtonPanel extends StatelessWidget { ? Colors.white : BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), + .commonConfig.colorTextBaseInverse.withAlpha(178), ), ), )), @@ -268,7 +268,7 @@ class BrnBottomButtonPanel extends StatelessWidget { ? Colors.white : BrnThemeConfigurator.instance .getConfig() - .commonConfig.colorTextBaseInverse.withValues(alpha: 0.7), + .commonConfig.colorTextBaseInverse.withAlpha(178), ), ), )), diff --git a/lib/src/components/calendar/brn_calendar_view.dart b/lib/src/components/calendar/brn_calendar_view.dart index c4b251df..dde04684 100644 --- a/lib/src/components/calendar/brn_calendar_view.dart +++ b/lib/src/components/calendar/brn_calendar_view.dart @@ -372,7 +372,7 @@ class _CustomCalendarViewState extends State { .getConfig() .commonConfig .brandPrimary - .withValues(alpha: 0.14) + .withAlpha(36) : Colors.transparent) : Colors.transparent, // 范围选择两端圆角 diff --git a/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart b/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart index 717c9b93..63b9ab7e 100644 --- a/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart +++ b/lib/src/components/charts/brn_doughunt_chart/brn_doughnut_chart.dart @@ -184,7 +184,7 @@ class BrnDoughnut extends CustomPainter { height: textHeight + this.textVerticalPadding * 2); RRect rRect = RRect.fromRectAndRadius(baseRect, Radius.circular(2)); Paint textBackgroundPaint = Paint() - ..color = Colors.black.withValues(alpha: 0.7); + ..color = Colors.black.withAlpha(178); canvas.drawRRect(rRect, textBackgroundPaint); textPainter.paint( diff --git a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart index 06a524b7..3ca80492 100644 --- a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart +++ b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart @@ -429,7 +429,7 @@ class BrnProgressBarChartPainter extends CustomPainter { // 坐标刻度虚线 _drawDashLineOn(canvas, Offset(currentOffset.dx, currentOffset.dy), - Offset(currentOffset.dx, 0), Colors.black.withValues(alpha: 0.09)); + Offset(currentOffset.dx, 0), Colors.black.withAlpha(23)); // 坐标文本 AxisItem axisItem = this.xAxis.axisItemList[xAxisItemIndex]; @@ -557,7 +557,7 @@ class BrnProgressBarChartPainter extends CustomPainter { yAxisItemOffset, Offset(yAxisItemOffset.dx + this.contentRect.width, yAxisItemOffset.dy), - Colors.black.withValues(alpha: 0.09)); + Colors.black.withAlpha(23)); } } } diff --git a/lib/src/components/charts/broken_line/brn_broken_line.dart b/lib/src/components/charts/broken_line/brn_broken_line.dart index c727948f..dde2e01a 100644 --- a/lib/src/components/charts/broken_line/brn_broken_line.dart +++ b/lib/src/components/charts/broken_line/brn_broken_line.dart @@ -264,7 +264,7 @@ class BrnBrokenLineState extends State { borderRadius: BorderRadius.circular(3.0), boxShadow: [ BoxShadow( - color: Colors.black.withValues(alpha: 0.6), + color: Colors.black.withAlpha(153), offset: Offset(0.0, 2.0), //阴影xy轴偏移量 blurRadius: 4.0, //阴影模糊程度 ) diff --git a/lib/src/components/form/items/general/brn_title_select_input_item.dart b/lib/src/components/form/items/general/brn_title_select_input_item.dart index 9414c2fa..780518dd 100644 --- a/lib/src/components/form/items/general/brn_title_select_input_item.dart +++ b/lib/src/components/form/items/general/brn_title_select_input_item.dart @@ -373,7 +373,7 @@ class _TitleSelectPopWidgetState extends State { BoxShadow( blurRadius: 2, //阴影范围 spreadRadius: 1, //阴影浓度 - color: Colors.white.withValues(alpha: 0.08), //阴影颜色 + color: Colors.white.withAlpha(20), //阴影颜色 ), ], color: Colors.white, diff --git a/lib/src/components/guide/brn_flutter_guide.dart b/lib/src/components/guide/brn_flutter_guide.dart index 89d0c464..b265c6be 100644 --- a/lib/src/components/guide/brn_flutter_guide.dart +++ b/lib/src/components/guide/brn_flutter_guide.dart @@ -40,7 +40,7 @@ class BrnGuide { late Widget _stepWidget; List _configMap = []; List _globalKeys = []; - final Color _maskColor = Colors.black.withValues(alpha: .6); + final Color _maskColor = Colors.black.withAlpha(153); final Duration _animationDuration = Duration(milliseconds: 300); final _th = _Throttling(duration: Duration(milliseconds: 500)); late Size _lastScreenSize; diff --git a/lib/src/components/navbar/brn_search_bar.dart b/lib/src/components/navbar/brn_search_bar.dart index c1c91574..78726299 100644 --- a/lib/src/components/navbar/brn_search_bar.dart +++ b/lib/src/components/navbar/brn_search_bar.dart @@ -208,12 +208,12 @@ class __SearchInputWidgetState extends State<_SearchInputWidget> { valueNotifier = ValueNotifier(false); _focusNode.addListener(_handleFocusChangeListenerTick); if (widget.themeData?.systemOverlayStyle.statusBarBrightness == Brightness.dark) { - _defaultDividerColor = Colors.white.withValues(alpha: 0.2); - _defaultHintTextColor = Colors.white.withValues(alpha: 0.4); + _defaultDividerColor = Colors.white.withAlpha(51); + _defaultHintTextColor = Colors.white.withAlpha(102); _defaultInputTextColor = Colors.white; _defaultCancelTextColor = Colors.white; - _defaultClearIconColor = Colors.white.withValues(alpha: 0.4); - } else { + _defaultClearIconColor = Colors.white.withAlpha(102); + } else { _defaultDividerColor = BrnThemeConfigurator.instance .getConfig() .commonConfig diff --git a/lib/src/components/picker/base/brn_picker.dart b/lib/src/components/picker/base/brn_picker.dart index 822a56c7..fb1266a4 100644 --- a/lib/src/components/picker/base/brn_picker.dart +++ b/lib/src/components/picker/base/brn_picker.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - - import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; @@ -22,8 +20,12 @@ const double _kSqueeze = 1; /// lens with the same color as the background. const double _kForegroundScreenOpacityFraction = 0.4; -/// Alpha channel as 0–255 from [Color.a]. -int _alphaByte(Color color) => (color.a * 255.0).round() & 0xff; +/// Alpha channel as 0–255. +/// +/// Uses integer `alpha` for compatibility with older Flutter where float `.a` +/// is not available. +int alphaByte(Color color) => + color.alpha & 0xff; // ignore: deprecated_member_use /// An iOS-styled picker. /// @@ -237,7 +239,7 @@ class _CupertinoPickerState extends State { // have to just do a color blend. And a due to the way we are layering // the magnifier and the gradient on the background, using a transparent // background color makes the picker look odd. - if (_alphaByte(widget.backgroundColor) < 255) return Container(); + if (alphaByte(widget.backgroundColor) < 255) return Container(); final Color widgetBackgroundColor = widget.backgroundColor; return Positioned.fill( @@ -278,7 +280,7 @@ class _CupertinoPickerState extends State { /// the lens and partially grayed out around it. Widget _buildMagnifierScreen() { final Color foreground = widget.backgroundColor.withAlpha( - (_alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) + (alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) .toInt()); return IgnorePointer( @@ -316,7 +318,7 @@ class _CupertinoPickerState extends State { Widget _buildUnderMagnifierScreen() { final Color foreground = widget.backgroundColor.withAlpha( - (_alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) + (alphaByte(widget.backgroundColor) * _kForegroundScreenOpacityFraction) .toInt()); return Column( @@ -373,7 +375,7 @@ class _CupertinoPickerState extends State { ); // Adds the appropriate opacity under the magnifier if the background // color is transparent. - if (_alphaByte(widget.backgroundColor) < 255) { + if (alphaByte(widget.backgroundColor) < 255) { result = Stack( children: [ _buildUnderMagnifierScreen(), diff --git a/lib/src/components/picker/brn_bottom_picker.dart b/lib/src/components/picker/brn_bottom_picker.dart index 925e9cbe..77dc3e7e 100644 --- a/lib/src/components/picker/brn_bottom_picker.dart +++ b/lib/src/components/picker/brn_bottom_picker.dart @@ -117,9 +117,8 @@ class BrnBottomPickerWidgetState extends State Widget build(BuildContext context) { return PopScope( canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; - + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; _controller.reverse(); }, child: Scaffold( diff --git a/lib/src/components/picker/brn_select_tags_with_input_picker.dart b/lib/src/components/picker/brn_select_tags_with_input_picker.dart index a5f32822..d0410b7e 100644 --- a/lib/src/components/picker/brn_select_tags_with_input_picker.dart +++ b/lib/src/components/picker/brn_select_tags_with_input_picker.dart @@ -311,7 +311,7 @@ class _BrnSelectTagsWithInputPickerWidgetState .getConfig() .commonConfig .brandPrimary - .withValues(alpha: 0.14); + .withAlpha(36); return Container( color: Colors.white, diff --git a/lib/src/components/popup/brn_popup_window.dart b/lib/src/components/popup/brn_popup_window.dart index 25759f7d..e390765c 100644 --- a/lib/src/components/popup/brn_popup_window.dart +++ b/lib/src/components/popup/brn_popup_window.dart @@ -247,8 +247,8 @@ class _BrnPopupWindowState extends State { excluding: true, child: PopScope( canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop || result == true) return; + onPopInvokedWithResult: (didPop, _) { + if (didPop) return; Navigator.pop(context); }, diff --git a/lib/src/components/selection/widget/brn_selection_list_widget.dart b/lib/src/components/selection/widget/brn_selection_list_widget.dart index aa296390..566cf0f7 100644 --- a/lib/src/components/selection/widget/brn_selection_list_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_list_widget.dart @@ -230,7 +230,7 @@ class _BrnSelectionGroupViewState extends State { begin: FractionalOffset.topCenter, end: FractionalOffset.bottomCenter, colors: [ - Colors.white.withValues(alpha: 0.0), + Colors.white.withAlpha(0), Colors.white, ], stops: [0, 1.0], diff --git a/lib/src/components/step/brn_step_line.dart b/lib/src/components/step/brn_step_line.dart index bd6d419c..3677b828 100644 --- a/lib/src/components/step/brn_step_line.dart +++ b/lib/src/components/step/brn_step_line.dart @@ -217,7 +217,7 @@ class _BrnStepLineState extends State { width: 12, decoration: BoxDecoration( shape: BoxShape.circle, - color: color.withValues(alpha: 0.2), + color: color.withAlpha(51), ), alignment: Alignment.center, child: Container( diff --git a/lib/src/components/tag/brn_state_tag.dart b/lib/src/components/tag/brn_state_tag.dart index 00e2e132..7b3ffda5 100644 --- a/lib/src/components/tag/brn_state_tag.dart +++ b/lib/src/components/tag/brn_state_tag.dart @@ -36,7 +36,7 @@ class BrnStateTag extends StatelessWidget { textPadding: EdgeInsets.only(bottom: 0, left: 4, right: 4, top: 0), textColor: textColor ?? getTagColor(tagState), backgroundColor: - backgroundColor ?? getTagColor(tagState).withValues(alpha: 0.1), + backgroundColor ?? getTagColor(tagState).withAlpha(26), ); } diff --git a/lib/src/components/tag/tagview/brn_select_tag.dart b/lib/src/components/tag/tagview/brn_select_tag.dart index 75c24351..baedeeee 100644 --- a/lib/src/components/tag/tagview/brn_select_tag.dart +++ b/lib/src/components/tag/tagview/brn_select_tag.dart @@ -200,7 +200,7 @@ class _BrnSelectTagState extends State { constraints: BoxConstraints(minWidth: widget.themeData!.tagMinWidth), decoration: BoxDecoration( color: selected - ? (widget.themeData!.selectedTagBackgroundColor.withValues(alpha: 0.12)) + ? (widget.themeData!.selectedTagBackgroundColor.withAlpha(30)) : (widget.themeData!.tagBackgroundColor), borderRadius: BorderRadius.circular(widget.themeData!.tagRadius)), width: widget.fixWidthMode ? widget.themeData!.tagWidth : null, diff --git a/lib/src/theme/base/brn_default_config_utils.dart b/lib/src/theme/base/brn_default_config_utils.dart index 9367fbeb..e59862ff 100644 --- a/lib/src/theme/base/brn_default_config_utils.dart +++ b/lib/src/theme/base/brn_default_config_utils.dart @@ -628,7 +628,7 @@ class BrnDefaultConfigUtils { tagRadius: defaultCommonConfig.radiusSm, tagNormalBackgroundColor: defaultCommonConfig.fillBody, tagSelectedBackgroundColor: - defaultCommonConfig.brandPrimary.withValues(alpha: 0.12), + defaultCommonConfig.brandPrimary.withAlpha(30), rangeTitleTextStyle: BrnTextStyle( color: defaultCommonConfig.colorTextBase, fontSize: defaultCommonConfig.fontSizeSubHead, diff --git a/lib/src/theme/configs/brn_gallery_detail_config.dart b/lib/src/theme/configs/brn_gallery_detail_config.dart index fad73cb6..de06d837 100644 --- a/lib/src/theme/configs/brn_gallery_detail_config.dart +++ b/lib/src/theme/configs/brn_gallery_detail_config.dart @@ -75,7 +75,7 @@ class BrnGalleryDetailConfig extends BrnBaseConfig { _tabBarLabelStyle = BrnTextStyle(color: commonConfig.brandPrimary); _tabBarBackgroundColor = commonConfig.fillBody; _pageBackgroundColor = commonConfig.fillBody; - _bottomBackgroundColor = commonConfig.fillBody.withValues(alpha: .85); + _bottomBackgroundColor = commonConfig.fillBody.withAlpha(216); _titleStyle = BrnTextStyle(color: commonConfig.colorTextBase); _contentStyle = BrnTextStyle(color: commonConfig.colorTextBase); _actionStyle = BrnTextStyle(color: commonConfig.colorTextSecondary); diff --git a/lib/src/theme/configs/brn_selection_config.dart b/lib/src/theme/configs/brn_selection_config.dart index 7ca4417f..28b9d27f 100644 --- a/lib/src/theme/configs/brn_selection_config.dart +++ b/lib/src/theme/configs/brn_selection_config.dart @@ -110,7 +110,7 @@ class BrnSelectionConfig extends BrnBaseConfig { Color? _tagNormalBackgroundColor; /// tag 选中背景色 - /// 默认为 [BrnCommonConfig.brandPrimary].withValues(alpha: 0.12) + /// 默认为 [BrnCommonConfig.brandPrimary].withAlpha(30) Color? _tagSelectedBackgroundColor; /// 输入选项标题文本样式 @@ -372,7 +372,7 @@ class BrnSelectionConfig extends BrnBaseConfig { _middleNormalBgColor ??= selectionConfig._middleNormalBgColor; _deepSelectBgColor ??= selectionConfig._deepSelectBgColor; _deepNormalBgColor ??= selectionConfig._deepNormalBgColor; - _tagSelectedBackgroundColor ??= commonConfig.brandPrimary.withValues(alpha: 0.12); + _tagSelectedBackgroundColor ??= commonConfig.brandPrimary.withAlpha(30); _tagNormalBackgroundColor ??= commonConfig.fillBody; _tagRadius ??= commonConfig.radiusSm; _flayerBoldTextStyle = selectionConfig.flayerBoldTextStyle.merge( diff --git a/pubspec.yaml b/pubspec.yaml index dbfcabae..9fe1f594 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,13 @@ name: bruno description: An enterprise-class package of Flutter components for mobile applications. -version: 3.4.3 +version: 4.0.0 homepage: https://bruno.ke.com/ repository: https://github.com/LianjiaTech/bruno issue_tracker: https://github.com/LianjiaTech/bruno/issues environment: - sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.27.0' + sdk: ">=2.17.0 <4.0.0" + flutter: ">=3.27.0" dependencies: flutter: @@ -16,7 +16,7 @@ dependencies: lpinyin: ^2.0.3 path_drawing: ^1.0.0 flutter_easyrefresh: ^2.2.1 - intl: ^0.18.0 + intl: ^0.20.2 photo_view: ^0.14.0 bindings_compatible: ^1.0.1 @@ -25,14 +25,11 @@ dev_dependencies: sdk: flutter lints: ^1.0.1 - - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - # To add assets to your package, add an assets section, like this: assets: - assets/images/ @@ -58,15 +55,15 @@ flutter: # list giving the asset and other descriptors for the font. For # example: fonts: - - family: Bebas - fonts: - - asset: assets/fonts/Bebas-Regular.ttf + - family: Bebas + fonts: + - asset: assets/fonts/Bebas-Regular.ttf # weight: 700 - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages