From 994b2c0a1eb548a4a8690448ecf8768f72ae43f0 Mon Sep 17 00:00:00 2001 From: toly <1981462002@qq.com> Date: Wed, 27 Jan 2021 13:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- .../project/default/empty_shower.dart | 2 +- .../project/default/loading_shower.dart | 4 ++++ lib/views/pages/splash/unit_splash.dart | 21 +++++++++---------- .../widget_detail/category_end_drawer.dart | 7 +++---- lib/views/pages/widget_home/background.dart | 10 ++++----- lib/views/pages/widget_home/home_drawer.dart | 2 +- lib/views/pages/widget_home/home_page.dart | 4 ++-- 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index ad5d2e5..3f4af6f 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ |------|------------|------|------------| | Android版 | http://toly1994.com/file/FlutterUnit.apk |[flutter_unit](https://github.com/toly1994328/FlutterUnit)| [《FlutterUnit食用指南》](https://juejin.im/post/6844904147045597191)| | iOS版 | 暂未提供,可自己下载项目运行 |[flutter_unit](https://github.com/toly1994328/FlutterUnit)| [《FlutterUnit 食用指南》](https://juejin.im/post/6844904147045597191)| -| MacOS版 | http://toly1994.com/file/flutter_unit_mac.zip |[flutter_unit_mac](https://github.com/toly1994328/FlutterUnit/tree/flutter_unit_mac)| [《mac版闪亮登场》](https://juejin.im/post/6844904147817332743)| -| Windows版 |http://toly1994.com/file/FlutterUnitWin.zip | [flutter_unit_windows](https://github.com/toly1994328/FlutterUnit/tree/flutter_unit_windows) | [《win版闪亮登场》](https://juejin.im/post/6847902222626488327)| +| MacOS版 | http://toly1994.com/file/flutter_unit_mac.zip |[flutter_unit_desk](https://github.com/toly1994328/FlutterUnit/tree/flutter_unit_desk)| [《mac版闪亮登场》](https://juejin.im/post/6844904147817332743)| +| Windows版 |http://toly1994.com/file/FlutterUnitWin.zip | [flutter_unit_desk](https://github.com/toly1994328/FlutterUnit/tree/flutter_unit_desk) | [《win版闪亮登场》](https://juejin.im/post/6847902222626488327)| | Web版 | http://toly1994328.gitee.io/flutter_web | [ flutter_unit_web ](https://github.com/toly1994328/FlutterUnit/tree/flutter_unit_web) | [《web版闪亮登场》](https://juejin.im/post/6859888713980182541)| --- diff --git a/lib/views/components/project/default/empty_shower.dart b/lib/views/components/project/default/empty_shower.dart index faace4c..8dcc0b0 100644 --- a/lib/views/components/project/default/empty_shower.dart +++ b/lib/views/components/project/default/empty_shower.dart @@ -8,7 +8,7 @@ import 'package:flutter_unit/app/res/style_unit.dart'; class EmptyShower extends StatelessWidget { final String message; - EmptyShower({Key key, this.message = "数据为空"}) : super(key: key); + const EmptyShower({Key key, this.message = "数据为空"}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/views/components/project/default/loading_shower.dart b/lib/views/components/project/default/loading_shower.dart index f92326f..530eec1 100644 --- a/lib/views/components/project/default/loading_shower.dart +++ b/lib/views/components/project/default/loading_shower.dart @@ -8,6 +8,8 @@ import 'package:flutter_unit/views/components/permanent/loading/planet_loading.d /// 说明: 默认 加载视图 class LoadingShower extends StatelessWidget { + const LoadingShower({Key key}) : super(key: key); + @override Widget build(BuildContext context) { @@ -27,4 +29,6 @@ class LoadingShower extends StatelessWidget { ), ); } + + } diff --git a/lib/views/pages/splash/unit_splash.dart b/lib/views/pages/splash/unit_splash.dart index e5d768b..b15f3b7 100644 --- a/lib/views/pages/splash/unit_splash.dart +++ b/lib/views/pages/splash/unit_splash.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -20,7 +19,6 @@ class UnitSplash extends StatefulWidget { class _UnitSplashState extends State with TickerProviderStateMixin { AnimationController _controller; - // double _factor; Animation _curveAnim; bool _animEnd = false; @@ -29,15 +27,17 @@ class _UnitSplashState extends State with TickerProviderStateMixin { void initState() { super.initState(); - SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent); + SystemUiOverlayStyle systemUiOverlayStyle = + SystemUiOverlayStyle(statusBarColor: Colors.transparent); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); - _controller = - AnimationController(duration: Duration(milliseconds: 1000), vsync: this) - ..addStatusListener(_listenStatus)..forward(); - - _curveAnim = CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn); + _controller = AnimationController( + duration: const Duration(milliseconds: 1000), vsync: this) + ..addStatusListener(_listenStatus) + ..forward(); + _curveAnim = + CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn); } @override @@ -46,12 +46,11 @@ class _UnitSplashState extends State with TickerProviderStateMixin { super.dispose(); } - void _listenStatus(AnimationStatus status) { if (status == AnimationStatus.completed) { setState(() { _animEnd = true; - Future.delayed(Duration(milliseconds: 500)).then((e) { + Future.delayed(const Duration(milliseconds: 500)).then((e) { Navigator.of(context).pushReplacementNamed(UnitRouter.nav); }); }); @@ -125,7 +124,7 @@ class _UnitSplashState extends State with TickerProviderStateMixin { opacity: _controller, child: Container( height: 120, - child: FlutterLogo( + child: const FlutterLogo( size: 60, ), )), diff --git a/lib/views/pages/widget_detail/category_end_drawer.dart b/lib/views/pages/widget_detail/category_end_drawer.dart index e337bec..84a43b2 100644 --- a/lib/views/pages/widget_detail/category_end_drawer.dart +++ b/lib/views/pages/widget_detail/category_end_drawer.dart @@ -13,7 +13,6 @@ import 'package:flutter_unit/views/components/project/unit_drawer_header.dart'; /// contact me by email 1981462002@qq.com /// 说明: - class CategoryEndDrawer extends StatelessWidget { final WidgetModel widget; @@ -32,7 +31,7 @@ class CategoryEndDrawer extends StatelessWidget { Circle( color: widget.color, ), - SizedBox( + const SizedBox( width: 10, ), Text(widget.name) @@ -64,8 +63,8 @@ class CategoryEndDrawer extends StatelessWidget { color: Theme.of(context).primaryColor, radius: 5, ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), child: Text( '当前组件收藏情况', style: TextStyle(fontSize: 16, shadows: [ diff --git a/lib/views/pages/widget_home/background.dart b/lib/views/pages/widget_home/background.dart index e0a4940..1038539 100644 --- a/lib/views/pages/widget_home/background.dart +++ b/lib/views/pages/widget_home/background.dart @@ -6,13 +6,13 @@ class BackgroundShower extends StatelessWidget { return Opacity( opacity: 0.05, child: Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( image: DecorationImage( - image: const AssetImage('assets/images/sabar.webp'), + image: AssetImage('assets/images/sabar.webp'), fit: BoxFit.cover), - borderRadius: const BorderRadius.only( - bottomRight: const Radius.circular(400), - topLeft: const Radius.circular(400))), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(400), + topLeft: Radius.circular(400))), ), ); } diff --git a/lib/views/pages/widget_home/home_drawer.dart b/lib/views/pages/widget_home/home_drawer.dart index f7f669a..33fabc7 100644 --- a/lib/views/pages/widget_home/home_drawer.dart +++ b/lib/views/pages/widget_home/home_drawer.dart @@ -51,7 +51,7 @@ class HomeDrawer extends StatelessWidget { Icons.extension, color: Theme.of(context).primaryColor, ), - title: Text('Flutter 集录'), + title: const Text('Flutter 集录'), children: [ _buildItem(context, TolyIcon.icon_tag, '属性集录', UnitRouter.attr), _buildItem(context, Icons.palette, '绘画集录', UnitRouter.galley), diff --git a/lib/views/pages/widget_home/home_page.dart b/lib/views/pages/widget_home/home_page.dart index 8f42590..79bbb28 100644 --- a/lib/views/pages/widget_home/home_page.dart +++ b/lib/views/pages/widget_home/home_page.dart @@ -82,7 +82,7 @@ class _HomePageState extends State Widget _buildContent(WidgetsState state) { if (state is WidgetsLoading) { - return SliverFillRemaining( + return const SliverFillRemaining( child: LoadingShower(), ); } @@ -90,7 +90,7 @@ class _HomePageState extends State if (state is WidgetsLoaded) { List items = state.widgets; if (items.isEmpty) - return SliverFillRemaining( + return const SliverFillRemaining( child: EmptyShower( message: "没数据,哥也没办法\n(≡ _ ≡)/~┴┴", ),