Skip to content

Commit 4f13d07

Browse files
committed
路由动画
2 parents b801827 + dd57f96 commit 4f13d07

File tree

73 files changed

+2936
-648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2936
-648
lines changed

assets/iconfont/toly_icon.ttf

868 Bytes
Binary file not shown.

ios/Podfile.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
PODS:
2+
- connectivity_plus (0.0.1):
3+
- Flutter
4+
- ReachabilitySwift
25
- DKImagePickerController/Core (4.3.4):
36
- DKImagePickerController/ImageDataManager
47
- DKImagePickerController/Resource
@@ -43,6 +46,7 @@ PODS:
4346
- Flutter
4447
- r_upgrade (0.0.1):
4548
- Flutter
49+
- ReachabilitySwift (5.0.0)
4650
- SDWebImage (5.15.4):
4751
- SDWebImage/Core (= 5.15.4)
4852
- SDWebImage/Core (5.15.4)
@@ -56,8 +60,11 @@ PODS:
5660
- SwiftyGif (5.4.4)
5761
- url_launcher_ios (0.0.1):
5862
- Flutter
63+
- webview_flutter_wkwebview (0.0.1):
64+
- Flutter
5965

6066
DEPENDENCIES:
67+
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
6168
- file_picker (from `.symlinks/plugins/file_picker/ios`)
6269
- Flutter (from `Flutter`)
6370
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
@@ -67,16 +74,20 @@ DEPENDENCIES:
6774
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
6875
- sqflite (from `.symlinks/plugins/sqflite/ios`)
6976
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
77+
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
7078

7179
SPEC REPOS:
7280
trunk:
7381
- DKImagePickerController
7482
- DKPhotoGallery
7583
- FMDB
84+
- ReachabilitySwift
7685
- SDWebImage
7786
- SwiftyGif
7887

7988
EXTERNAL SOURCES:
89+
connectivity_plus:
90+
:path: ".symlinks/plugins/connectivity_plus/ios"
8091
file_picker:
8192
:path: ".symlinks/plugins/file_picker/ios"
8293
Flutter:
@@ -95,8 +106,11 @@ EXTERNAL SOURCES:
95106
:path: ".symlinks/plugins/sqflite/ios"
96107
url_launcher_ios:
97108
:path: ".symlinks/plugins/url_launcher_ios/ios"
109+
webview_flutter_wkwebview:
110+
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
98111

99112
SPEC CHECKSUMS:
113+
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
100114
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
101115
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
102116
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
@@ -105,12 +119,14 @@ SPEC CHECKSUMS:
105119
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
106120
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
107121
r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114
122+
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
108123
SDWebImage: 1c39de67663e5eebb2f41324d5d580eeea12dd4c
109124
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
110125
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
111126
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
112127
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
113128
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
129+
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
114130

115131
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
116132

lib/app/navigation/pure_bottom_bar.dart

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
33

