-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: titlebar complete compatibility, platform specific login, libra…
…ry tabbar in titlebar
- Loading branch information
Showing
16 changed files
with
444 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
import 'package:flutter/material.dart' hide Image; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:flutter_hooks/flutter_hooks.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:platform_ui/platform_ui.dart'; | ||
import 'package:spotube/components/Library/UserAlbums.dart'; | ||
import 'package:spotube/components/Library/UserArtists.dart'; | ||
import 'package:spotube/components/Library/UserDownloads.dart'; | ||
import 'package:spotube/components/Library/UserLocalTracks.dart'; | ||
import 'package:spotube/components/Library/UserPlaylists.dart'; | ||
import 'package:spotube/components/Shared/AnonymousFallback.dart'; | ||
import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; | ||
|
||
class UserLibrary extends ConsumerWidget { | ||
class UserLibrary extends HookConsumerWidget { | ||
const UserLibrary({Key? key}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context, ref) { | ||
return DefaultTabController( | ||
length: 5, | ||
child: SafeArea( | ||
child: PlatformTabView( | ||
final index = useState(0); | ||
|
||
final body = [ | ||
const UserPlaylists(), | ||
const UserLocalTracks(), | ||
const UserDownloads(), | ||
const UserArtists(), | ||
const UserAlbums(), | ||
][index.value]; | ||
|
||
return PlatformScaffold( | ||
appBar: PageWindowTitleBar( | ||
titleWidth: 415, | ||
centerTitle: true, | ||
center: PlatformTabBar( | ||
androidIsScrollable: true, | ||
placement: PlatformProperty.all(PlatformTabbarPlacement.top), | ||
body: { | ||
PlatformTab( | ||
label: "Playlist", | ||
icon: Container(), | ||
): const AnonymousFallback(child: UserPlaylists()), | ||
PlatformTab( | ||
label: "Downloads", | ||
icon: Container(), | ||
): const UserDownloads(), | ||
PlatformTab( | ||
label: "Local", | ||
icon: Container(), | ||
): const UserLocalTracks(), | ||
PlatformTab( | ||
label: "Artists", | ||
icon: Container(), | ||
): const AnonymousFallback(child: UserArtists()), | ||
PlatformTab( | ||
label: "Album", | ||
icon: Container(), | ||
): const AnonymousFallback(child: UserAlbums()), | ||
}, | ||
selectedIndex: index.value, | ||
onSelectedIndexChanged: (value) => index.value = value, | ||
isNavigational: | ||
PlatformProperty.byPlatformGroup(mobile: false, desktop: true), | ||
tabs: [ | ||
PlatformTab(label: 'Playlists', icon: const SizedBox.shrink()), | ||
PlatformTab(label: 'Tracks', icon: const SizedBox.shrink()), | ||
PlatformTab(label: 'Downloads', icon: const SizedBox.shrink()), | ||
PlatformTab(label: 'Artists', icon: const SizedBox.shrink()), | ||
PlatformTab(label: 'Albums', icon: const SizedBox.shrink()), | ||
], | ||
), | ||
), | ||
body: body, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.