From 66e75c1605ebc188727d166ccb45036519cfddcb Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 23 Mar 2021 13:56:49 +0800 Subject: [PATCH] update navigationBar --- .fvm/fvm_config.json | 2 +- .../comment_message/comment_message_page.dart | 2 +- lib/pages/splash/splash_page.dart | 2 - lib/pages/tab_navigator.dart | 42 ++--- lib/widget/tab_bar/bee_tab_bar.dart | 2 - pubspec.lock | 165 +++++++++--------- pubspec.yaml | 18 +- 7 files changed, 113 insertions(+), 120 deletions(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 89718076..309af34c 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,3 +1,3 @@ { - "flutterSdkVersion": "1.22.6" + "flutterSdkVersion": "2.0.0" } \ No newline at end of file diff --git a/lib/pages/message_center_page/comment_message/comment_message_page.dart b/lib/pages/message_center_page/comment_message/comment_message_page.dart index 9321927f..cc50ec7c 100644 --- a/lib/pages/message_center_page/comment_message/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message/comment_message_page.dart @@ -62,7 +62,7 @@ class _CommentMessagePageState extends State { Column( children: [ model.createName.text.black.size(36.sp).make(), - (model.respondentName.isEmptyOrNull + ((model.respondentName?.isEmptyOrNull ?? true) ? model.content : '回复了${model.respondentName}:${model.content}') .text diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index 96ce4c3e..a1c4b0c9 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:amap_location_fluttify/amap_location_fluttify.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; @@ -16,7 +15,6 @@ import 'package:akuCommunity/provider/app_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/utils/developer_util.dart'; import 'package:akuCommunity/utils/hive_store.dart'; -import 'package:akuCommunity/utils/weather/weather_util.dart'; //TODO splashPage class SplashPage extends StatefulWidget { diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 872fbf2f..e249a5c1 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -17,8 +17,9 @@ class TabNavigator extends StatefulWidget { _TabNavigatorState createState() => _TabNavigatorState(); } -class _TabNavigatorState extends State { - PageController _pageController = PageController(); +class _TabNavigatorState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; int _currentIndex = 0; DateTime _lastPressed; @@ -37,6 +38,8 @@ class _TabNavigatorState extends State { CommunityPage(), PersonalIndex() ]; + + _tabController = TabController(length: _pages.length, vsync: this); } _buildBottomBar( @@ -87,27 +90,24 @@ class _TabNavigatorState extends State { //否则关闭app return true; }, - child: PageView.builder( - itemBuilder: (context, index) => _pages[index], - itemCount: _pages.length, - controller: _pageController, - // physics: NeverScrollableScrollPhysics(), - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, + child: TabBarView( + children: _pages, + controller: _tabController, + physics: NeverScrollableScrollPhysics(), ), ), - bottomNavigationBar: BottomNavigationBar( - items: _bottomNav, - currentIndex: _currentIndex, - selectedFontSize: 20.sp, - unselectedFontSize: 20.sp, - onTap: (index) { - _pageController.jumpToPage(index); - }, - ), + bottomNavigationBar: StatefulBuilder(builder: (context, setFunc) { + return BottomNavigationBar( + items: _bottomNav, + currentIndex: _currentIndex, + selectedFontSize: 20.sp, + unselectedFontSize: 20.sp, + onTap: (index) { + _tabController.animateTo(index, curve: Curves.easeInOutCubic); + setFunc(() => _currentIndex = index); + }, + ); + }), ); } } diff --git a/lib/widget/tab_bar/bee_tab_bar.dart b/lib/widget/tab_bar/bee_tab_bar.dart index c5130b40..b583b29a 100644 --- a/lib/widget/tab_bar/bee_tab_bar.dart +++ b/lib/widget/tab_bar/bee_tab_bar.dart @@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:akuCommunity/base/base_style.dart'; - class BeeTabBar extends StatefulWidget with PreferredSizeWidget { final TabController controller; final List tabs; diff --git a/pubspec.lock b/pubspec.lock index 740cb288..a47b2a14 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,7 +49,7 @@ packages: name: animator url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "3.0.0" ansicolor: dependency: transitive description: @@ -63,7 +63,7 @@ packages: name: archive url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.13" + version: "3.1.2" args: dependency: transitive description: @@ -77,7 +77,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.5.0" auto_size_text: dependency: transitive description: @@ -85,6 +85,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" + auto_size_text_pk: + dependency: transitive + description: + name: auto_size_text_pk + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" badges: dependency: "direct main" description: @@ -98,7 +105,7 @@ packages: name: boolean_selector url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" bot_toast: dependency: "direct main" description: @@ -119,14 +126,14 @@ packages: name: characters url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" chewie: dependency: transitive description: @@ -140,7 +147,7 @@ packages: name: chewie_audio url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.1.2" cli_util: dependency: transitive description: @@ -154,14 +161,14 @@ packages: name: clock url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.flutter-io.cn" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" colorize: dependency: transitive description: @@ -203,7 +210,7 @@ packages: name: crypto url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "3.0.0" css_colors: dependency: transitive description: @@ -260,20 +267,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.0.10" - extended_image: - dependency: "direct main" - description: - name: extended_image - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.9.0" - extended_image_library: - dependency: transitive - description: - name: extended_image_library - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.2.3" extended_list_library: dependency: transitive description: @@ -287,35 +280,35 @@ packages: name: extended_text url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.0" + version: "5.0.4" extended_text_library: dependency: transitive description: name: extended_text_library url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.3" + version: "5.0.2" fake_async: dependency: transitive description: name: fake_async url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.3" + version: "1.0.0" file: dependency: transitive description: name: file url: "https://pub.flutter-io.cn" source: hosted - version: "5.2.1" + version: "6.1.0" flui: dependency: "direct main" description: @@ -362,7 +355,7 @@ packages: name: flutter_cache_manager url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" flutter_datetime_picker: dependency: "direct main" description: @@ -390,7 +383,7 @@ packages: name: flutter_html url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.3.0" flutter_icons: dependency: "direct main" description: @@ -404,7 +397,7 @@ packages: name: flutter_layout_grid url: "https://pub.flutter-io.cn" source: hosted - version: "0.10.3" + version: "0.10.5" flutter_localizations: dependency: "direct main" description: flutter @@ -465,7 +458,7 @@ packages: name: flutter_svg url: "https://pub.flutter-io.cn" source: hosted - version: "0.19.1" + version: "0.20.0-nullsafety.3" flutter_swiper: dependency: "direct main" description: @@ -538,14 +531,14 @@ packages: name: hive url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.4+1" + version: "2.0.0" hive_flutter: dependency: "direct main" description: name: hive_flutter url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.1" + version: "1.0.0" html: dependency: transitive description: @@ -560,13 +553,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.12.2" - http_client_helper: - dependency: transitive - description: - name: http_client_helper - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.2.1" http_parser: dependency: transitive description: @@ -580,7 +566,7 @@ packages: name: image url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.19" + version: "3.0.2" image_picker: dependency: "direct main" description: @@ -622,7 +608,7 @@ packages: name: intl url: "https://pub.flutter-io.cn" source: hosted - version: "0.16.1" + version: "0.17.0" io: dependency: transitive description: @@ -633,9 +619,11 @@ packages: jpush_flutter: dependency: "direct main" description: - name: jpush_flutter - url: "https://pub.flutter-io.cn" - source: hosted + path: "." + ref: HEAD + resolved-ref: c713c4be12073302b6f1b5c7a71199046a3ee47c + url: "http://159.75.73.143:8080/third_packages/jpush_flutter" + source: git version: "0.6.3" js: dependency: transitive @@ -643,7 +631,7 @@ packages: name: js url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: transitive description: @@ -678,14 +666,14 @@ packages: name: matcher url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" nested: dependency: transitive description: @@ -706,7 +694,7 @@ packages: name: node_io url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.1.1" octo_image: dependency: transitive description: @@ -734,56 +722,56 @@ packages: name: path url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.1+1" + version: "0.5.0-nullsafety.0" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.4" + version: "0.2.0-nullsafety.0" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.flutter-io.cn" source: hosted - version: "1.6.27" + version: "2.0.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.4+8" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.4" + version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.4+3" + version: "2.0.0" pedantic: dependency: transitive description: @@ -811,7 +799,7 @@ packages: name: petitparser url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "4.0.2" photo_view: dependency: "direct main" description: @@ -825,7 +813,7 @@ packages: name: platform url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.1" + version: "3.0.0" plugin_platform_interface: dependency: transitive description: @@ -853,7 +841,7 @@ packages: name: process url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.13" + version: "4.1.1" provider: dependency: "direct main" description: @@ -874,7 +862,7 @@ packages: name: pull_to_refresh url: "https://pub.flutter-io.cn" source: hosted - version: "1.6.2" + version: "1.6.4" qr: dependency: transitive description: @@ -932,42 +920,42 @@ packages: name: shared_preferences url: "https://pub.flutter-io.cn" source: hosted - version: "0.5.12+4" + version: "2.0.5" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.flutter-io.cn" source: hosted - version: "0.0.2+2" + version: "2.0.0" shimmer: dependency: "direct main" description: @@ -993,7 +981,7 @@ packages: name: source_span url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0" sp_util: dependency: transitive description: @@ -1021,28 +1009,28 @@ packages: name: stack_trace url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" states_rebuilder: dependency: transitive description: name: states_rebuilder url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "4.0.0+1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" synchronized: dependency: transitive description: @@ -1056,14 +1044,14 @@ packages: name: term_glyph url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.2.19" transformer_page_view: dependency: transitive description: @@ -1077,7 +1065,7 @@ packages: name: typed_data url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: @@ -1119,7 +1107,7 @@ packages: name: uuid url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.2" + version: "3.0.2" validate: dependency: transitive description: @@ -1133,14 +1121,14 @@ packages: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" velocity_x: dependency: "direct main" description: name: velocity_x url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.1" + version: "2.6.0" video_player: dependency: transitive description: @@ -1162,6 +1150,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.1.4+1" + vxstate: + dependency: transitive + description: + name: vxstate + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" wakelock: dependency: transitive description: @@ -1210,21 +1205,21 @@ packages: name: win32 url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.4" + version: "2.0.4" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.flutter-io.cn" source: hosted - version: "4.5.1" + version: "5.0.2" yaml: dependency: transitive description: @@ -1233,5 +1228,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <2.11.0" - flutter: ">=1.22.2 <2.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 02afd784..c5da6dfd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: # 版本信息 package_info: ^0.4.1 #上拉加载 - pull_to_refresh: 1.6.2 + pull_to_refresh: ^1.6.4 # 状态管理 flutter_redux: ^0.5.3 provider: ^4.1.3 @@ -36,8 +36,7 @@ dependencies: common_utils: # icons flutter_icons: 1.1.0 - extended_image: 0.9.0 - extended_text: 4.1.0 + extended_text: ^5.0.4 #轮播图 flutter_swiper: ^1.1.6 #路由 @@ -75,13 +74,13 @@ dependencies: amap_location_fluttify: 0.18.0 #用户存储路径 - path_provider: ^1.6.18 + path_provider: ^2.0.1 fluwx: ^2.5.0+1 get: - velocity_x: ^1.3.1 - hive: - hive_flutter: + velocity_x: ^2.6.0 + hive: ^2.0.0 + hive_flutter: ^1.0.0 logger: ^0.9.4 flutter_easyrefresh: ^2.1.8 random_character: @@ -91,7 +90,10 @@ dependencies: image_picker: ^0.6.7+21 power_logger: ^0.1.3 flutter_rating_bar: ^3.2.0+1 - jpush_flutter: ^0.6.3 + jpush_flutter: + git: + url: http://159.75.73.143:8080/third_packages/jpush_flutter + badges: ^1.1.6 dev_dependencies: