Lyrics page Sidebar crash in mobile/tablet device bugfix

This commit is contained in:
Kingkor Roy Tirtho 2022-07-11 13:55:07 +06:00
parent 2a221d9cfb
commit c898716b06

View File

@ -10,6 +10,7 @@ import 'package:spotube/hooks/useBreakpoints.dart';
import 'package:spotube/models/sideBarTiles.dart'; import 'package:spotube/models/sideBarTiles.dart';
import 'package:spotube/provider/Auth.dart'; import 'package:spotube/provider/Auth.dart';
import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/provider/SpotifyRequests.dart';
import 'package:spotube/utils/platform.dart';
class Sidebar extends HookConsumerWidget { class Sidebar extends HookConsumerWidget {
final int selectedIndex; final int selectedIndex;
@ -59,30 +60,33 @@ class Sidebar extends HookConsumerWidget {
return null; return null;
}); });
return Material( return SafeArea(
child: Material(
color: Theme.of(context).navigationRailTheme.backgroundColor, color: Theme.of(context).navigationRailTheme.backgroundColor,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (selectedIndex == 3) if (selectedIndex == 3 && kIsDesktop)
SizedBox( SizedBox(
height: appWindow.titleBarHeight, height: appWindow.titleBarHeight,
width: titleBarDragMaxWidth.toDouble(), width: titleBarDragMaxWidth.toDouble(),
child: MoveWindow(), child: MoveWindow(),
), ),
extended.value Padding(
? Padding(
padding: const EdgeInsets.only(left: 15), padding: const EdgeInsets.only(left: 15),
child: Row(children: [ child: (extended.value)
? Row(
children: [
_buildSmallLogo(), _buildSmallLogo(),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text("Spotube", Text("Spotube",
style: Theme.of(context).textTheme.headline4), style: Theme.of(context).textTheme.headline4),
]), ],
) )
: _buildSmallLogo(), : _buildSmallLogo(),
),
Expanded( Expanded(
child: NavigationRail( child: NavigationRail(
destinations: sidebarTileList destinations: sidebarTileList
@ -149,7 +153,8 @@ class Sidebar extends HookConsumerWidget {
child: InkWell( child: InkWell(
onTap: () => goToSettings(context), onTap: () => goToSettings(context),
child: CircleAvatar( child: CircleAvatar(
backgroundImage: CachedNetworkImageProvider(avatarImg), backgroundImage:
CachedNetworkImageProvider(avatarImg),
), ),
), ),
); );
@ -159,6 +164,7 @@ class Sidebar extends HookConsumerWidget {
) )
], ],
), ),
),
); );
} }
} }