🐛 Bug fixes
This commit is contained in:
parent
8d79274b0c
commit
ac60043ca7
@ -202,7 +202,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
||||
String? placeholder;
|
||||
|
||||
final otherside =
|
||||
_channel!.members!.where((e) => e.account.id != _accountId).firstOrNull;
|
||||
_channel?.members!.where((e) => e.account.id != _accountId).firstOrNull;
|
||||
|
||||
if (_channel?.type == 1 && otherside != null) {
|
||||
title = otherside.account.nick;
|
||||
|
@ -131,7 +131,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
..._channels.directChannels
|
||||
]),
|
||||
selfId: selfId,
|
||||
useReplace: true,
|
||||
useReplace: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -2,6 +2,7 @@ import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:solian/theme.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation_bottom.dart';
|
||||
|
||||
final GlobalKey<ScaffoldState> rootScaffoldKey = GlobalKey<ScaffoldState>();
|
||||
@ -39,9 +40,16 @@ class RootShell extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
final destNames = AppNavigation.destinations.map((x) => x.page).toList();
|
||||
final showBottomNavigation = destNames.contains(routeName);
|
||||
|
||||
return Scaffold(
|
||||
key: rootScaffoldKey,
|
||||
bottomNavigationBar: const AppNavigationBottom(),
|
||||
bottomNavigationBar: showBottomNavigation
|
||||
? AppNavigationBottom(
|
||||
initialIndex: destNames.indexOf(routeName ?? 'page'),
|
||||
)
|
||||
: null,
|
||||
body: AppTheme.isLargeScreen(context)
|
||||
? Row(
|
||||
children: [
|
||||
|
@ -3,7 +3,9 @@ import 'package:solian/router.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation.dart';
|
||||
|
||||
class AppNavigationBottom extends StatefulWidget {
|
||||
const AppNavigationBottom({super.key});
|
||||
final int initialIndex;
|
||||
|
||||
const AppNavigationBottom({super.key, this.initialIndex = 0});
|
||||
|
||||
@override
|
||||
State<AppNavigationBottom> createState() => _AppNavigationBottomState();
|
||||
@ -12,6 +14,14 @@ class AppNavigationBottom extends StatefulWidget {
|
||||
class _AppNavigationBottomState extends State<AppNavigationBottom> {
|
||||
int _currentIndex = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.initialIndex >= 0) {
|
||||
_currentIndex = widget.initialIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BottomNavigationBar(
|
||||
|
Loading…
Reference in New Issue
Block a user