✨ App bar leading icon for drawer
This commit is contained in:
		| @@ -7,6 +7,7 @@ import 'package:solian/models/realm.dart'; | |||||||
| import 'package:solian/providers/auth.dart'; | import 'package:solian/providers/auth.dart'; | ||||||
| import 'package:solian/router.dart'; | import 'package:solian/router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/attachments/attachment_publish.dart'; | import 'package:solian/widgets/attachments/attachment_publish.dart'; | ||||||
| import 'package:solian/widgets/feed/feed_tags_field.dart'; | import 'package:solian/widgets/feed/feed_tags_field.dart'; | ||||||
| @@ -129,6 +130,7 @@ class _ArticlePublishScreenState extends State<ArticlePublishScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('articlePublish'.tr), |           title: AppBarTitle('articlePublish'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; | |||||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||||
| import 'package:solian/providers/content/call.dart'; | import 'package:solian/providers/content/call.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/chat/call/call_controls.dart'; | import 'package:solian/widgets/chat/call/call_controls.dart'; | ||||||
| import 'package:solian/widgets/chat/call/call_participant.dart'; | import 'package:solian/widgets/chat/call/call_participant.dart'; | ||||||
|  |  | ||||||
| @@ -55,6 +56,7 @@ class _CallScreenState extends State<CallScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           centerTitle: true, |           centerTitle: true, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|           title: RichText( |           title: RichText( | ||||||
|   | |||||||
| @@ -17,6 +17,7 @@ import 'package:solian/providers/content/channel.dart'; | |||||||
| import 'package:solian/router.dart'; | import 'package:solian/router.dart'; | ||||||
| import 'package:solian/screens/channel/channel_detail.dart'; | import 'package:solian/screens/channel/channel_detail.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/chat/call/call_prejoin.dart'; | import 'package:solian/widgets/chat/call/call_prejoin.dart'; | ||||||
| import 'package:solian/widgets/chat/call/chat_call_action.dart'; | import 'package:solian/widgets/chat/call/chat_call_action.dart'; | ||||||
| @@ -192,6 +193,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> { | |||||||
|  |  | ||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: AppBar( |       appBar: AppBar( | ||||||
|  |         leading: const AppBarLeadingButton(), | ||||||
|         title: AppBarTitle(title), |         title: AppBarTitle(title), | ||||||
|         centerTitle: false, |         centerTitle: false, | ||||||
|         titleSpacing: SolianTheme.titleSpacing(context), |         titleSpacing: SolianTheme.titleSpacing(context), | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ import 'package:solian/router.dart'; | |||||||
| import 'package:solian/screens/account/notification.dart'; | import 'package:solian/screens/account/notification.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
| import 'package:solian/widgets/account/signin_required_overlay.dart'; | import 'package:solian/widgets/account/signin_required_overlay.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/channel/channel_list.dart'; | import 'package:solian/widgets/channel/channel_list.dart'; | ||||||
| import 'package:solian/widgets/chat/call/chat_call_indicator.dart'; | import 'package:solian/widgets/chat/call/chat_call_indicator.dart'; | ||||||
| @@ -43,6 +44,7 @@ class _ChatScreenState extends State<ChatScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('chat'.tr), |           title: AppBarTitle('chat'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ import 'package:solian/models/post.dart'; | |||||||
| import 'package:solian/providers/content/feed.dart'; | import 'package:solian/providers/content/feed.dart'; | ||||||
| import 'package:solian/screens/home.dart'; | import 'package:solian/screens/home.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/articles/article_action.dart'; | import 'package:solian/widgets/articles/article_action.dart'; | ||||||
| import 'package:solian/widgets/articles/article_owned_list.dart'; | import 'package:solian/widgets/articles/article_owned_list.dart'; | ||||||
| @@ -62,6 +63,7 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('draftBox'.tr), |           title: AppBarTitle('draftBox'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -10,6 +10,7 @@ import 'package:solian/screens/account/notification.dart'; | |||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/current_state_action.dart'; | import 'package:solian/widgets/current_state_action.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/feed/feed_list.dart'; | import 'package:solian/widgets/feed/feed_list.dart'; | ||||||
|  |  | ||||||
| class HomeScreen extends StatefulWidget { | class HomeScreen extends StatefulWidget { | ||||||
| @@ -63,6 +64,7 @@ class _HomeScreenState extends State<HomeScreen> { | |||||||
|                 centerTitle: false, |                 centerTitle: false, | ||||||
|                 floating: true, |                 floating: true, | ||||||
|                 toolbarHeight: SolianTheme.toolbarHeight(context), |                 toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|  |                 leading: const AppBarLeadingButton(), | ||||||
|                 actions: [ |                 actions: [ | ||||||
|                   const BackgroundStateWidget(), |                   const BackgroundStateWidget(), | ||||||
|                   const NotificationButton(), |                   const NotificationButton(), | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ import 'package:solian/models/realm.dart'; | |||||||
| import 'package:solian/providers/auth.dart'; | import 'package:solian/providers/auth.dart'; | ||||||
| import 'package:solian/router.dart'; | import 'package:solian/router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/attachments/attachment_publish.dart'; | import 'package:solian/widgets/attachments/attachment_publish.dart'; | ||||||
| import 'package:solian/widgets/posts/post_item.dart'; | import 'package:solian/widgets/posts/post_item.dart'; | ||||||
| @@ -133,6 +134,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('postPublish'.tr), |           title: AppBarTitle('postPublish'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ import 'package:solian/router.dart'; | |||||||
| import 'package:solian/screens/account/notification.dart'; | import 'package:solian/screens/account/notification.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
| import 'package:solian/widgets/account/signin_required_overlay.dart'; | import 'package:solian/widgets/account/signin_required_overlay.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/current_state_action.dart'; | import 'package:solian/widgets/current_state_action.dart'; | ||||||
| import 'package:solian/widgets/sized_container.dart'; | import 'package:solian/widgets/sized_container.dart'; | ||||||
| @@ -47,7 +48,6 @@ class _RealmListScreenState extends State<RealmListScreen> { | |||||||
|   @override |   @override | ||||||
|   void initState() { |   void initState() { | ||||||
|     super.initState(); |     super.initState(); | ||||||
|  |  | ||||||
|     getRealms(); |     getRealms(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -59,6 +59,7 @@ class _RealmListScreenState extends State<RealmListScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('realm'.tr), |           title: AppBarTitle('realm'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ import 'package:solian/models/realm.dart'; | |||||||
| import 'package:solian/providers/auth.dart'; | import 'package:solian/providers/auth.dart'; | ||||||
| import 'package:solian/router.dart'; | import 'package:solian/router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:uuid/uuid.dart'; | import 'package:uuid/uuid.dart'; | ||||||
|  |  | ||||||
| @@ -98,6 +99,7 @@ class _RealmOrganizeScreenState extends State<RealmOrganizeScreen> { | |||||||
|       color: Theme.of(context).colorScheme.surface, |       color: Theme.of(context).colorScheme.surface, | ||||||
|       child: Scaffold( |       child: Scaffold( | ||||||
|         appBar: AppBar( |         appBar: AppBar( | ||||||
|  |           leading: const AppBarLeadingButton(), | ||||||
|           title: AppBarTitle('realmOrganizing'.tr), |           title: AppBarTitle('realmOrganizing'.tr), | ||||||
|           centerTitle: false, |           centerTitle: false, | ||||||
|           toolbarHeight: SolianTheme.toolbarHeight(context), |           toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ import 'package:solian/router.dart'; | |||||||
| import 'package:solian/screens/channel/channel_organize.dart'; | import 'package:solian/screens/channel/channel_organize.dart'; | ||||||
| import 'package:solian/screens/posts/post_editor.dart'; | import 'package:solian/screens/posts/post_editor.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/channel/channel_list.dart'; | import 'package:solian/widgets/channel/channel_list.dart'; | ||||||
| import 'package:solian/widgets/posts/post_list.dart'; | import 'package:solian/widgets/posts/post_list.dart'; | ||||||
|  |  | ||||||
| @@ -90,6 +91,7 @@ class _RealmViewScreenState extends State<RealmViewScreen> { | |||||||
|                 handle: |                 handle: | ||||||
|                     NestedScrollView.sliverOverlapAbsorberHandleFor(context), |                     NestedScrollView.sliverOverlapAbsorberHandleFor(context), | ||||||
|                 sliver: SliverAppBar( |                 sliver: SliverAppBar( | ||||||
|  |                   leading: const AppBarLeadingButton(), | ||||||
|                   title: Text(_realm?.name ?? 'loading'.tr), |                   title: Text(_realm?.name ?? 'loading'.tr), | ||||||
|                   centerTitle: false, |                   centerTitle: false, | ||||||
|                   actions: [ |                   actions: [ | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | |||||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||||
| import 'package:go_router/go_router.dart'; | import 'package:go_router/go_router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
|  |  | ||||||
| class CenteredShell extends StatelessWidget { | class CenteredShell extends StatelessWidget { | ||||||
| @@ -21,6 +22,7 @@ class CenteredShell extends StatelessWidget { | |||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: showAppBar |       appBar: showAppBar | ||||||
|           ? AppBar( |           ? AppBar( | ||||||
|  |               leading: const AppBarLeadingButton(), | ||||||
|               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), |               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), | ||||||
|               centerTitle: false, |               centerTitle: false, | ||||||
|               toolbarHeight: SolianTheme.toolbarHeight(context), |               toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | |||||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||||
| import 'package:go_router/go_router.dart'; | import 'package:go_router/go_router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
| import 'package:solian/widgets/sidebar/sidebar_placeholder.dart'; | import 'package:solian/widgets/sidebar/sidebar_placeholder.dart'; | ||||||
|  |  | ||||||
| @@ -43,6 +44,7 @@ class SidebarShell extends StatelessWidget { | |||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: showAppBar |       appBar: showAppBar | ||||||
|           ? AppBar( |           ? AppBar( | ||||||
|  |               leading: const AppBarLeadingButton(), | ||||||
|               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), |               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), | ||||||
|               centerTitle: false, |               centerTitle: false, | ||||||
|               toolbarHeight: SolianTheme.toolbarHeight(context), |               toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ import 'package:get/get.dart'; | |||||||
| import 'package:go_router/go_router.dart'; | import 'package:go_router/go_router.dart'; | ||||||
| import 'package:solian/theme.dart'; | import 'package:solian/theme.dart'; | ||||||
| import 'package:solian/widgets/app_bar_title.dart'; | import 'package:solian/widgets/app_bar_title.dart'; | ||||||
|  | import 'package:solian/widgets/app_bar_leading.dart'; | ||||||
|  |  | ||||||
| class TitleShell extends StatelessWidget { | class TitleShell extends StatelessWidget { | ||||||
|   final bool showAppBar; |   final bool showAppBar; | ||||||
| @@ -21,6 +22,7 @@ class TitleShell extends StatelessWidget { | |||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: showAppBar |       appBar: showAppBar | ||||||
|           ? AppBar( |           ? AppBar( | ||||||
|  |               leading: const AppBarLeadingButton(), | ||||||
|               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), |               title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr), | ||||||
|               centerTitle: false, |               centerTitle: false, | ||||||
|               toolbarHeight: SolianTheme.toolbarHeight(context), |               toolbarHeight: SolianTheme.toolbarHeight(context), | ||||||
|   | |||||||
							
								
								
									
										22
									
								
								lib/widgets/app_bar_leading.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								lib/widgets/app_bar_leading.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:solian/shells/root_shell.dart'; | ||||||
|  |  | ||||||
|  | class AppBarLeadingButton extends StatelessWidget { | ||||||
|  |   const AppBarLeadingButton({super.key}); | ||||||
|  |  | ||||||
|  |   @override | ||||||
|  |   Widget build(BuildContext context) { | ||||||
|  |     if (Navigator.canPop(context)) { | ||||||
|  |       return BackButton( | ||||||
|  |         onPressed: () => Navigator.pop(context), | ||||||
|  |       ); | ||||||
|  |     } | ||||||
|  |     if (rootScaffoldKey.currentState!.hasDrawer) { | ||||||
|  |       return DrawerButton( | ||||||
|  |         onPressed: () => rootScaffoldKey.currentState!.openDrawer(), | ||||||
|  |       ); | ||||||
|  |     } else { | ||||||
|  |       return const SizedBox(); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -11,6 +11,7 @@ class ChannelListWidget extends StatefulWidget { | |||||||
|   final bool isDense; |   final bool isDense; | ||||||
|   final bool noCategory; |   final bool noCategory; | ||||||
|   final bool useReplace; |   final bool useReplace; | ||||||
|  |   final Function(Channel)? onSelected; | ||||||
|  |  | ||||||
|   const ChannelListWidget({ |   const ChannelListWidget({ | ||||||
|     super.key, |     super.key, | ||||||
| @@ -19,6 +20,7 @@ class ChannelListWidget extends StatefulWidget { | |||||||
|     this.isDense = false, |     this.isDense = false, | ||||||
|     this.noCategory = false, |     this.noCategory = false, | ||||||
|     this.useReplace = false, |     this.useReplace = false, | ||||||
|  |     this.onSelected, | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   @override |   @override | ||||||
| @@ -80,12 +82,16 @@ class _ChannelListWidgetState extends State<ChannelListWidget> { | |||||||
|         }, |         }, | ||||||
|       ); |       ); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (widget.onSelected != null) { | ||||||
|  |       widget.onSelected!(item); | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   Widget buildItem(Channel item) { |   Widget buildItem(Channel item) { | ||||||
|     final padding = widget.isDense |     final padding = widget.isDense | ||||||
|         ? const EdgeInsets.symmetric(horizontal: 20) |         ? const EdgeInsets.symmetric(horizontal: 20) | ||||||
|         : const EdgeInsets.symmetric(horizontal: 24); |         : const EdgeInsets.symmetric(horizontal: 16); | ||||||
|  |  | ||||||
|     if (item.type == 1) { |     if (item.type == 1) { | ||||||
|       final otherside = item.members! |       final otherside = item.members! | ||||||
| @@ -95,7 +101,7 @@ class _ChannelListWidgetState extends State<ChannelListWidget> { | |||||||
|       return ListTile( |       return ListTile( | ||||||
|         leading: AccountAvatar( |         leading: AccountAvatar( | ||||||
|           content: otherside.account.avatar, |           content: otherside.account.avatar, | ||||||
|           radius: widget.isDense ? 12 : 24, |           radius: widget.isDense ? 12 : 20, | ||||||
|           bgColor: Colors.indigo, |           bgColor: Colors.indigo, | ||||||
|           feColor: Colors.white, |           feColor: Colors.white, | ||||||
|         ), |         ), | ||||||
| @@ -120,7 +126,7 @@ class _ChannelListWidgetState extends State<ChannelListWidget> { | |||||||
|         leading: CircleAvatar( |         leading: CircleAvatar( | ||||||
|           backgroundColor: |           backgroundColor: | ||||||
|               item.realmId == null ? Colors.indigo : Colors.transparent, |               item.realmId == null ? Colors.indigo : Colors.transparent, | ||||||
|           radius: widget.isDense ? 12 : 24, |           radius: widget.isDense ? 12 : 20, | ||||||
|           child: FaIcon( |           child: FaIcon( | ||||||
|             FontAwesomeIcons.hashtag, |             FontAwesomeIcons.hashtag, | ||||||
|             color: item.realmId == null ? Colors.white : Colors.indigo, |             color: item.realmId == null ? Colors.white : Colors.indigo, | ||||||
| @@ -163,9 +169,18 @@ class _ChannelListWidgetState extends State<ChannelListWidget> { | |||||||
|         SliverList.list( |         SliverList.list( | ||||||
|           children: _inRealms.entries.map((element) { |           children: _inRealms.entries.map((element) { | ||||||
|             return ExpansionTile( |             return ExpansionTile( | ||||||
|               tilePadding: const EdgeInsets.symmetric(horizontal: 24), |               tilePadding: const EdgeInsets.symmetric(horizontal: 20), | ||||||
|               minTileHeight: 48, |               minTileHeight: 48, | ||||||
|               title: Text(element.value.first.realm!.name), |               title: Text(element.value.first.realm!.name), | ||||||
|  |               leading: CircleAvatar( | ||||||
|  |                 backgroundColor: Colors.teal, | ||||||
|  |                 radius: widget.isDense ? 12 : 24, | ||||||
|  |                 child: Icon( | ||||||
|  |                   Icons.workspaces, | ||||||
|  |                   color: Colors.white, | ||||||
|  |                   size: widget.isDense ? 12 : 16, | ||||||
|  |                 ), | ||||||
|  |               ), | ||||||
|               children: element.value.map((x) => buildItem(x)).toList(), |               children: element.value.map((x) => buildItem(x)).toList(), | ||||||
|             ); |             ); | ||||||
|           }).toList(), |           }).toList(), | ||||||
|   | |||||||
| @@ -89,7 +89,11 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> { | |||||||
|  |  | ||||||
|             return ListTile( |             return ListTile( | ||||||
|               contentPadding: const EdgeInsets.symmetric(horizontal: 24), |               contentPadding: const EdgeInsets.symmetric(horizontal: 24), | ||||||
|               title: Text(snapshot.data!.body['nick']), |               title: Text( | ||||||
|  |                 snapshot.data!.body['nick'], | ||||||
|  |                 maxLines: 1, | ||||||
|  |                 overflow: TextOverflow.fade, | ||||||
|  |               ), | ||||||
|               subtitle: Builder( |               subtitle: Builder( | ||||||
|                 builder: (context) { |                 builder: (context) { | ||||||
|                   if (_accountStatus == null) { |                   if (_accountStatus == null) { | ||||||
| @@ -98,7 +102,11 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> { | |||||||
|                   final info = StatusProvider.determineStatus( |                   final info = StatusProvider.determineStatus( | ||||||
|                     _accountStatus!, |                     _accountStatus!, | ||||||
|                   ); |                   ); | ||||||
|                   return Text(info.$3); |                   return Text( | ||||||
|  |                     info.$3, | ||||||
|  |                     maxLines: 1, | ||||||
|  |                     overflow: TextOverflow.fade, | ||||||
|  |                   ); | ||||||
|                 }, |                 }, | ||||||
|               ), |               ), | ||||||
|               leading: Builder(builder: (context) { |               leading: Builder(builder: (context) { | ||||||
| @@ -177,6 +185,9 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> { | |||||||
|                           selfId: selfId, |                           selfId: selfId, | ||||||
|                           isDense: true, |                           isDense: true, | ||||||
|                           useReplace: true, |                           useReplace: true, | ||||||
|  |                           onSelected: (_) { | ||||||
|  |                             closeDrawer(); | ||||||
|  |                           }, | ||||||
|                         ), |                         ), | ||||||
|                       ), |                       ), | ||||||
|                     ), |                     ), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user