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