Showing
8 changed files
with
149 additions
and
53 deletions
assets/images/membership/membership_bg.png
0 → 100644

747 KB
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | +import 'package:one_poem/membership/membership_router.dart'; | ||
2 | import 'package:one_poem/poem/poem_router.dart'; | 3 | import 'package:one_poem/poem/poem_router.dart'; |
3 | import 'package:one_poem/routers/fluro_navigator.dart'; | 4 | import 'package:one_poem/routers/fluro_navigator.dart'; |
4 | import 'package:one_poem/setting/setting_router.dart'; | 5 | import 'package:one_poem/setting/setting_router.dart'; |
... | @@ -36,17 +37,15 @@ class _AccountPageState extends State<AccountPage> { | ... | @@ -36,17 +37,15 @@ class _AccountPageState extends State<AccountPage> { |
36 | child: Row( | 37 | child: Row( |
37 | crossAxisAlignment: CrossAxisAlignment.start, | 38 | crossAxisAlignment: CrossAxisAlignment.start, |
38 | mainAxisAlignment: MainAxisAlignment.end, | 39 | mainAxisAlignment: MainAxisAlignment.end, |
39 | - children: const <Widget>[ | 40 | + children: <Widget>[ |
40 | Tapped( | 41 | Tapped( |
41 | - child: _MembershipButton( | 42 | + onTap: () { |
43 | + NavigatorUtils.push(context, MembershipRouter.membershipPage); | ||
44 | + }, | ||
45 | + child: const _MembershipButton( | ||
42 | title: '会员中心', | 46 | title: '会员中心', |
43 | ), | 47 | ), |
44 | ), | 48 | ), |
45 | - Tapped( | ||
46 | - child: _UserRightButton( | ||
47 | - title: '钱包', | ||
48 | - ), | ||
49 | - ), | ||
50 | ], | 49 | ], |
51 | ), | 50 | ), |
52 | ); | 51 | ); |
... | @@ -93,11 +92,11 @@ class _AccountPageState extends State<AccountPage> { | ... | @@ -93,11 +92,11 @@ class _AccountPageState extends State<AccountPage> { |
93 | child: GestureDetector( | 92 | child: GestureDetector( |
94 | child: CircleAvatar( | 93 | child: CircleAvatar( |
95 | backgroundColor: Colors.red.withOpacity(0.4), | 94 | backgroundColor: Colors.red.withOpacity(0.4), |
96 | - radius: 14.0, | 95 | + radius: 14.px, |
97 | - child: const Icon( | 96 | + child: Icon( |
98 | Icons.edit, | 97 | Icons.edit, |
99 | color: Colors.white, | 98 | color: Colors.white, |
100 | - size: 16.0, | 99 | + size: 16.px, |
101 | ), | 100 | ), |
102 | ), | 101 | ), |
103 | onTap: () { | 102 | onTap: () { |
... | @@ -239,10 +238,10 @@ class _MembershipButton extends StatelessWidget { | ... | @@ -239,10 +238,10 @@ class _MembershipButton extends StatelessWidget { |
239 | alignment: Alignment.center, | 238 | alignment: Alignment.center, |
240 | child: Text( | 239 | child: Text( |
241 | title, | 240 | title, |
242 | - style: TextStyle(color: ColorPlate.red.withOpacity(0.4)), | 241 | + style: const TextStyle(color: ColorPlate.orange), |
243 | ), | 242 | ), |
244 | decoration: BoxDecoration( | 243 | decoration: BoxDecoration( |
245 | - border: Border.all(color: ColorPlate.red.withOpacity(.4)), | 244 | + border: Border.all(color: ColorPlate.orange), |
246 | borderRadius: BorderRadius.circular(4.px), | 245 | borderRadius: BorderRadius.circular(4.px), |
247 | ), | 246 | ), |
248 | ); | 247 | ); | ... | ... |
... | @@ -40,8 +40,9 @@ class _SplashPageState extends State<SplashPage> { | ... | @@ -40,8 +40,9 @@ class _SplashPageState extends State<SplashPage> { |
40 | /// 预先缓存图片,避免直接使用时因为首次加载造成闪动 | 40 | /// 预先缓存图片,避免直接使用时因为首次加载造成闪动 |
41 | void _precacheImage(String image) { | 41 | void _precacheImage(String image) { |
42 | precacheImage( | 42 | precacheImage( |
43 | - ImageUtils.getAssetImage(image, format: ImageFormat.png), | 43 | + ImageUtils.getAssetImage(image, format: ImageFormat.png), |
44 | - context); | 44 | + context, |
45 | + ); | ||
45 | } | 46 | } |
46 | 47 | ||
47 | _guideList.forEach(_precacheImage); | 48 | _guideList.forEach(_precacheImage); |
... | @@ -95,33 +96,35 @@ class _SplashPageState extends State<SplashPage> { | ... | @@ -95,33 +96,35 @@ class _SplashPageState extends State<SplashPage> { |
95 | Widget build(BuildContext context) { | 96 | Widget build(BuildContext context) { |
96 | HYSizeFit.initialize(context); | 97 | HYSizeFit.initialize(context); |
97 | return Material( | 98 | return Material( |
98 | - color: context.backgroundColor, | 99 | + color: context.backgroundColor, |
99 | - child: _status == 0 | 100 | + child: _status == 0 |
100 | - ? const FractionallyAlignedSizedBox( | 101 | + ? const FractionallyAlignedSizedBox( |
101 | - heightFactor: 0.3, | 102 | + heightFactor: 0.3, |
102 | - widthFactor: 0.33, | 103 | + widthFactor: 0.33, |
103 | - leftFactor: 0.33, | 104 | + leftFactor: 0.33, |
104 | - bottomFactor: 0, | 105 | + bottomFactor: 0, |
105 | - child: LoadAssetImage('logo')) | 106 | + child: LoadAssetImage('logo'), |
106 | - : Swiper( | 107 | + ) |
107 | - key: const Key('swiper'), | 108 | + : Swiper( |
108 | - itemCount: _guideList.length, | 109 | + key: const Key('swiper'), |
109 | - loop: false, | 110 | + itemCount: _guideList.length, |
110 | - itemBuilder: (_, index) { | 111 | + loop: false, |
111 | - return LoadAssetImage( | 112 | + itemBuilder: (_, index) { |
112 | - _guideList[index], | 113 | + return LoadAssetImage( |
113 | - key: Key(_guideList[index]), | 114 | + _guideList[index], |
114 | - fit: BoxFit.cover, | 115 | + key: Key(_guideList[index]), |
115 | - width: double.infinity, | 116 | + fit: BoxFit.cover, |
116 | - height: double.infinity, | 117 | + width: double.infinity, |
117 | - format: ImageFormat.png, | 118 | + height: double.infinity, |
118 | - ); | 119 | + format: ImageFormat.png, |
119 | - }, | 120 | + ); |
120 | - onTap: (index) { | 121 | + }, |
121 | - if (index == _guideList.length - 1) { | 122 | + onTap: (index) { |
122 | - _goLogin(); | 123 | + if (index == _guideList.length - 1) { |
123 | - } | 124 | + _goLogin(); |
124 | - }, | 125 | + } |
125 | - )); | 126 | + }, |
127 | + ), | ||
128 | + ); | ||
126 | } | 129 | } |
127 | } | 130 | } | ... | ... |
lib/membership/membership_router.dart
0 → 100644
1 | +import 'package:fluro/fluro.dart'; | ||
2 | +import 'package:one_poem/routers/i_router.dart'; | ||
3 | + | ||
4 | +import 'page/membership_page.dart'; | ||
5 | + | ||
6 | +class MembershipRouter implements IRouterProvider { | ||
7 | + static String membershipPage = '/membership'; | ||
8 | + | ||
9 | + @override | ||
10 | + void initRouter(FluroRouter router) { | ||
11 | + router.define( | ||
12 | + membershipPage, | ||
13 | + handler: Handler( | ||
14 | + handlerFunc: (_, __) => const MembershipPage(), | ||
15 | + ), | ||
16 | + ); | ||
17 | + } | ||
18 | +} |
lib/membership/page/membership_page.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | +import 'package:one_poem/routers/fluro_navigator.dart'; | ||
3 | +import 'package:one_poem/extension/int_extension.dart'; | ||
4 | + | ||
5 | +class MembershipPage extends StatefulWidget { | ||
6 | + const MembershipPage({Key? key}) : super(key: key); | ||
7 | + | ||
8 | + @override | ||
9 | + _MembershipPageState createState() => _MembershipPageState(); | ||
10 | +} | ||
11 | + | ||
12 | +class _MembershipPageState extends State<MembershipPage> | ||
13 | + with WidgetsBindingObserver { | ||
14 | + @override | ||
15 | + void initState() { | ||
16 | + super.initState(); | ||
17 | + } | ||
18 | + | ||
19 | + @override | ||
20 | + Widget build(BuildContext context) { | ||
21 | + return SafeArea( | ||
22 | + child: Scaffold( | ||
23 | + backgroundColor: Colors.black, | ||
24 | + body: Container( | ||
25 | + alignment: Alignment.topCenter, | ||
26 | + decoration: const BoxDecoration( | ||
27 | + image: DecorationImage( | ||
28 | + image: AssetImage("assets/images/membership/membership_bg.png"), | ||
29 | + fit: BoxFit.fill, | ||
30 | + ), | ||
31 | + ), | ||
32 | + child: Column( | ||
33 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
34 | + children: [ | ||
35 | + Container( | ||
36 | + alignment: Alignment.centerLeft, | ||
37 | + child: IconButton( | ||
38 | + onPressed: () { | ||
39 | + NavigatorUtils.goBack(context); | ||
40 | + }, | ||
41 | + icon: const Icon( | ||
42 | + Icons.arrow_back_ios, | ||
43 | + color: Colors.white, | ||
44 | + ), | ||
45 | + ), | ||
46 | + ), | ||
47 | + const Text( | ||
48 | + "这是会员页面", | ||
49 | + style: TextStyle( | ||
50 | + color: Colors.white, | ||
51 | + ), | ||
52 | + ), | ||
53 | + ], | ||
54 | + ), | ||
55 | + ), | ||
56 | + ), | ||
57 | + ); | ||
58 | + } | ||
59 | + | ||
60 | + @override | ||
61 | + void didChangeAppLifecycleState(AppLifecycleState state) {} | ||
62 | + | ||
63 | + @override | ||
64 | + void dispose() { | ||
65 | + super.dispose(); | ||
66 | + } | ||
67 | +} |
... | @@ -90,7 +90,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> { | ... | @@ -90,7 +90,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> { |
90 | decoration: BoxDecoration( | 90 | decoration: BoxDecoration( |
91 | color: Colors.grey.shade200.withOpacity(0.1), | 91 | color: Colors.grey.shade200.withOpacity(0.1), |
92 | border: Border.all( | 92 | border: Border.all( |
93 | - color: Colors.grey.shade50, width: 0.5), // 边色与边宽度 | 93 | + color: Colors.grey.shade50, |
94 | + width: 0.5, | ||
95 | + ), // 边色与边宽度 | ||
94 | ), | 96 | ), |
95 | child: ClipRect( | 97 | child: ClipRect( |
96 | child: BackdropFilter( | 98 | child: BackdropFilter( | ... | ... |
... | @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; | ... | @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; |
3 | import 'package:one_poem/account/account_router.dart'; | 3 | import 'package:one_poem/account/account_router.dart'; |
4 | import 'package:one_poem/category/category_router.dart'; | 4 | import 'package:one_poem/category/category_router.dart'; |
5 | import 'package:one_poem/category/page/categories_page.dart'; | 5 | import 'package:one_poem/category/page/categories_page.dart'; |
6 | +import 'package:one_poem/membership/membership_router.dart'; | ||
6 | import 'package:one_poem/timeline/timeline_router.dart'; | 7 | import 'package:one_poem/timeline/timeline_router.dart'; |
7 | import 'package:one_poem/home/home_page.dart'; | 8 | import 'package:one_poem/home/home_page.dart'; |
8 | import 'package:one_poem/home/webview_page.dart'; | 9 | import 'package:one_poem/home/webview_page.dart'; |
... | @@ -14,7 +15,6 @@ import 'i_router.dart'; | ... | @@ -14,7 +15,6 @@ import 'i_router.dart'; |
14 | import 'not_found_page.dart'; | 15 | import 'not_found_page.dart'; |
15 | 16 | ||
16 | class Routes { | 17 | class Routes { |
17 | - | ||
18 | static String home = '/home'; | 18 | static String home = '/home'; |
19 | static String webViewPage = '/webView'; | 19 | static String webViewPage = '/webView'; |
20 | 20 | ||
... | @@ -25,14 +25,17 @@ class Routes { | ... | @@ -25,14 +25,17 @@ class Routes { |
25 | static void initRoutes() { | 25 | static void initRoutes() { |
26 | /// 指定路由跳转错误返回页 | 26 | /// 指定路由跳转错误返回页 |
27 | router.notFoundHandler = Handler( | 27 | router.notFoundHandler = Handler( |
28 | - handlerFunc: (BuildContext? context, Map<String, List<String>> params) { | 28 | + handlerFunc: (BuildContext? context, Map<String, List<String>> params) { |
29 | - debugPrint('未找到目标页'); | 29 | + debugPrint('未找到目标页'); |
30 | - return const NotFoundPage(); | 30 | + return const NotFoundPage(); |
31 | - }); | 31 | + }); |
32 | - | 32 | + |
33 | - router.define(home, handler: Handler( | 33 | + router.define(home, |
34 | - handlerFunc: (BuildContext? context, Map<String, List<String>> params) => const Home())); | 34 | + handler: Handler( |
35 | - | 35 | + handlerFunc: |
36 | + (BuildContext? context, Map<String, List<String>> params) => | ||
37 | + const Home())); | ||
38 | + | ||
36 | router.define(webViewPage, handler: Handler(handlerFunc: (_, params) { | 39 | router.define(webViewPage, handler: Handler(handlerFunc: (_, params) { |
37 | final String title = params['title']?.first ?? ''; | 40 | final String title = params['title']?.first ?? ''; |
38 | final String url = params['url']?.first ?? ''; | 41 | final String url = params['url']?.first ?? ''; |
... | @@ -40,6 +43,7 @@ class Routes { | ... | @@ -40,6 +43,7 @@ class Routes { |
40 | })); | 43 | })); |
41 | 44 | ||
42 | _listRouter.clear(); | 45 | _listRouter.clear(); |
46 | + | ||
43 | /// 各自路由由各自模块管理,统一在此添加初始化 | 47 | /// 各自路由由各自模块管理,统一在此添加初始化 |
44 | _listRouter.add(LoginRouter()); | 48 | _listRouter.add(LoginRouter()); |
45 | _listRouter.add(TimelineRouter()); | 49 | _listRouter.add(TimelineRouter()); |
... | @@ -47,11 +51,13 @@ class Routes { | ... | @@ -47,11 +51,13 @@ class Routes { |
47 | _listRouter.add(AccountRouter()); | 51 | _listRouter.add(AccountRouter()); |
48 | _listRouter.add(SettingRouter()); | 52 | _listRouter.add(SettingRouter()); |
49 | _listRouter.add(CategoryRouter()); | 53 | _listRouter.add(CategoryRouter()); |
54 | + _listRouter.add(MembershipRouter()); | ||
50 | 55 | ||
51 | /// 初始化路由 | 56 | /// 初始化路由 |
52 | void initRouter(IRouterProvider routerProvider) { | 57 | void initRouter(IRouterProvider routerProvider) { |
53 | routerProvider.initRouter(router); | 58 | routerProvider.initRouter(router); |
54 | } | 59 | } |
60 | + | ||
55 | _listRouter.forEach(initRouter); | 61 | _listRouter.forEach(initRouter); |
56 | } | 62 | } |
57 | } | 63 | } | ... | ... |
... | @@ -176,12 +176,13 @@ flutter: | ... | @@ -176,12 +176,13 @@ flutter: |
176 | # For details regarding fonts from package dependencies, | 176 | # For details regarding fonts from package dependencies, |
177 | # see https://flutter.dev/custom-fonts/#from-packages | 177 | # see https://flutter.dev/custom-fonts/#from-packages |
178 | assets: | 178 | assets: |
179 | - - assets/data/ | ||
180 | - assets/images/ | 179 | - assets/images/ |
181 | - assets/images/login/ | 180 | - assets/images/login/ |
182 | - assets/images/state/ | 181 | - assets/images/state/ |
183 | - assets/images/poem/ | 182 | - assets/images/poem/ |
184 | - assets/images/category/ | 183 | - assets/images/category/ |
184 | + - assets/images/membership/ | ||
185 | + - assets/data/ | ||
185 | - assets/data/Data.json | 186 | - assets/data/Data.json |
186 | - assets/data/friends/ | 187 | - assets/data/friends/ |
187 | 188 | ... | ... |
-
Please register or login to post a comment