Merge pull request #58 from stonega/audio_service
Update to latest audio service
This commit is contained in:
commit
ee5a0660ea
|
@ -42,6 +42,7 @@ android {
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
disable 'InvalidPackage'
|
disable 'InvalidPackage'
|
||||||
|
checkReleaseBuilds false
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<application android:name="io.flutter.app.FlutterApplication" android:label="Tsacdop" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:networkSecurityConfig="@xml/network_security_config">
|
<application android:name="io.flutter.app.FlutterApplication" android:label="Tsacdop" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:networkSecurityConfig="@xml/network_security_config">
|
||||||
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
<activity android:name="com.ryanheise.audioservice.AudioServiceActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
||||||
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/LaunchTheme" />
|
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/LaunchTheme" />
|
||||||
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/normal_background" />
|
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/normal_background" />
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.2'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||||
distributionSha256Sum=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821
|
#distributionSha256Sum=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821
|
||||||
|
|
|
@ -457,18 +457,10 @@ class _PlaylistWidgetState extends State<PlaylistWidget> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: ClipRRect(
|
child: CircleAvatar(
|
||||||
borderRadius:
|
radius: 15,
|
||||||
BorderRadius.all(Radius.circular(15.0)),
|
backgroundImage:
|
||||||
child: SizedBox(
|
episodes[index].avatarImage),
|
||||||
height: 30.0,
|
|
||||||
width: 30.0,
|
|
||||||
child: Image(
|
|
||||||
image: episodes[index].avatarImage)
|
|
||||||
// Image.file(File(
|
|
||||||
// "${episodes[index].imagePath}"))
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -522,9 +514,9 @@ class _PlaylistWidgetState extends State<PlaylistWidget> {
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
audio.playNext();
|
audio.playNext();
|
||||||
miniPlaylistKey.currentState.removeItem(
|
// miniPlaylistKey.currentState.removeItem(
|
||||||
0, (context, animation) => Container());
|
// 0, (context, animation) => Container());
|
||||||
miniPlaylistKey.currentState.insertItem(0);
|
// miniPlaylistKey.currentState.insertItem(0);
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
|
@ -1336,13 +1328,7 @@ class _ControlPanelState extends State<ControlPanel>
|
||||||
AudioProcessingState
|
AudioProcessingState
|
||||||
.buffering ||
|
.buffering ||
|
||||||
data.audioState ==
|
data.audioState ==
|
||||||
AudioProcessingState
|
AudioProcessingState.loading
|
||||||
.connecting ||
|
|
||||||
data.audioState ==
|
|
||||||
AudioProcessingState.none ||
|
|
||||||
data.audioState ==
|
|
||||||
AudioProcessingState
|
|
||||||
.skippingToNext
|
|
||||||
? context.s.buffering
|
? context.s.buffering
|
||||||
: '',
|
: '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:line_icons/line_icons.dart';
|
import 'package:line_icons/line_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -197,8 +199,9 @@ class DiscoveryPageState extends State<DiscoveryPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<OnlinePodcast>> _getTopPodcasts({int page}) async {
|
Future<List<OnlinePodcast>> _getTopPodcasts({int page}) async {
|
||||||
if(environment['apiKey'] == '') return [];
|
if (environment['apiKey'] == '') return [];
|
||||||
final searchEngine = ListenNotesSearch();
|
final searchEngine = ListenNotesSearch();
|
||||||
|
try {
|
||||||
var searchResult = await searchEngine.fetchBestPodcast(
|
var searchResult = await searchEngine.fetchBestPodcast(
|
||||||
genre: '',
|
genre: '',
|
||||||
page: page,
|
page: page,
|
||||||
|
@ -207,6 +210,9 @@ class DiscoveryPageState extends State<DiscoveryPage> {
|
||||||
searchResult.podcasts.map((e) => e?.toOnlinePodcast).toList();
|
searchResult.podcasts.map((e) => e?.toOnlinePodcast).toList();
|
||||||
_podcastList.addAll(podcastTopList.cast());
|
_podcastList.addAll(podcastTopList.cast());
|
||||||
return _podcastList;
|
return _podcastList;
|
||||||
|
} catch (e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _getHideDiscovery() async {
|
Future<bool> _getHideDiscovery() async {
|
||||||
|
@ -404,7 +410,9 @@ class __TopPodcastListState extends State<_TopPodcastList> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_page = 1;
|
_page = 1;
|
||||||
|
try {
|
||||||
_searchFuture = _getTopPodcasts(genre: widget.genre, page: _page);
|
_searchFuture = _getTopPodcasts(genre: widget.genre, page: _page);
|
||||||
|
} catch (e) {}
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tsacdop/util/cache_manager.dart';
|
||||||
import 'package:webfeed/webfeed.dart';
|
import 'package:webfeed/webfeed.dart';
|
||||||
|
|
||||||
import '../.env.dart';
|
import '../.env.dart';
|
||||||
|
@ -251,6 +252,7 @@ class _RssResultState extends State<RssResult> {
|
||||||
CachedNetworkImage(
|
CachedNetworkImage(
|
||||||
height: 120.0,
|
height: 120.0,
|
||||||
width: 120.0,
|
width: 120.0,
|
||||||
|
cacheManager: CustomCacheManager(),
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
imageUrl: _onlinePodcast.image,
|
imageUrl: _onlinePodcast.image,
|
||||||
|
@ -1356,6 +1358,7 @@ class PodcastAvatar extends StatelessWidget {
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
imageUrl: podcast.image,
|
imageUrl: podcast.image,
|
||||||
|
cacheManager: CustomCacheManager(),
|
||||||
placeholderFadeInDuration: Duration.zero,
|
placeholderFadeInDuration: Duration.zero,
|
||||||
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
||||||
Container(
|
Container(
|
||||||
|
|
|
@ -75,8 +75,8 @@ class _PlaylistHomeState extends State<PlaylistHome> {
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: SystemUiOverlayStyle(
|
value: SystemUiOverlayStyle(
|
||||||
systemNavigationBarIconBrightness:
|
systemNavigationBarIconBrightness:
|
||||||
Theme.of(context).accentColorBrightness,
|
Theme.of(context).colorScheme.brightness,
|
||||||
statusBarIconBrightness: Theme.of(context).accentColorBrightness,
|
statusBarIconBrightness: Theme.of(context).colorScheme.brightness,
|
||||||
systemNavigationBarColor: Theme.of(context).primaryColor,
|
systemNavigationBarColor: Theme.of(context).primaryColor,
|
||||||
),
|
),
|
||||||
child: WillPopScope(
|
child: WillPopScope(
|
||||||
|
@ -143,6 +143,9 @@ class _PlaylistHomeState extends State<PlaylistHome> {
|
||||||
playing
|
playing
|
||||||
? audio.pauseAduio()
|
? audio.pauseAduio()
|
||||||
: audio.resumeAudio();
|
: audio.resumeAudio();
|
||||||
|
} else if (data.item1.isEmpty) {
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg: 'Playlist is empty');
|
||||||
} else {
|
} else {
|
||||||
context
|
context
|
||||||
.read<AudioPlayerNotifier>()
|
.read<AudioPlayerNotifier>()
|
||||||
|
@ -952,15 +955,14 @@ class __NewPlaylistState extends State<_NewPlaylist> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<EpisodeBrief> _getEpisodeFromFile(String path) async {
|
Future<EpisodeBrief> _getEpisodeFromFile(String path) async {
|
||||||
var metadataRetriever = MetadataRetriever();
|
|
||||||
final fileLength = File(path).statSync().size;
|
final fileLength = File(path).statSync().size;
|
||||||
final pubDate = DateTime.now().millisecondsSinceEpoch;
|
final pubDate = DateTime.now().millisecondsSinceEpoch;
|
||||||
var primaryColor;
|
var primaryColor;
|
||||||
var imagePath;
|
var imagePath;
|
||||||
await metadataRetriever.setFile(File(path));
|
var metadata = await MetadataRetriever.fromFile(File(path));
|
||||||
if (metadataRetriever.albumArt != null) {
|
if (metadata.albumArt != null) {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
final image = img.decodeImage(metadataRetriever.albumArt);
|
final image = img.decodeImage(metadata.albumArt);
|
||||||
final thumbnail = img.copyResize(image, width: 300);
|
final thumbnail = img.copyResize(image, width: 300);
|
||||||
var uuid = Uuid().v4();
|
var uuid = Uuid().v4();
|
||||||
File("${dir.path}/$uuid.png")..writeAsBytesSync(img.encodePng(thumbnail));
|
File("${dir.path}/$uuid.png")..writeAsBytesSync(img.encodePng(thumbnail));
|
||||||
|
@ -968,7 +970,6 @@ class __NewPlaylistState extends State<_NewPlaylist> {
|
||||||
primaryColor = await _getColor(File(imagePath));
|
primaryColor = await _getColor(File(imagePath));
|
||||||
}
|
}
|
||||||
final fileName = path.split('/').last;
|
final fileName = path.split('/').last;
|
||||||
final metadata = await metadataRetriever.metadata;
|
|
||||||
return EpisodeBrief(
|
return EpisodeBrief(
|
||||||
fileName,
|
fileName,
|
||||||
'file://$path',
|
'file://$path',
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
|
|
||||||
import '../state/audio_state.dart';
|
import '../state/audio_state.dart';
|
||||||
import '../type/episodebrief.dart';
|
import '../type/episodebrief.dart';
|
||||||
|
|
|
@ -31,13 +31,15 @@ class Gpodder {
|
||||||
|
|
||||||
Future<void> _initDio() async {
|
Future<void> _initDio() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
_dio.interceptors.add(CookieManager(cookieJar));
|
_dio.interceptors.add(CookieManager(cookieJar));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> login({String username, String password}) async {
|
Future<int> login({String username, String password}) async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
cookieJar.delete(Uri.parse(_baseUrl));
|
cookieJar.delete(Uri.parse(_baseUrl));
|
||||||
_dio.interceptors.add(CookieManager(cookieJar));
|
_dio.interceptors.add(CookieManager(cookieJar));
|
||||||
final basicAuth =
|
final basicAuth =
|
||||||
|
@ -81,7 +83,8 @@ class Gpodder {
|
||||||
|
|
||||||
Future<void> _initService() async {
|
Future<void> _initService() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
cookieJar.delete(Uri.parse(_baseUrl));
|
cookieJar.delete(Uri.parse(_baseUrl));
|
||||||
await _storage.clearList();
|
await _storage.clearList();
|
||||||
await _addStorage.clearList();
|
await _addStorage.clearList();
|
||||||
|
|
|
@ -441,7 +441,7 @@ class HistoryChart extends StatelessWidget {
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
show: true,
|
show: true,
|
||||||
bottomTitles: SideTitles(
|
bottomTitles: SideTitles(
|
||||||
getTextStyles: (i) => TextStyle(
|
getTextStyles: (_, i) => TextStyle(
|
||||||
color: const Color(0xff67727d),
|
color: const Color(0xff67727d),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
@ -456,7 +456,7 @@ class HistoryChart extends StatelessWidget {
|
||||||
),
|
),
|
||||||
leftTitles: SideTitles(
|
leftTitles: SideTitles(
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
getTextStyles: (s) => TextStyle(
|
getTextStyles: (_, s) => TextStyle(
|
||||||
color: const Color(0xff67727d),
|
color: const Color(0xff67727d),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,6 +5,7 @@ import 'dart:ui';
|
||||||
import 'package:connectivity/connectivity.dart';
|
import 'package:connectivity/connectivity.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_downloader/flutter_downloader.dart';
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
@ -139,7 +140,8 @@ class SettingState extends ChangeNotifier {
|
||||||
ThemeMode get theme => _theme;
|
ThemeMode get theme => _theme;
|
||||||
|
|
||||||
ThemeData get lightTheme => ThemeData(
|
ThemeData get lightTheme => ThemeData(
|
||||||
accentColorBrightness: Brightness.dark,
|
colorScheme: ColorScheme.fromSwatch()
|
||||||
|
.copyWith(brightness: Brightness.light, secondary: _accentSetColor),
|
||||||
primaryColor: Colors.grey[100],
|
primaryColor: Colors.grey[100],
|
||||||
primaryColorLight: Colors.white,
|
primaryColorLight: Colors.white,
|
||||||
primaryColorDark: Colors.grey[300],
|
primaryColorDark: Colors.grey[300],
|
||||||
|
@ -148,7 +150,9 @@ class SettingState extends ChangeNotifier {
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
color: Colors.grey[100],
|
color: Colors.grey[100],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
titleTextStyle: TextStyle(color: Colors.black),
|
||||||
|
iconTheme: IconThemeData(color: Colors.black),
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle.dark),
|
||||||
textTheme: TextTheme(
|
textTheme: TextTheme(
|
||||||
bodyText2: TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal),
|
bodyText2: TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
|
@ -156,25 +160,31 @@ class SettingState extends ChangeNotifier {
|
||||||
labelColor: Colors.black,
|
labelColor: Colors.black,
|
||||||
unselectedLabelColor: Colors.grey[400],
|
unselectedLabelColor: Colors.grey[400],
|
||||||
),
|
),
|
||||||
accentColor: _accentSetColor,
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
cursorColor: _accentSetColor,
|
cursorColor: _accentSetColor,
|
||||||
textSelectionHandleColor: _accentSetColor,
|
selectionHandleColor: _accentSetColor,
|
||||||
|
),
|
||||||
toggleableActiveColor: _accentSetColor,
|
toggleableActiveColor: _accentSetColor,
|
||||||
buttonTheme: ButtonThemeData(
|
buttonTheme: ButtonThemeData(
|
||||||
height: 32,
|
height: 32,
|
||||||
hoverColor: _accentSetColor.withAlpha(70),
|
hoverColor: _accentSetColor.withAlpha(70),
|
||||||
splashColor: _accentSetColor.withAlpha(70)));
|
splashColor: _accentSetColor.withAlpha(70),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
ThemeData get darkTheme => ThemeData.dark().copyWith(
|
ThemeData get darkTheme => ThemeData.dark().copyWith(
|
||||||
accentColor: _accentSetColor,
|
colorScheme: ColorScheme.fromSwatch()
|
||||||
|
.copyWith(brightness: Brightness.dark, secondary: _accentSetColor),
|
||||||
primaryColorDark: Colors.grey[800],
|
primaryColorDark: Colors.grey[800],
|
||||||
scaffoldBackgroundColor: _realDark ? Colors.black87 : Color(0XFF212121),
|
scaffoldBackgroundColor: _realDark ? Colors.black87 : Color(0XFF212121),
|
||||||
primaryColor: _realDark ? Colors.black : Color(0XFF1B1B1B),
|
primaryColor: _realDark ? Colors.black : Color(0XFF1B1B1B),
|
||||||
popupMenuTheme: PopupMenuThemeData()
|
popupMenuTheme: PopupMenuThemeData()
|
||||||
.copyWith(color: _realDark ? Colors.grey[900] : null),
|
.copyWith(color: _realDark ? Colors.grey[900] : null),
|
||||||
appBarTheme: AppBarTheme(elevation: 0),
|
appBarTheme: AppBarTheme(
|
||||||
|
elevation: 0, systemOverlayStyle: SystemUiOverlayStyle.light),
|
||||||
buttonTheme: ButtonThemeData(height: 32),
|
buttonTheme: ButtonThemeData(height: 32),
|
||||||
dialogBackgroundColor: _realDark ? Colors.grey[900] : null,
|
dialogBackgroundColor: _realDark ? Colors.grey[900] : null,
|
||||||
cursorColor: _accentSetColor);
|
);
|
||||||
|
|
||||||
set setTheme(ThemeMode mode) {
|
set setTheme(ThemeMode mode) {
|
||||||
_theme = mode;
|
_theme = mode;
|
||||||
|
@ -558,8 +568,10 @@ class SettingState extends ChangeNotifier {
|
||||||
.getBool(defaultValue: false);
|
.getBool(defaultValue: false);
|
||||||
final deleteAfterPlayed = await KeyValueStorage(deleteAfterPlayedKey)
|
final deleteAfterPlayed = await KeyValueStorage(deleteAfterPlayedKey)
|
||||||
.getBool(defaultValue: false);
|
.getBool(defaultValue: false);
|
||||||
final openPlaylistDefault = await _openPlaylistDefaultStorage.getBool(defaultValue: false);
|
final openPlaylistDefault =
|
||||||
final openAllPodcastDefault = await _openAllPodcastDefaultStorage.getBool(defaultValue: false);
|
await _openPlaylistDefaultStorage.getBool(defaultValue: false);
|
||||||
|
final openAllPodcastDefault =
|
||||||
|
await _openAllPodcastDefaultStorage.getBool(defaultValue: false);
|
||||||
|
|
||||||
return SettingsBackup(
|
return SettingsBackup(
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
|
|
@ -56,7 +56,7 @@ class EpisodeBrief extends Equatable {
|
||||||
artist: feedTitle,
|
artist: feedTitle,
|
||||||
album: feedTitle,
|
album: feedTitle,
|
||||||
duration: Duration.zero,
|
duration: Duration.zero,
|
||||||
artUri: imagePath == '' ? episodeImage : 'file://$imagePath',
|
artUri: Uri.parse(imagePath == '' ? episodeImage : 'file://$imagePath'),
|
||||||
extras: {
|
extras: {
|
||||||
'skipSecondsStart': skipSecondsStart,
|
'skipSecondsStart': skipSecondsStart,
|
||||||
'skipSecondsEnd': skipSecondsEnd
|
'skipSecondsEnd': skipSecondsEnd
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
|
|
||||||
|
/// The DefaultCacheManager that can be easily used directly. The code of
|
||||||
|
/// this implementation can be used as inspiration for more complex cache
|
||||||
|
/// managers.
|
||||||
|
|
||||||
|
class CustomCacheManager extends CacheManager with ImageCacheManager {
|
||||||
|
static const key = 'libCachedImageData';
|
||||||
|
|
||||||
|
static final CustomCacheManager _instance = CustomCacheManager._();
|
||||||
|
factory CustomCacheManager() {
|
||||||
|
return _instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<FileInfo> downloadFile(String url,
|
||||||
|
{String key, Map<String, String> authHeaders, bool force = false}) async {
|
||||||
|
var file;
|
||||||
|
try {
|
||||||
|
file = await super
|
||||||
|
.downloadFile(url, key: key, authHeaders: authHeaders, force: force);
|
||||||
|
} catch (e) {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<FileResponse> getImageFile(
|
||||||
|
String url, {
|
||||||
|
String key,
|
||||||
|
Map<String, String> headers,
|
||||||
|
bool withProgress = false,
|
||||||
|
int maxHeight,
|
||||||
|
int maxWidth,
|
||||||
|
}) async* {
|
||||||
|
try {
|
||||||
|
super.getImageFile(url,
|
||||||
|
key: key,
|
||||||
|
headers: headers,
|
||||||
|
withProgress: withProgress,
|
||||||
|
maxHeight: maxHeight,
|
||||||
|
maxWidth: maxWidth);
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomCacheManager._() : super(Config(key));
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ import '../generated/l10n.dart';
|
||||||
|
|
||||||
extension ContextExtension on BuildContext {
|
extension ContextExtension on BuildContext {
|
||||||
Color get primaryColor => Theme.of(this).primaryColor;
|
Color get primaryColor => Theme.of(this).primaryColor;
|
||||||
Color get accentColor => Theme.of(this).accentColor;
|
Color get accentColor => Theme.of(this).colorScheme.secondary;
|
||||||
Color get scaffoldBackgroundColor => Theme.of(this).scaffoldBackgroundColor;
|
Color get scaffoldBackgroundColor => Theme.of(this).scaffoldBackgroundColor;
|
||||||
Color get primaryColorDark => Theme.of(this).primaryColorDark;
|
Color get primaryColorDark => Theme.of(this).primaryColorDark;
|
||||||
Color get textColor => Theme.of(this).textTheme.bodyText1.color;
|
Color get textColor => Theme.of(this).textTheme.bodyText1.color;
|
||||||
|
|
86
pubspec.yaml
86
pubspec.yaml
|
@ -12,71 +12,67 @@ dependencies:
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
auto_animated: ^3.0.0
|
auto_animated: ^3.0.0
|
||||||
audio_session: ^0.0.9
|
audio_session: ^0.1.0
|
||||||
cached_network_image: ^2.5.1
|
cached_network_image: ^3.1.0
|
||||||
color_thief_flutter: ^1.0.2
|
color_thief_flutter: ^1.0.2
|
||||||
confetti: ^0.5.5
|
confetti: ^0.5.5
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
connectivity: ^3.0.2
|
connectivity: ^3.0.3
|
||||||
crypto: ^3.0.0
|
crypto: ^3.0.1
|
||||||
device_info: ^2.0.0
|
device_info: ^2.0.2
|
||||||
dio: ^3.0.10
|
dio_cookie_manager: ^2.0.0
|
||||||
dio_cookie_manager: ^1.0.0
|
dio: ^4.0.0
|
||||||
extended_nested_scroll_view: ^3.0.0
|
extended_nested_scroll_view: ^3.0.0
|
||||||
effective_dart: ^1.3.1
|
effective_dart: ^1.3.1
|
||||||
equatable: ^1.2.5
|
feature_discovery: ^0.14.0
|
||||||
feature_discovery: ^0.13.0+2
|
file_picker: ^3.0.1
|
||||||
file_picker: ^2.1.4
|
flutter_html: 0.11.1
|
||||||
flutter_html: ^0.11.1
|
|
||||||
fluttertoast: ^4.0.1
|
fluttertoast: ^4.0.1
|
||||||
flutter_isolate: ^1.0.0+14
|
flutter_isolate: ^2.0.0
|
||||||
flutter_linkify: ^4.0.2
|
flutter_linkify: ^4.1.0
|
||||||
flutter_file_dialog: ^1.0.0
|
flutter_file_dialog: ^2.1.1
|
||||||
flare_flutter: ^2.0.6
|
flare_flutter: ^3.0.2
|
||||||
fl_chart: ^0.12.2
|
fl_chart: ^0.36.4
|
||||||
line_icons: ^1.3.2
|
line_icons: ^2.0.1
|
||||||
flutter_media_metadata: ^0.0.3+2
|
flutter_media_metadata: ^0.1.1
|
||||||
marquee: ^1.7.0
|
marquee: ^2.0.0
|
||||||
google_fonts: ^2.0.0
|
google_fonts: ^2.1.0
|
||||||
image: ^3.0.1
|
image: ^3.0.2
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
json_serializable: ^3.5.1
|
json_serializable: ^4.1.0
|
||||||
json_annotation: ^3.1.1
|
json_annotation: ^4.0.1
|
||||||
permission_handler: ^5.0.1
|
permission_handler: ^6.1.1
|
||||||
provider: ^4.3.2
|
provider: ^5.0.0
|
||||||
rxdart: ^0.24.1
|
sqflite: ^2.0.0+3
|
||||||
sqflite: ^1.3.2+1
|
state_notifier: ^0.7.0
|
||||||
state_notifier: ^0.6.0
|
tuple: ^2.0.0
|
||||||
tuple: ^1.0.3
|
url_launcher: ^6.0.3
|
||||||
url_launcher: ^5.7.10
|
uuid: ^3.0.4
|
||||||
workmanager: ^0.2.3
|
workmanager: ^0.2.3
|
||||||
wc_flutter_share: ^0.2.2
|
wc_flutter_share: ^0.4.0
|
||||||
|
xml: ^5.2.0
|
||||||
|
audio_service: 0.18.0
|
||||||
|
just_audio:
|
||||||
|
git:
|
||||||
|
url: https://github.com/stonega/just_audio_origin.git
|
||||||
|
ref: update
|
||||||
|
path: just_audio
|
||||||
flutter_downloader:
|
flutter_downloader:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/flutter_downloader.git
|
url: https://github.com/stonega/flutter_downloader.git
|
||||||
audio_service:
|
|
||||||
git:
|
|
||||||
url: https://github.com/stonega/audio_service.git
|
|
||||||
just_audio:
|
|
||||||
git:
|
|
||||||
url: https://github.com/stonega/just_audio.git
|
|
||||||
focused_menu:
|
focused_menu:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/focused_menu.git
|
url: https://github.com/stonega/focused_menu.git
|
||||||
webfeed:
|
webfeed:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/webfeed.git
|
url: https://github.com/stonega/webfeed.git
|
||||||
|
equatable: ^2.0.0
|
||||||
dependency_overrides:
|
|
||||||
path_provider: ^2.0.1
|
path_provider: ^2.0.1
|
||||||
http_parser: ^4.0.0
|
http_parser: ^4.0.0
|
||||||
cookie_jar: ^2.0.0
|
|
||||||
uuid: ^3.0.1
|
dependency_overrides:
|
||||||
http: ^0.13.0
|
meta: 1.3.0
|
||||||
flutter_cache_manager: ^2.1.2
|
|
||||||
shared_preferences: 2.0.0
|
shared_preferences: 2.0.0
|
||||||
convert: ^3.0.0
|
|
||||||
xml: ^5.0.2
|
|
||||||
linkify:
|
linkify:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/linkify.git
|
url: https://github.com/stonega/linkify.git
|
||||||
|
|
Loading…
Reference in New Issue