Minor change.

This commit is contained in:
stonegate 2020-08-13 17:59:15 +08:00
parent 90be28e6da
commit f37241d795
2 changed files with 13 additions and 1 deletions

View File

@ -292,6 +292,7 @@ class AudioPlayerNotifier extends ChangeNotifier {
_queue.playlist.removeAt(0);
_queue.playlist.removeWhere((item) => item == episode);
_queue.playlist.insert(0, episodeNew);
_queueUpdate != _queueUpdate;
_remoteErrorMessage = null;
notifyListeners();
await _queue.savePlaylist();

View File

@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:intl/intl.dart';
import 'package:intl/intl_standalone.dart';
import 'package:workmanager/workmanager.dart';
import '../generated/l10n.dart';
@ -343,7 +344,17 @@ class SettingState extends ChangeNotifier {
Future _getLocale() async {
var localeString = await localeStorage.getStringList();
if (localeString.isEmpty) {
_locale = Locale(Intl.systemLocale);
await findSystemLocale();
var systemLanCode;
final list = Intl.systemLocale.split('_');
if (list.length == 2) {
systemLanCode = list.first;
} else if (list.length == 3) {
systemLanCode = '${list[0]}_${list[1]}';
} else {
systemLanCode = 'en';
}
_locale = Locale(systemLanCode);
} else {
_locale = Locale(localeString.first, localeString[1]);
}