44
typedef IndexTapCallback = void Function(int);
55
typedef IndexLongTapCallback = void Function(BuildContext, int);
6+
67
class PureBottomBar extends StatefulWidget {
78
final int initPosition;
89

@@ -11,33 +12,36 @@ class PureBottomBar extends StatefulWidget {
1112

1213
// item 长按事件
1314
final IndexLongTapCallback? onItemLongTap;
14-
const PureBottomBar({Key? key, this.onItemTap,this.onItemLongTap,this.initPosition=0}) : super(key: key);
15+
const PureBottomBar(
16+
{Key? key, this.onItemTap, this.onItemLongTap, this.initPosition = 0})
17+
: super(key: key);
1518

1619
@override
1720
State<PureBottomBar> createState() => _PureBottomBarState();
1821
}
1922

2023
class _PureBottomBarState extends State<PureBottomBar> {
21-
List<String> get bottomBar => const['组件','绘制', '收藏','我的'];
24+
List<String> get bottomBar => const ['组件', '绘制',
25+
// '宝具',
26+
'收藏', '我的'];
2227

23-
List<IconData> get bottomBarIcon => const[
24-
TolyIcon.icon_layout,
25-
TolyIcon.dingzhi1,
28+
List<IconData> get bottomBarIcon => const [
29+
TolyIcon.icon_layout,
30+
TolyIcon.dingzhi1,
31+
// TolyIcon.icon_artifact,
2632
TolyIcon.icon_collect,
27-
TolyIcon.yonghu,
28-
];
33+
TolyIcon.yonghu,
34+
];
2935
int _position = 0;
3036

3137
@override
3238
void initState() {
3339
super.initState();
3440
_position = widget.initPosition;
35-
3641
}
3742

3843
@override
3944
Widget build(BuildContext context) {
40-
4145
return Wrap(
4246
children: [
4347
// Divider(height: 1,),
@@ -49,7 +53,6 @@ class _PureBottomBarState extends State<PureBottomBar> {
4953

5054
widget.onItemTap?.call(_position);
5155
setState(() {
52-
5356
// _controller.jumpToPage(_position);
5457
});
5558
},
@@ -64,7 +67,12 @@ class _PureBottomBarState extends State<PureBottomBar> {
6467
showUnselectedLabels: true,
6568
showSelectedLabels: true,
6669
// backgroundColor: themeColor.itemColor,
67-
items: bottomBar.asMap().keys.map((index) => BottomNavigationBarItem(label: bottomBar[index], icon: Icon(bottomBarIcon[index]))).toList(),
70+
items: bottomBar
71+
.asMap()
72+
.keys
73+
.map((index) => BottomNavigationBarItem(
74+
label: bottomBar[index], icon: Icon(bottomBarIcon[index])))
75+
.toList(),
6876
),
6977
],
7078
);

lib/app/navigation/unit_navigation.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:io';
22

33
import 'package:app/app.dart';
44
import 'package:app_update/app_update.dart';
5+
import 'package:artifact/artifact.dart';
56
import 'package:authentication/authentication.dart';
67
import 'package:flutter/material.dart';
78
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -11,6 +12,7 @@ import 'package:flutter_unit/widget_ui/mobile/category_page/home_right_drawer.da
1112
import 'package:widget_module/blocs/blocs.dart';
1213
import 'package:flutter_unit/widget_ui/mobile/widget_panel/standard_home_page.dart';
1314

15+
1416
import 'pure_bottom_bar.dart';
1517
import 'desk_ui/unit_desk_navigation.dart';
1618

@@ -53,8 +55,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
5355
void initState() {
5456
super.initState();
5557
if (Platform.isAndroid||Platform.isIOS) {
56-
BlocProvider.of<UpdateBloc>(context)
57-
.add(const CheckUpdate(appName: 'FlutterUnit'));
58+
BlocProvider.of<UpdateBloc>(context).add(const CheckUpdate(appName: 'FlutterUnit'));
5859
}
5960
}
6061

@@ -76,6 +77,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
7677
children: [
7778
StandardHomePage(),
7879
GalleryUnit(),
80+
// ArtifactPage(),
7981
CollectPageAdapter(),
8082
UserPage(),
8183
],
@@ -114,7 +116,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
114116
}
115117
}
116118

117-
if (index == 2) {
119+
if (index == 3) {
118120
BlocProvider.of<LikeWidgetBloc>(context).add(const EventLoadLikeData());
119121
}
120122
}
@@ -124,7 +126,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
124126
if (index == 0) {
125127
Scaffold.of(context).openDrawer();
126128
}
127-
if (index == 3) {
129+
if (index == 4) {
128130
Scaffold.of(context).openEndDrawer();
129131
}
130132
}

lib/app/router/unit_router.dart

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class UnitRouters {
6464
//
6565
case UnitRouter.nav:
6666
if(Platform.isWindows||Platform.isMacOS||Platform.isLinux){
67-
return NoAnimRouter(child: UnitNavigation());
67+
return NoAnimRouter(UnitNavigation());
6868
}
6969
return Left2RightRouter(child: UnitNavigation());
7070

@@ -81,56 +81,58 @@ class UnitRouters {
8181
);
8282
}
8383

84-
return Right2LeftRouter(
84+
return SlidePageRouter(
8585
child: child);
8686

8787
// case search:
8888
// return Right2LeftRouter(child: const SearchPageProvider());
8989
case collect:
90-
return Right2LeftRouter(child: CollectPageAdapter(
90+
return SlidePageRouter(child: CollectPageAdapter(
9191
canPop: settings.arguments as bool,
9292
));
9393

9494
case setting:
95-
return Right2LeftRouter(child: const SettingPage());
95+
return SlidePageRouter(child: const SettingPage());
96+
// return Right2LeftRouter(builder:(_)=> const SettingPage());
97+
// return MaterialPageRoute(builder:(_)=> const SettingPage());
9698
case data_manage:
97-
return Right2LeftRouter(child: const DataManagePage());
99+
return SlidePageRouter(child: const DataManagePage());
98100
case font_setting:
99-
return Right2LeftRouter(child: const FontSettingPage());
101+
return SlidePageRouter(child: const FontSettingPage());
100102
case theme_color_setting:
101-
return Right2LeftRouter(child: const ThemeColorSettingPage());
103+
return SlidePageRouter(child: const ThemeColorSettingPage());
102104
case code_style_setting:
103-
return Right2LeftRouter(child: const CodeStyleSettingPage());
105+
return SlidePageRouter(child: const CodeStyleSettingPage());
104106
// case item_style_setting:
105107
// return Right2LeftRouter(child: const ItemStyleSettingPage());
106108

107109
case version_info:
108-
return Right2LeftRouter(child: const VersionInfo());
110+
return SlidePageRouter(child: const VersionInfo());
109111

110112
case issues_point:
111-
return Right2LeftRouter(child: const IssuesPointScope());
113+
return SlidePageRouter(child: const IssuesPointScope());
112114
case login:
113-
return Right2LeftRouter(child: const LoginPage());
115+
return SlidePageRouter(child: const LoginPage());
114116

115117
case register:
116-
return Right2LeftRouter(child: const RegisterPage());
118+
return SlidePageRouter(child: const RegisterPage());
117119

118120
case attr:
119-
return Right2LeftRouter(child: const AttrUnitPage());
121+
return SlidePageRouter(child: const AttrUnitPage());
120122
case bug:
121-
return Right2LeftRouter(child: const BugUnitPage());
123+
return SlidePageRouter(child: const BugUnitPage());
122124
case layout:
123-
return Right2LeftRouter(child: const LayoutUnitPage());
125+
return SlidePageRouter(child: const LayoutUnitPage());
124126
case about_app:
125-
return Right2LeftRouter(child: const AboutAppPage());
127+
return SlidePageRouter(child: const AboutAppPage());
126128
case about_me:
127-
return Right2LeftRouter(child: const AboutMePage());
129+
return SlidePageRouter(child: const AboutMePage());
128130

129131
case point_detail:
130-
return Right2LeftRouter(child: const IssuesDetailPage());
132+
return SlidePageRouter(child: const IssuesDetailPage());
131133

132134
case category_show:
133-
return Right2LeftRouter(
135+
return SlidePageRouter(
134136
child: CategoryShow(
135137
model: settings.arguments as CategoryModel,
136138
));

lib/app/views/about/about_app_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AboutAppPage extends StatelessWidget {
3939
left: 50,
4040
child: FeedbackWidget(
4141
onEnd : (){
42-
Navigator.push(context, Right2LeftRouter(child: const FlutterUnitTimeLine()));
42+
Navigator.push(context, SlidePageRouter(child: const FlutterUnitTimeLine()));
4343
},
4444
child: CircleImage(
4545
size: 100,

lib/app/views/setting/setting_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SettingPage extends StatelessWidget {
3535
),
3636
trailing: _nextIcon(context),
3737
onTap: (){
38-
Navigator.of(context).push(Right2LeftRouter(child: ThemeModelSetting()));
38+
Navigator.of(context).push(SlidePageRouter(child: ThemeModelSetting()));
3939
},
4040
),
4141
divider,

lib/app/views/splash/standard_unit_splash.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class _StandardUnitSplashState extends State<StandardUnitSplash>
5858
child: Material(
5959
child: BlocListener<AppBloc, AppState>(
6060
listener: _listenStart,
61+
listenWhen: (p,n)=>p.dbPath.isEmpty&&n.dbPath.isNotEmpty,
6162
child: Column(
6263
children: [
6364
const Spacer(),

lib/code_gen/icon_font_gen/gen_message_action.dart

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import 'package:app/app.dart';
22
import 'package:flutter/material.dart';
33

4-
5-
64
class GenMessageAction extends StatelessWidget {
75
final VoidCallback onGen;
86
const GenMessageAction({Key? key, required this.onGen}) : super(key: key);
@@ -12,21 +10,29 @@ class GenMessageAction extends StatelessWidget {
1210
return Row(
1311
crossAxisAlignment: CrossAxisAlignment.start,
1412
children: [
15-
Expanded(child: Text(
13+
Expanded(
14+
child: Text(
1615
'使用方式:\n1. 在 iconfont.cn 挑选图标,加入项目,下载压缩包。\n2. 选择 Flutter 项目地址,配置资源、产物文件位置。\n3. 点击生成代码按钮,即可生成相关代码。',
1716
style: TextStyle(
18-
color: Theme.of(context).primaryColor,fontWeight: FontWeight.bold),)),
17+
color: Theme.of(context).primaryColor,
18+
fontWeight: FontWeight.bold),
19+
)),
1920
ElevatedButton(
2021
style: ElevatedButton.styleFrom(
21-
elevation: 0,
22-
shape: const StadiumBorder()
23-
),
24-
onPressed:onGen, child: Wrap(
25-
crossAxisAlignment: WrapCrossAlignment.center,
26-
spacing: 4,
22+
elevation: 0, shape: const StadiumBorder()),
23+
onPressed: onGen,
24+
child: Wrap(
25+
crossAxisAlignment: WrapCrossAlignment.center,
26+
spacing: 4,
2727
children: [
28-
Icon(TolyIcon.icon_fast,size: 16,),
29-
const Text('生成代码',style: TextStyle(height: 1,fontSize: 12),),
28+
Icon(
29+
TolyIcon.icon_fast,
30+
size: 16,
31+
),
32+
const Text(
33+
'生成代码',
34+
style: TextStyle(height: 1.1, fontSize: 12),
35+
),
3036
],
3137
)),
3238
],

0 commit comments

Comments
 (0)