mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
Fixed statusbar color issue created by the new theme
ChooseColorSchemeDialog now scrollable Initial FutureProvider integration Uri launches in System Webview in android fix
This commit is contained in:
parent
066baa3745
commit
09160b1a53
@ -1 +1,50 @@
|
||||
{"version":1,"script":["rm -rf AppDir || true","cp -r build/linux/x64/release/bundle AppDir","mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/","cp assets/spotube-logo.png AppDir/usr/share/icons/hicolor/"],"AppDir":{"path":"AppDir","app_info":{"id":"oss.krtirtho.spotube","icon":"spotube-logo","name":"spotube","version":"2.0.0+8","exec":"spotube","exec_args":"$@"},"apt":{"arch":"amd64","allow_unauthenticated":true,"sources":[{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute main restricted"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates main restricted"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute universe"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates universe"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute multiverse"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates multiverse"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security main restricted"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security universe"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security multiverse"}],"include":["libkeybinder-3.0-0"],"exclude":["libx11-6","libgtk-3-0","libglib2.0-0","libc6"]},"files":{"include":[],"exclude":[]}},"AppImage":{"arch":"x86_64","update-information":"guess"}}
|
||||
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
|
||||
version: 1
|
||||
script:
|
||||
- rm -rf AppDir || true
|
||||
- cp -r build/linux/x64/release/bundle AppDir
|
||||
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
|
||||
- cp assets/spotube-logo.png AppDir/usr/share/icons/hicolor/64x64/apps/
|
||||
AppDir:
|
||||
path: ./AppDir
|
||||
app_info:
|
||||
id: oss.krtirtho.spotube
|
||||
name: Spotube
|
||||
icon: spotube-logo
|
||||
version: 2.0.0
|
||||
exec: spotube
|
||||
exec_args: $@
|
||||
apt:
|
||||
arch: amd64
|
||||
allow_unauthenticated: true
|
||||
sources:
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute main restricted
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute universe
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates universe
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute multiverse
|
||||
- sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
|
||||
- sourceline:
|
||||
deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-backports main
|
||||
restricted universe multiverse
|
||||
- sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
|
||||
- sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security universe
|
||||
- sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security multiverse
|
||||
include:
|
||||
- libkeybinder-3.0-0
|
||||
exclude:
|
||||
- libx11-6
|
||||
- libgtk-3-0
|
||||
- libglib2.0-0
|
||||
- libc6
|
||||
files:
|
||||
include: []
|
||||
exclude:
|
||||
- usr/share/man
|
||||
- usr/share/doc/*/README.*
|
||||
- usr/share/doc/*/changelog.*
|
||||
- usr/share/doc/*/NEWS.*
|
||||
- usr/share/doc/*/TODO.*
|
||||
AppImage:
|
||||
arch: x86_64
|
||||
update-information: guess
|
||||
|
@ -1,16 +1,21 @@
|
||||
// Generated file.
|
||||
//
|
||||
// If you wish to remove Flutter's multidex support, delete this entire file.
|
||||
//
|
||||
// Modifications to this file should be done in a copy under a different name
|
||||
// as this file may be regenerated.
|
||||
|
||||
package io.flutter.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
/**
|
||||
* Extension of {@link io.flutter.app.FlutterApplication}, adding multidex support.
|
||||
* Extension of {@link android.app.Application}, adding multidex support.
|
||||
*/
|
||||
public class FlutterMultiDexApplication extends FlutterApplication {
|
||||
public class FlutterMultiDexApplication extends Application {
|
||||
@Override
|
||||
@CallSuper
|
||||
protected void attachBaseContext(Context base) {
|
||||
|
@ -127,21 +127,19 @@ class Home extends HookConsumerWidget {
|
||||
],
|
||||
));
|
||||
|
||||
final brightness = Theme.of(context).brightness;
|
||||
final backgroundColor = Theme.of(context).backgroundColor;
|
||||
|
||||
useEffect(() {
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
statusBarColor: brightness == Brightness.dark
|
||||
? Colors.blueGrey[900]
|
||||
: Colors.white, // status bar color
|
||||
statusBarIconBrightness: brightness == Brightness.dark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
statusBarColor: backgroundColor, // status bar color
|
||||
statusBarIconBrightness: backgroundColor.computeLuminance() > 0.179
|
||||
? Brightness.dark
|
||||
: Brightness.light,
|
||||
),
|
||||
);
|
||||
return null;
|
||||
}, [brightness]);
|
||||
}, [backgroundColor]);
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
|
@ -1,37 +1,32 @@
|
||||
import 'package:flutter/material.dart' hide Image;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:spotify/spotify.dart';
|
||||
import 'package:spotube/components/Album/AlbumCard.dart';
|
||||
import 'package:spotube/helpers/simple-album-to-album.dart';
|
||||
import 'package:spotube/provider/SpotifyDI.dart';
|
||||
import 'package:spotube/provider/SpotifyRequests.dart';
|
||||
|
||||
class UserAlbums extends ConsumerWidget {
|
||||
const UserAlbums({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, ref) {
|
||||
SpotifyApi spotifyApi = ref.watch(spotifyProvider);
|
||||
final albums = ref.watch(currentUserAlbumsQuery);
|
||||
|
||||
return FutureBuilder<Iterable<AlbumSimple>>(
|
||||
future: spotifyApi.me.savedAlbums().all(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData && snapshot.data == null) {
|
||||
return const Center(child: CircularProgressIndicator.adaptive());
|
||||
}
|
||||
return SingleChildScrollView(
|
||||
return albums.when(
|
||||
data: (data) => SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Wrap(
|
||||
spacing: 20, // gap between adjacent chips
|
||||
runSpacing: 20, // gap between lines
|
||||
alignment: WrapAlignment.center,
|
||||
children: snapshot.data!
|
||||
children: data
|
||||
.map((album) => AlbumCard(simpleAlbumToAlbum(album)))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
loading: () => const Center(child: CircularProgressIndicator.adaptive()),
|
||||
error: (_, __) => const Text("Failure is the pillar of success"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,21 +3,19 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:spotify/spotify.dart';
|
||||
import 'package:spotube/components/Playlist/PlaylistCard.dart';
|
||||
import 'package:spotube/components/Playlist/PlaylistCreateDialog.dart';
|
||||
import 'package:spotube/provider/SpotifyDI.dart';
|
||||
import 'package:spotube/provider/SpotifyRequests.dart';
|
||||
|
||||
class UserPlaylists extends ConsumerWidget {
|
||||
const UserPlaylists({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, ref) {
|
||||
SpotifyApi spotifyApi = ref.watch(spotifyProvider);
|
||||
final playlists = ref.watch(currentUserPlaylistsQuery);
|
||||
|
||||
return FutureBuilder<Iterable<PlaylistSimple>>(
|
||||
future: spotifyApi.playlists.me.all(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const Center(child: CircularProgressIndicator.adaptive());
|
||||
}
|
||||
return playlists.when(
|
||||
loading: () =>
|
||||
const Center(child: CircularProgressIndicator.adaptive()),
|
||||
data: (data) {
|
||||
Image image = Image();
|
||||
image.height = 300;
|
||||
image.width = 300;
|
||||
@ -40,14 +38,12 @@ class UserPlaylists extends ConsumerWidget {
|
||||
children: [
|
||||
const PlaylistCreateDialog(),
|
||||
PlaylistCard(likedTracksPlaylist),
|
||||
...snapshot.data!
|
||||
.map((playlist) => PlaylistCard(playlist))
|
||||
.toList(),
|
||||
...data.map((playlist) => PlaylistCard(playlist)).toList(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
error: (_, __) => const Text("Failure is the pillar of success"));
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class PlayerView extends HookConsumerWidget {
|
||||
|
||||
final PaletteColor paletteColor = usePaletteColor(context, albumArt);
|
||||
|
||||
final brightness = Theme.of(context).brightness;
|
||||
final backgroundColor = Theme.of(context).backgroundColor;
|
||||
|
||||
useEffect(() {
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
@ -61,12 +61,10 @@ class PlayerView extends HookConsumerWidget {
|
||||
return () {
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
statusBarColor: brightness == Brightness.dark
|
||||
? Colors.blueGrey[900]
|
||||
: Colors.white, // status bar color
|
||||
statusBarIconBrightness: brightness == Brightness.dark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
statusBarColor: backgroundColor, // status bar color
|
||||
statusBarIconBrightness: backgroundColor.computeLuminance() > 0.179
|
||||
? Brightness.dark
|
||||
: Brightness.light,
|
||||
),
|
||||
);
|
||||
};
|
||||
|
@ -75,6 +75,7 @@ class ColorSchemePickerDialog extends HookConsumerWidget {
|
||||
content: SizedBox(
|
||||
height: 200,
|
||||
width: 400,
|
||||
child: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Wrap(
|
||||
spacing: 10,
|
||||
@ -94,6 +95,7 @@ class ColorSchemePickerDialog extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,10 @@ final logger = getLogger("ServerIPC");
|
||||
Future<String?> connectIpc(String authUri, String redirectUri) async {
|
||||
try {
|
||||
logger.i("[Launching]: $authUri");
|
||||
await launchUrl(Uri.parse(authUri));
|
||||
await launchUrl(
|
||||
Uri.parse(authUri),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
|
||||
HttpServer server =
|
||||
await HttpServer.bind(InternetAddress.loopbackIPv4, 4304);
|
||||
@ -37,4 +40,5 @@ Future<String?> connectIpc(String authUri, String redirectUri) async {
|
||||
logger.e("connectIpc", e, stack);
|
||||
rethrow;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
30
lib/provider/SpotifyRequests.dart
Normal file
30
lib/provider/SpotifyRequests.dart
Normal file
@ -0,0 +1,30 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:spotube/provider/SpotifyDI.dart';
|
||||
import 'package:spotify/spotify.dart';
|
||||
import 'package:spotube/provider/UserPreferences.dart';
|
||||
|
||||
final categoriesQuery = FutureProvider.family<Page<Category>, int>(
|
||||
(ref, pageKey) {
|
||||
final spotify = ref.watch(spotifyProvider);
|
||||
final recommendationMarket = ref.watch(
|
||||
userPreferencesProvider.select((s) => s.recommendationMarket),
|
||||
);
|
||||
return spotify.categories
|
||||
.list(country: recommendationMarket)
|
||||
.getPage(15, pageKey);
|
||||
},
|
||||
);
|
||||
|
||||
final currentUserPlaylistsQuery = FutureProvider<Iterable<PlaylistSimple>>(
|
||||
(ref) {
|
||||
final spotify = ref.watch(spotifyProvider);
|
||||
return spotify.playlists.me.all();
|
||||
},
|
||||
);
|
||||
|
||||
final currentUserAlbumsQuery = FutureProvider<Iterable<AlbumSimple>>(
|
||||
(ref) {
|
||||
final spotify = ref.watch(spotifyProvider);
|
||||
return spotify.me.savedAlbums().all();
|
||||
},
|
||||
);
|
Loading…
Reference in New Issue
Block a user