Showing
4 changed files
with
45 additions
and
8 deletions
| 1 | import 'package:fluro/fluro.dart'; | 1 | import 'package:fluro/fluro.dart'; |
| 2 | import 'package:one_poem/routers/i_router.dart'; | 2 | import 'package:one_poem/routers/i_router.dart'; |
| 3 | 3 | ||
| 4 | +import 'page/account_edit_page.dart'; | ||
| 4 | import 'page/account_page.dart'; | 5 | import 'page/account_page.dart'; |
| 5 | 6 | ||
| 6 | 7 | ||
| 7 | class AccountRouter implements IRouterProvider{ | 8 | class AccountRouter implements IRouterProvider{ |
| 8 | 9 | ||
| 9 | static String accountPage = '/account'; | 10 | static String accountPage = '/account'; |
| 11 | + static String accountEditPage = '/account/edit'; | ||
| 10 | 12 | ||
| 11 | @override | 13 | @override |
| 12 | void initRouter(FluroRouter router) { | 14 | void initRouter(FluroRouter router) { |
| 13 | router.define(accountPage, handler: Handler(handlerFunc: (_, __) { | 15 | router.define(accountPage, handler: Handler(handlerFunc: (_, __) { |
| 14 | return const AccountPage(isSelfPage: true,); | 16 | return const AccountPage(isSelfPage: true,); |
| 15 | })); | 17 | })); |
| 18 | + router.define(accountEditPage, handler: Handler(handlerFunc: (_, __) { | ||
| 19 | + return AccountEditPage(); | ||
| 20 | + })); | ||
| 16 | } | 21 | } |
| 17 | 22 | ||
| 18 | } | 23 | } | ... | ... |
lib/account/page/account_edit_page.dart
0 → 100644
This diff is collapsed. Click to expand it.
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | +import 'package:one_poem/routers/fluro_navigator.dart'; | ||
| 2 | import 'package:one_poem/tiktok/style/style.dart'; | 3 | import 'package:one_poem/tiktok/style/style.dart'; |
| 3 | import 'package:tapped/tapped.dart'; | 4 | import 'package:tapped/tapped.dart'; |
| 4 | import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart'; | 5 | import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart'; |
| 5 | 6 | ||
| 6 | import 'package:one_poem/extension/int_extension.dart'; | 7 | import 'package:one_poem/extension/int_extension.dart'; |
| 7 | 8 | ||
| 9 | +import '../account_router.dart'; | ||
| 10 | + | ||
| 8 | class AccountPage extends StatefulWidget { | 11 | class AccountPage extends StatefulWidget { |
| 9 | const AccountPage({ | 12 | const AccountPage({ |
| 10 | Key? key, | 13 | Key? key, |
| ... | @@ -83,7 +86,28 @@ class _AccountPageState extends State<AccountPage> { | ... | @@ -83,7 +86,28 @@ class _AccountPageState extends State<AccountPage> { |
| 83 | // 头像与关注 | 86 | // 头像与关注 |
| 84 | Stack( | 87 | Stack( |
| 85 | alignment: Alignment.bottomLeft, | 88 | alignment: Alignment.bottomLeft, |
| 86 | - children: <Widget>[likeButton, avatar], | 89 | + children: <Widget>[ |
| 90 | + likeButton, | ||
| 91 | + avatar, | ||
| 92 | + Positioned( | ||
| 93 | + child: GestureDetector( | ||
| 94 | + child: CircleAvatar( | ||
| 95 | + backgroundColor: Colors.red.withOpacity(0.4), | ||
| 96 | + radius: 14.0, | ||
| 97 | + child: const Icon( | ||
| 98 | + Icons.edit, | ||
| 99 | + color: Colors.white, | ||
| 100 | + size: 16.0, | ||
| 101 | + ), | ||
| 102 | + ), | ||
| 103 | + onTap: () { | ||
| 104 | + NavigatorUtils.push(context, AccountRouter.accountEditPage); | ||
| 105 | + }, | ||
| 106 | + ), | ||
| 107 | + left: 64.px, | ||
| 108 | + bottom: 10.px, | ||
| 109 | + ), | ||
| 110 | + ], | ||
| 87 | ), | 111 | ), |
| 88 | Container( | 112 | Container( |
| 89 | color: ColorPlate.white, | 113 | color: ColorPlate.white, |
| ... | @@ -167,12 +191,17 @@ class _AccountPageState extends State<AccountPage> { | ... | @@ -167,12 +191,17 @@ class _AccountPageState extends State<AccountPage> { |
| 167 | alignment: Alignment.centerRight, | 191 | alignment: Alignment.centerRight, |
| 168 | height: 64.px, | 192 | height: 64.px, |
| 169 | width: double.infinity, | 193 | width: double.infinity, |
| 170 | - child: IconButton( | 194 | + child: Row( |
| 171 | - icon: const Icon( | 195 | + mainAxisAlignment: MainAxisAlignment.end, |
| 172 | - Icons.settings_outlined, | 196 | + children: [ |
| 173 | - color: Colors.black54, | 197 | + IconButton( |
| 174 | - ), | 198 | + icon: const Icon( |
| 175 | - onPressed: () {}, | 199 | + Icons.settings_outlined, |
| 200 | + color: Colors.black54, | ||
| 201 | + ), | ||
| 202 | + onPressed: () {}, | ||
| 203 | + ), | ||
| 204 | + ], | ||
| 176 | ), | 205 | ), |
| 177 | ), | 206 | ), |
| 178 | body, | 207 | body, | ... | ... |
| ... | @@ -44,7 +44,10 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -44,7 +44,10 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
| 44 | }, | 44 | }, |
| 45 | tooltip: '返回', | 45 | tooltip: '返回', |
| 46 | padding: const EdgeInsets.all(12.0), | 46 | padding: const EdgeInsets.all(12.0), |
| 47 | - icon: const Icon(Icons.arrow_back_ios_outlined, color: Colors.white,), | 47 | + icon: Icon( |
| 48 | + Icons.arrow_back_ios_outlined, | ||
| 49 | + color: isTransparent ? Colors.black54 : Colors.white, | ||
| 50 | + ), | ||
| 48 | ) | 51 | ) |
| 49 | : Gaps.empty; | 52 | : Gaps.empty; |
| 50 | 53 | ... | ... |
-
Please register or login to post a comment