Player wakelock

This commit is contained in:
LittleSheep 2024-09-02 20:25:19 +08:00
parent da2a3508d1
commit a5f39321eb
10 changed files with 110 additions and 130 deletions

View File

@ -9,7 +9,6 @@ import 'package:rhythm_box/services/color.dart';
import 'package:rhythm_box/services/database/database.dart'; import 'package:rhythm_box/services/database/database.dart';
import 'package:rhythm_box/services/sourced_track/enums.dart'; import 'package:rhythm_box/services/sourced_track/enums.dart';
import 'package:spotify/spotify.dart'; import 'package:spotify/spotify.dart';
import 'package:window_manager/window_manager.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:path/path.dart'; import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
@ -49,14 +48,6 @@ class UserPreferencesProvider extends GetxController {
.listen((event) async { .listen((event) async {
state.value = event; state.value = event;
if (PlatformInfo.isDesktop) {
await windowManager.setTitleBarStyle(
state.value.systemTitleBar
? TitleBarStyle.normal
: TitleBarStyle.hidden,
);
}
await audioPlayer.setAudioNormalization(state.value.normalizeAudio); await audioPlayer.setAudioNormalization(state.value.normalizeAudio);
}); });
} }
@ -171,10 +162,6 @@ class UserPreferencesProvider extends GetxController {
setData(PreferencesTableCompanion(discordPresence: Value(discordPresence))); setData(PreferencesTableCompanion(discordPresence: Value(discordPresence)));
} }
void setAmoledDarkTheme(bool isAmoled) {
setData(PreferencesTableCompanion(amoledDarkTheme: Value(isAmoled)));
}
void setNormalizeAudio(bool normalize) { void setNormalizeAudio(bool normalize) {
setData(PreferencesTableCompanion(normalizeAudio: Value(normalize))); setData(PreferencesTableCompanion(normalizeAudio: Value(normalize)));
audioPlayer.setAudioNormalization(normalize); audioPlayer.setAudioNormalization(normalize);
@ -184,7 +171,7 @@ class UserPreferencesProvider extends GetxController {
setData(PreferencesTableCompanion(endlessPlayback: Value(endless))); setData(PreferencesTableCompanion(endlessPlayback: Value(endless)));
} }
void setEnableConnect(bool enable) { void setPlayerWakelock(bool wakelock) {
setData(PreferencesTableCompanion(enableConnect: Value(enable))); setData(PreferencesTableCompanion(playerWakelock: Value(wakelock)));
} }
} }

View File

@ -10,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:media_kit/media_kit.dart'; import 'package:media_kit/media_kit.dart';
import 'package:rhythm_box/providers/audio_player.dart'; import 'package:rhythm_box/providers/audio_player.dart';
import 'package:rhythm_box/providers/auth.dart'; import 'package:rhythm_box/providers/auth.dart';
import 'package:rhythm_box/providers/user_preferences.dart';
import 'package:rhythm_box/screens/player/queue.dart'; import 'package:rhythm_box/screens/player/queue.dart';
import 'package:rhythm_box/screens/player/siblings.dart'; import 'package:rhythm_box/screens/player/siblings.dart';
import 'package:rhythm_box/services/artist.dart'; import 'package:rhythm_box/services/artist.dart';
@ -20,6 +21,7 @@ import 'package:rhythm_box/services/audio_services/image.dart';
import 'package:rhythm_box/widgets/lyrics/synced_lyrics.dart'; import 'package:rhythm_box/widgets/lyrics/synced_lyrics.dart';
import 'package:rhythm_box/widgets/tracks/heart_button.dart'; import 'package:rhythm_box/widgets/tracks/heart_button.dart';
import 'package:rhythm_box/widgets/tracks/querying_track_info.dart'; import 'package:rhythm_box/widgets/tracks/querying_track_info.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
class PlayerScreen extends StatefulWidget { class PlayerScreen extends StatefulWidget {
const PlayerScreen({super.key}); const PlayerScreen({super.key});
@ -33,6 +35,8 @@ class _PlayerScreenState extends State<PlayerScreen> {
late final QueryingTrackInfoProvider _query = Get.find(); late final QueryingTrackInfoProvider _query = Get.find();
late final AuthenticationProvider _auth = Get.find(); late final AuthenticationProvider _auth = Get.find();
late final UserPreferencesProvider _preferences = Get.find();
String? get _albumArt => String? get _albumArt =>
(_playback.state.value.activeTrack?.album?.images).asUrlString( (_playback.state.value.activeTrack?.album?.images).asUrlString(
index: index:
@ -56,6 +60,20 @@ class _PlayerScreenState extends State<PlayerScreen> {
static const double maxAlbumSize = 360; static const double maxAlbumSize = 360;
@override
void activate() {
super.activate();
if (_preferences.state.value.playerWakelock) {
WakelockPlus.enable();
}
}
@override
void deactivate() {
super.deactivate();
WakelockPlus.disable();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;

View File

@ -123,6 +123,17 @@ class _SettingsScreenState extends State<SettingsScreen> {
onChanged: _preferences.setNormalizeAudio, onChanged: _preferences.setNormalizeAudio,
), ),
), ),
Obx(
() => SwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
secondary: const Icon(Icons.screen_lock_portrait),
title: const Text('Player Wakelock'),
subtitle: const Text(
'Keep your screen doesn\'t lock in player screen'),
value: _preferences.state.value.playerWakelock,
onChanged: _preferences.setPlayerWakelock,
),
),
const Divider(thickness: 0.3, height: 1), const Divider(thickness: 0.3, height: 1),
ListTile( ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 24), contentPadding: const EdgeInsets.symmetric(horizontal: 24),

View File

@ -317,16 +317,6 @@ class $PreferencesTableTable extends PreferencesTable
defaultConstraints: GeneratedColumn.constraintIsAlways( defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("album_color_sync" IN (0, 1))'), 'CHECK ("album_color_sync" IN (0, 1))'),
defaultValue: const Constant(true)); defaultValue: const Constant(true));
static const VerificationMeta _amoledDarkThemeMeta =
const VerificationMeta('amoledDarkTheme');
@override
late final GeneratedColumn<bool> amoledDarkTheme = GeneratedColumn<bool>(
'amoled_dark_theme', aliasedName, false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("amoled_dark_theme" IN (0, 1))'),
defaultValue: const Constant(false));
static const VerificationMeta _checkUpdateMeta = static const VerificationMeta _checkUpdateMeta =
const VerificationMeta('checkUpdate'); const VerificationMeta('checkUpdate');
@override @override
@ -524,22 +514,21 @@ class $PreferencesTableTable extends PreferencesTable
defaultConstraints: GeneratedColumn.constraintIsAlways( defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("endless_playback" IN (0, 1))'), 'CHECK ("endless_playback" IN (0, 1))'),
defaultValue: const Constant(true)); defaultValue: const Constant(true));
static const VerificationMeta _enableConnectMeta = static const VerificationMeta _playerWakelockMeta =
const VerificationMeta('enableConnect'); const VerificationMeta('playerWakelock');
@override @override
late final GeneratedColumn<bool> enableConnect = GeneratedColumn<bool>( late final GeneratedColumn<bool> playerWakelock = GeneratedColumn<bool>(
'enable_connect', aliasedName, false, 'player_wakelock', aliasedName, false,
type: DriftSqlType.bool, type: DriftSqlType.bool,
requiredDuringInsert: false, requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways( defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("enable_connect" IN (0, 1))'), 'CHECK ("player_wakelock" IN (0, 1))'),
defaultValue: const Constant(false)); defaultValue: const Constant(true));
@override @override
List<GeneratedColumn> get $columns => [ List<GeneratedColumn> get $columns => [
id, id,
audioQuality, audioQuality,
albumColorSync, albumColorSync,
amoledDarkTheme,
checkUpdate, checkUpdate,
normalizeAudio, normalizeAudio,
showSystemTrayIcon, showSystemTrayIcon,
@ -560,7 +549,7 @@ class $PreferencesTableTable extends PreferencesTable
downloadMusicCodec, downloadMusicCodec,
discordPresence, discordPresence,
endlessPlayback, endlessPlayback,
enableConnect playerWakelock
]; ];
@override @override
String get aliasedName => _alias ?? actualTableName; String get aliasedName => _alias ?? actualTableName;
@ -583,12 +572,6 @@ class $PreferencesTableTable extends PreferencesTable
albumColorSync.isAcceptableOrUnknown( albumColorSync.isAcceptableOrUnknown(
data['album_color_sync']!, _albumColorSyncMeta)); data['album_color_sync']!, _albumColorSyncMeta));
} }
if (data.containsKey('amoled_dark_theme')) {
context.handle(
_amoledDarkThemeMeta,
amoledDarkTheme.isAcceptableOrUnknown(
data['amoled_dark_theme']!, _amoledDarkThemeMeta));
}
if (data.containsKey('check_update')) { if (data.containsKey('check_update')) {
context.handle( context.handle(
_checkUpdateMeta, _checkUpdateMeta,
@ -655,11 +638,11 @@ class $PreferencesTableTable extends PreferencesTable
endlessPlayback.isAcceptableOrUnknown( endlessPlayback.isAcceptableOrUnknown(
data['endless_playback']!, _endlessPlaybackMeta)); data['endless_playback']!, _endlessPlaybackMeta));
} }
if (data.containsKey('enable_connect')) { if (data.containsKey('player_wakelock')) {
context.handle( context.handle(
_enableConnectMeta, _playerWakelockMeta,
enableConnect.isAcceptableOrUnknown( playerWakelock.isAcceptableOrUnknown(
data['enable_connect']!, _enableConnectMeta)); data['player_wakelock']!, _playerWakelockMeta));
} }
return context; return context;
} }
@ -677,8 +660,6 @@ class $PreferencesTableTable extends PreferencesTable
DriftSqlType.string, data['${effectivePrefix}audio_quality'])!), DriftSqlType.string, data['${effectivePrefix}audio_quality'])!),
albumColorSync: attachedDatabase.typeMapping albumColorSync: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}album_color_sync'])!, .read(DriftSqlType.bool, data['${effectivePrefix}album_color_sync'])!,
amoledDarkTheme: attachedDatabase.typeMapping.read(
DriftSqlType.bool, data['${effectivePrefix}amoled_dark_theme'])!,
checkUpdate: attachedDatabase.typeMapping checkUpdate: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}check_update'])!, .read(DriftSqlType.bool, data['${effectivePrefix}check_update'])!,
normalizeAudio: attachedDatabase.typeMapping normalizeAudio: attachedDatabase.typeMapping
@ -731,8 +712,8 @@ class $PreferencesTableTable extends PreferencesTable
.read(DriftSqlType.bool, data['${effectivePrefix}discord_presence'])!, .read(DriftSqlType.bool, data['${effectivePrefix}discord_presence'])!,
endlessPlayback: attachedDatabase.typeMapping endlessPlayback: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}endless_playback'])!, .read(DriftSqlType.bool, data['${effectivePrefix}endless_playback'])!,
enableConnect: attachedDatabase.typeMapping playerWakelock: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}enable_connect'])!, .read(DriftSqlType.bool, data['${effectivePrefix}player_wakelock'])!,
); );
} }
@ -776,7 +757,6 @@ class PreferencesTableData extends DataClass
final int id; final int id;
final SourceQualities audioQuality; final SourceQualities audioQuality;
final bool albumColorSync; final bool albumColorSync;
final bool amoledDarkTheme;
final bool checkUpdate; final bool checkUpdate;
final bool normalizeAudio; final bool normalizeAudio;
final bool showSystemTrayIcon; final bool showSystemTrayIcon;
@ -797,12 +777,11 @@ class PreferencesTableData extends DataClass
final SourceCodecs downloadMusicCodec; final SourceCodecs downloadMusicCodec;
final bool discordPresence; final bool discordPresence;
final bool endlessPlayback; final bool endlessPlayback;
final bool enableConnect; final bool playerWakelock;
const PreferencesTableData( const PreferencesTableData(
{required this.id, {required this.id,
required this.audioQuality, required this.audioQuality,
required this.albumColorSync, required this.albumColorSync,
required this.amoledDarkTheme,
required this.checkUpdate, required this.checkUpdate,
required this.normalizeAudio, required this.normalizeAudio,
required this.showSystemTrayIcon, required this.showSystemTrayIcon,
@ -823,7 +802,7 @@ class PreferencesTableData extends DataClass
required this.downloadMusicCodec, required this.downloadMusicCodec,
required this.discordPresence, required this.discordPresence,
required this.endlessPlayback, required this.endlessPlayback,
required this.enableConnect}); required this.playerWakelock});
@override @override
Map<String, Expression> toColumns(bool nullToAbsent) { Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{}; final map = <String, Expression>{};
@ -833,7 +812,6 @@ class PreferencesTableData extends DataClass
$PreferencesTableTable.$converteraudioQuality.toSql(audioQuality)); $PreferencesTableTable.$converteraudioQuality.toSql(audioQuality));
} }
map['album_color_sync'] = Variable<bool>(albumColorSync); map['album_color_sync'] = Variable<bool>(albumColorSync);
map['amoled_dark_theme'] = Variable<bool>(amoledDarkTheme);
map['check_update'] = Variable<bool>(checkUpdate); map['check_update'] = Variable<bool>(checkUpdate);
map['normalize_audio'] = Variable<bool>(normalizeAudio); map['normalize_audio'] = Variable<bool>(normalizeAudio);
map['show_system_tray_icon'] = Variable<bool>(showSystemTrayIcon); map['show_system_tray_icon'] = Variable<bool>(showSystemTrayIcon);
@ -891,7 +869,7 @@ class PreferencesTableData extends DataClass
} }
map['discord_presence'] = Variable<bool>(discordPresence); map['discord_presence'] = Variable<bool>(discordPresence);
map['endless_playback'] = Variable<bool>(endlessPlayback); map['endless_playback'] = Variable<bool>(endlessPlayback);
map['enable_connect'] = Variable<bool>(enableConnect); map['player_wakelock'] = Variable<bool>(playerWakelock);
return map; return map;
} }
@ -900,7 +878,6 @@ class PreferencesTableData extends DataClass
id: Value(id), id: Value(id),
audioQuality: Value(audioQuality), audioQuality: Value(audioQuality),
albumColorSync: Value(albumColorSync), albumColorSync: Value(albumColorSync),
amoledDarkTheme: Value(amoledDarkTheme),
checkUpdate: Value(checkUpdate), checkUpdate: Value(checkUpdate),
normalizeAudio: Value(normalizeAudio), normalizeAudio: Value(normalizeAudio),
showSystemTrayIcon: Value(showSystemTrayIcon), showSystemTrayIcon: Value(showSystemTrayIcon),
@ -921,7 +898,7 @@ class PreferencesTableData extends DataClass
downloadMusicCodec: Value(downloadMusicCodec), downloadMusicCodec: Value(downloadMusicCodec),
discordPresence: Value(discordPresence), discordPresence: Value(discordPresence),
endlessPlayback: Value(endlessPlayback), endlessPlayback: Value(endlessPlayback),
enableConnect: Value(enableConnect), playerWakelock: Value(playerWakelock),
); );
} }
@ -933,7 +910,6 @@ class PreferencesTableData extends DataClass
audioQuality: $PreferencesTableTable.$converteraudioQuality audioQuality: $PreferencesTableTable.$converteraudioQuality
.fromJson(serializer.fromJson<String>(json['audioQuality'])), .fromJson(serializer.fromJson<String>(json['audioQuality'])),
albumColorSync: serializer.fromJson<bool>(json['albumColorSync']), albumColorSync: serializer.fromJson<bool>(json['albumColorSync']),
amoledDarkTheme: serializer.fromJson<bool>(json['amoledDarkTheme']),
checkUpdate: serializer.fromJson<bool>(json['checkUpdate']), checkUpdate: serializer.fromJson<bool>(json['checkUpdate']),
normalizeAudio: serializer.fromJson<bool>(json['normalizeAudio']), normalizeAudio: serializer.fromJson<bool>(json['normalizeAudio']),
showSystemTrayIcon: serializer.fromJson<bool>(json['showSystemTrayIcon']), showSystemTrayIcon: serializer.fromJson<bool>(json['showSystemTrayIcon']),
@ -964,7 +940,7 @@ class PreferencesTableData extends DataClass
.fromJson(serializer.fromJson<String>(json['downloadMusicCodec'])), .fromJson(serializer.fromJson<String>(json['downloadMusicCodec'])),
discordPresence: serializer.fromJson<bool>(json['discordPresence']), discordPresence: serializer.fromJson<bool>(json['discordPresence']),
endlessPlayback: serializer.fromJson<bool>(json['endlessPlayback']), endlessPlayback: serializer.fromJson<bool>(json['endlessPlayback']),
enableConnect: serializer.fromJson<bool>(json['enableConnect']), playerWakelock: serializer.fromJson<bool>(json['playerWakelock']),
); );
} }
@override @override
@ -975,7 +951,6 @@ class PreferencesTableData extends DataClass
'audioQuality': serializer.toJson<String>( 'audioQuality': serializer.toJson<String>(
$PreferencesTableTable.$converteraudioQuality.toJson(audioQuality)), $PreferencesTableTable.$converteraudioQuality.toJson(audioQuality)),
'albumColorSync': serializer.toJson<bool>(albumColorSync), 'albumColorSync': serializer.toJson<bool>(albumColorSync),
'amoledDarkTheme': serializer.toJson<bool>(amoledDarkTheme),
'checkUpdate': serializer.toJson<bool>(checkUpdate), 'checkUpdate': serializer.toJson<bool>(checkUpdate),
'normalizeAudio': serializer.toJson<bool>(normalizeAudio), 'normalizeAudio': serializer.toJson<bool>(normalizeAudio),
'showSystemTrayIcon': serializer.toJson<bool>(showSystemTrayIcon), 'showSystemTrayIcon': serializer.toJson<bool>(showSystemTrayIcon),
@ -1007,7 +982,7 @@ class PreferencesTableData extends DataClass
.toJson(downloadMusicCodec)), .toJson(downloadMusicCodec)),
'discordPresence': serializer.toJson<bool>(discordPresence), 'discordPresence': serializer.toJson<bool>(discordPresence),
'endlessPlayback': serializer.toJson<bool>(endlessPlayback), 'endlessPlayback': serializer.toJson<bool>(endlessPlayback),
'enableConnect': serializer.toJson<bool>(enableConnect), 'playerWakelock': serializer.toJson<bool>(playerWakelock),
}; };
} }
@ -1015,7 +990,6 @@ class PreferencesTableData extends DataClass
{int? id, {int? id,
SourceQualities? audioQuality, SourceQualities? audioQuality,
bool? albumColorSync, bool? albumColorSync,
bool? amoledDarkTheme,
bool? checkUpdate, bool? checkUpdate,
bool? normalizeAudio, bool? normalizeAudio,
bool? showSystemTrayIcon, bool? showSystemTrayIcon,
@ -1036,12 +1010,11 @@ class PreferencesTableData extends DataClass
SourceCodecs? downloadMusicCodec, SourceCodecs? downloadMusicCodec,
bool? discordPresence, bool? discordPresence,
bool? endlessPlayback, bool? endlessPlayback,
bool? enableConnect}) => bool? playerWakelock}) =>
PreferencesTableData( PreferencesTableData(
id: id ?? this.id, id: id ?? this.id,
audioQuality: audioQuality ?? this.audioQuality, audioQuality: audioQuality ?? this.audioQuality,
albumColorSync: albumColorSync ?? this.albumColorSync, albumColorSync: albumColorSync ?? this.albumColorSync,
amoledDarkTheme: amoledDarkTheme ?? this.amoledDarkTheme,
checkUpdate: checkUpdate ?? this.checkUpdate, checkUpdate: checkUpdate ?? this.checkUpdate,
normalizeAudio: normalizeAudio ?? this.normalizeAudio, normalizeAudio: normalizeAudio ?? this.normalizeAudio,
showSystemTrayIcon: showSystemTrayIcon ?? this.showSystemTrayIcon, showSystemTrayIcon: showSystemTrayIcon ?? this.showSystemTrayIcon,
@ -1062,7 +1035,7 @@ class PreferencesTableData extends DataClass
downloadMusicCodec: downloadMusicCodec ?? this.downloadMusicCodec, downloadMusicCodec: downloadMusicCodec ?? this.downloadMusicCodec,
discordPresence: discordPresence ?? this.discordPresence, discordPresence: discordPresence ?? this.discordPresence,
endlessPlayback: endlessPlayback ?? this.endlessPlayback, endlessPlayback: endlessPlayback ?? this.endlessPlayback,
enableConnect: enableConnect ?? this.enableConnect, playerWakelock: playerWakelock ?? this.playerWakelock,
); );
PreferencesTableData copyWithCompanion(PreferencesTableCompanion data) { PreferencesTableData copyWithCompanion(PreferencesTableCompanion data) {
return PreferencesTableData( return PreferencesTableData(
@ -1073,9 +1046,6 @@ class PreferencesTableData extends DataClass
albumColorSync: data.albumColorSync.present albumColorSync: data.albumColorSync.present
? data.albumColorSync.value ? data.albumColorSync.value
: this.albumColorSync, : this.albumColorSync,
amoledDarkTheme: data.amoledDarkTheme.present
? data.amoledDarkTheme.value
: this.amoledDarkTheme,
checkUpdate: checkUpdate:
data.checkUpdate.present ? data.checkUpdate.value : this.checkUpdate, data.checkUpdate.present ? data.checkUpdate.value : this.checkUpdate,
normalizeAudio: data.normalizeAudio.present normalizeAudio: data.normalizeAudio.present
@ -1126,9 +1096,9 @@ class PreferencesTableData extends DataClass
endlessPlayback: data.endlessPlayback.present endlessPlayback: data.endlessPlayback.present
? data.endlessPlayback.value ? data.endlessPlayback.value
: this.endlessPlayback, : this.endlessPlayback,
enableConnect: data.enableConnect.present playerWakelock: data.playerWakelock.present
? data.enableConnect.value ? data.playerWakelock.value
: this.enableConnect, : this.playerWakelock,
); );
} }
@ -1138,7 +1108,6 @@ class PreferencesTableData extends DataClass
..write('id: $id, ') ..write('id: $id, ')
..write('audioQuality: $audioQuality, ') ..write('audioQuality: $audioQuality, ')
..write('albumColorSync: $albumColorSync, ') ..write('albumColorSync: $albumColorSync, ')
..write('amoledDarkTheme: $amoledDarkTheme, ')
..write('checkUpdate: $checkUpdate, ') ..write('checkUpdate: $checkUpdate, ')
..write('normalizeAudio: $normalizeAudio, ') ..write('normalizeAudio: $normalizeAudio, ')
..write('showSystemTrayIcon: $showSystemTrayIcon, ') ..write('showSystemTrayIcon: $showSystemTrayIcon, ')
@ -1159,7 +1128,7 @@ class PreferencesTableData extends DataClass
..write('downloadMusicCodec: $downloadMusicCodec, ') ..write('downloadMusicCodec: $downloadMusicCodec, ')
..write('discordPresence: $discordPresence, ') ..write('discordPresence: $discordPresence, ')
..write('endlessPlayback: $endlessPlayback, ') ..write('endlessPlayback: $endlessPlayback, ')
..write('enableConnect: $enableConnect') ..write('playerWakelock: $playerWakelock')
..write(')')) ..write(')'))
.toString(); .toString();
} }
@ -1169,7 +1138,6 @@ class PreferencesTableData extends DataClass
id, id,
audioQuality, audioQuality,
albumColorSync, albumColorSync,
amoledDarkTheme,
checkUpdate, checkUpdate,
normalizeAudio, normalizeAudio,
showSystemTrayIcon, showSystemTrayIcon,
@ -1190,7 +1158,7 @@ class PreferencesTableData extends DataClass
downloadMusicCodec, downloadMusicCodec,
discordPresence, discordPresence,
endlessPlayback, endlessPlayback,
enableConnect playerWakelock
]); ]);
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
@ -1199,7 +1167,6 @@ class PreferencesTableData extends DataClass
other.id == this.id && other.id == this.id &&
other.audioQuality == this.audioQuality && other.audioQuality == this.audioQuality &&
other.albumColorSync == this.albumColorSync && other.albumColorSync == this.albumColorSync &&
other.amoledDarkTheme == this.amoledDarkTheme &&
other.checkUpdate == this.checkUpdate && other.checkUpdate == this.checkUpdate &&
other.normalizeAudio == this.normalizeAudio && other.normalizeAudio == this.normalizeAudio &&
other.showSystemTrayIcon == this.showSystemTrayIcon && other.showSystemTrayIcon == this.showSystemTrayIcon &&
@ -1220,14 +1187,13 @@ class PreferencesTableData extends DataClass
other.downloadMusicCodec == this.downloadMusicCodec && other.downloadMusicCodec == this.downloadMusicCodec &&
other.discordPresence == this.discordPresence && other.discordPresence == this.discordPresence &&
other.endlessPlayback == this.endlessPlayback && other.endlessPlayback == this.endlessPlayback &&
other.enableConnect == this.enableConnect); other.playerWakelock == this.playerWakelock);
} }
class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> { class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
final Value<int> id; final Value<int> id;
final Value<SourceQualities> audioQuality; final Value<SourceQualities> audioQuality;
final Value<bool> albumColorSync; final Value<bool> albumColorSync;
final Value<bool> amoledDarkTheme;
final Value<bool> checkUpdate; final Value<bool> checkUpdate;
final Value<bool> normalizeAudio; final Value<bool> normalizeAudio;
final Value<bool> showSystemTrayIcon; final Value<bool> showSystemTrayIcon;
@ -1248,12 +1214,11 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
final Value<SourceCodecs> downloadMusicCodec; final Value<SourceCodecs> downloadMusicCodec;
final Value<bool> discordPresence; final Value<bool> discordPresence;
final Value<bool> endlessPlayback; final Value<bool> endlessPlayback;
final Value<bool> enableConnect; final Value<bool> playerWakelock;
const PreferencesTableCompanion({ const PreferencesTableCompanion({
this.id = const Value.absent(), this.id = const Value.absent(),
this.audioQuality = const Value.absent(), this.audioQuality = const Value.absent(),
this.albumColorSync = const Value.absent(), this.albumColorSync = const Value.absent(),
this.amoledDarkTheme = const Value.absent(),
this.checkUpdate = const Value.absent(), this.checkUpdate = const Value.absent(),
this.normalizeAudio = const Value.absent(), this.normalizeAudio = const Value.absent(),
this.showSystemTrayIcon = const Value.absent(), this.showSystemTrayIcon = const Value.absent(),
@ -1274,13 +1239,12 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
this.downloadMusicCodec = const Value.absent(), this.downloadMusicCodec = const Value.absent(),
this.discordPresence = const Value.absent(), this.discordPresence = const Value.absent(),
this.endlessPlayback = const Value.absent(), this.endlessPlayback = const Value.absent(),
this.enableConnect = const Value.absent(), this.playerWakelock = const Value.absent(),
}); });
PreferencesTableCompanion.insert({ PreferencesTableCompanion.insert({
this.id = const Value.absent(), this.id = const Value.absent(),
this.audioQuality = const Value.absent(), this.audioQuality = const Value.absent(),
this.albumColorSync = const Value.absent(), this.albumColorSync = const Value.absent(),
this.amoledDarkTheme = const Value.absent(),
this.checkUpdate = const Value.absent(), this.checkUpdate = const Value.absent(),
this.normalizeAudio = const Value.absent(), this.normalizeAudio = const Value.absent(),
this.showSystemTrayIcon = const Value.absent(), this.showSystemTrayIcon = const Value.absent(),
@ -1301,13 +1265,12 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
this.downloadMusicCodec = const Value.absent(), this.downloadMusicCodec = const Value.absent(),
this.discordPresence = const Value.absent(), this.discordPresence = const Value.absent(),
this.endlessPlayback = const Value.absent(), this.endlessPlayback = const Value.absent(),
this.enableConnect = const Value.absent(), this.playerWakelock = const Value.absent(),
}); });
static Insertable<PreferencesTableData> custom({ static Insertable<PreferencesTableData> custom({
Expression<int>? id, Expression<int>? id,
Expression<String>? audioQuality, Expression<String>? audioQuality,
Expression<bool>? albumColorSync, Expression<bool>? albumColorSync,
Expression<bool>? amoledDarkTheme,
Expression<bool>? checkUpdate, Expression<bool>? checkUpdate,
Expression<bool>? normalizeAudio, Expression<bool>? normalizeAudio,
Expression<bool>? showSystemTrayIcon, Expression<bool>? showSystemTrayIcon,
@ -1328,13 +1291,12 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
Expression<String>? downloadMusicCodec, Expression<String>? downloadMusicCodec,
Expression<bool>? discordPresence, Expression<bool>? discordPresence,
Expression<bool>? endlessPlayback, Expression<bool>? endlessPlayback,
Expression<bool>? enableConnect, Expression<bool>? playerWakelock,
}) { }) {
return RawValuesInsertable({ return RawValuesInsertable({
if (id != null) 'id': id, if (id != null) 'id': id,
if (audioQuality != null) 'audio_quality': audioQuality, if (audioQuality != null) 'audio_quality': audioQuality,
if (albumColorSync != null) 'album_color_sync': albumColorSync, if (albumColorSync != null) 'album_color_sync': albumColorSync,
if (amoledDarkTheme != null) 'amoled_dark_theme': amoledDarkTheme,
if (checkUpdate != null) 'check_update': checkUpdate, if (checkUpdate != null) 'check_update': checkUpdate,
if (normalizeAudio != null) 'normalize_audio': normalizeAudio, if (normalizeAudio != null) 'normalize_audio': normalizeAudio,
if (showSystemTrayIcon != null) if (showSystemTrayIcon != null)
@ -1358,7 +1320,7 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
'download_music_codec': downloadMusicCodec, 'download_music_codec': downloadMusicCodec,
if (discordPresence != null) 'discord_presence': discordPresence, if (discordPresence != null) 'discord_presence': discordPresence,
if (endlessPlayback != null) 'endless_playback': endlessPlayback, if (endlessPlayback != null) 'endless_playback': endlessPlayback,
if (enableConnect != null) 'enable_connect': enableConnect, if (playerWakelock != null) 'player_wakelock': playerWakelock,
}); });
} }
@ -1366,7 +1328,6 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
{Value<int>? id, {Value<int>? id,
Value<SourceQualities>? audioQuality, Value<SourceQualities>? audioQuality,
Value<bool>? albumColorSync, Value<bool>? albumColorSync,
Value<bool>? amoledDarkTheme,
Value<bool>? checkUpdate, Value<bool>? checkUpdate,
Value<bool>? normalizeAudio, Value<bool>? normalizeAudio,
Value<bool>? showSystemTrayIcon, Value<bool>? showSystemTrayIcon,
@ -1387,12 +1348,11 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
Value<SourceCodecs>? downloadMusicCodec, Value<SourceCodecs>? downloadMusicCodec,
Value<bool>? discordPresence, Value<bool>? discordPresence,
Value<bool>? endlessPlayback, Value<bool>? endlessPlayback,
Value<bool>? enableConnect}) { Value<bool>? playerWakelock}) {
return PreferencesTableCompanion( return PreferencesTableCompanion(
id: id ?? this.id, id: id ?? this.id,
audioQuality: audioQuality ?? this.audioQuality, audioQuality: audioQuality ?? this.audioQuality,
albumColorSync: albumColorSync ?? this.albumColorSync, albumColorSync: albumColorSync ?? this.albumColorSync,
amoledDarkTheme: amoledDarkTheme ?? this.amoledDarkTheme,
checkUpdate: checkUpdate ?? this.checkUpdate, checkUpdate: checkUpdate ?? this.checkUpdate,
normalizeAudio: normalizeAudio ?? this.normalizeAudio, normalizeAudio: normalizeAudio ?? this.normalizeAudio,
showSystemTrayIcon: showSystemTrayIcon ?? this.showSystemTrayIcon, showSystemTrayIcon: showSystemTrayIcon ?? this.showSystemTrayIcon,
@ -1413,7 +1373,7 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
downloadMusicCodec: downloadMusicCodec ?? this.downloadMusicCodec, downloadMusicCodec: downloadMusicCodec ?? this.downloadMusicCodec,
discordPresence: discordPresence ?? this.discordPresence, discordPresence: discordPresence ?? this.discordPresence,
endlessPlayback: endlessPlayback ?? this.endlessPlayback, endlessPlayback: endlessPlayback ?? this.endlessPlayback,
enableConnect: enableConnect ?? this.enableConnect, playerWakelock: playerWakelock ?? this.playerWakelock,
); );
} }
@ -1431,9 +1391,6 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
if (albumColorSync.present) { if (albumColorSync.present) {
map['album_color_sync'] = Variable<bool>(albumColorSync.value); map['album_color_sync'] = Variable<bool>(albumColorSync.value);
} }
if (amoledDarkTheme.present) {
map['amoled_dark_theme'] = Variable<bool>(amoledDarkTheme.value);
}
if (checkUpdate.present) { if (checkUpdate.present) {
map['check_update'] = Variable<bool>(checkUpdate.value); map['check_update'] = Variable<bool>(checkUpdate.value);
} }
@ -1511,8 +1468,8 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
if (endlessPlayback.present) { if (endlessPlayback.present) {
map['endless_playback'] = Variable<bool>(endlessPlayback.value); map['endless_playback'] = Variable<bool>(endlessPlayback.value);
} }
if (enableConnect.present) { if (playerWakelock.present) {
map['enable_connect'] = Variable<bool>(enableConnect.value); map['player_wakelock'] = Variable<bool>(playerWakelock.value);
} }
return map; return map;
} }
@ -1523,7 +1480,6 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
..write('id: $id, ') ..write('id: $id, ')
..write('audioQuality: $audioQuality, ') ..write('audioQuality: $audioQuality, ')
..write('albumColorSync: $albumColorSync, ') ..write('albumColorSync: $albumColorSync, ')
..write('amoledDarkTheme: $amoledDarkTheme, ')
..write('checkUpdate: $checkUpdate, ') ..write('checkUpdate: $checkUpdate, ')
..write('normalizeAudio: $normalizeAudio, ') ..write('normalizeAudio: $normalizeAudio, ')
..write('showSystemTrayIcon: $showSystemTrayIcon, ') ..write('showSystemTrayIcon: $showSystemTrayIcon, ')
@ -1544,7 +1500,7 @@ class PreferencesTableCompanion extends UpdateCompanion<PreferencesTableData> {
..write('downloadMusicCodec: $downloadMusicCodec, ') ..write('downloadMusicCodec: $downloadMusicCodec, ')
..write('discordPresence: $discordPresence, ') ..write('discordPresence: $discordPresence, ')
..write('endlessPlayback: $endlessPlayback, ') ..write('endlessPlayback: $endlessPlayback, ')
..write('enableConnect: $enableConnect') ..write('playerWakelock: $playerWakelock')
..write(')')) ..write(')'))
.toString(); .toString();
} }
@ -3980,7 +3936,6 @@ typedef $$PreferencesTableTableCreateCompanionBuilder
Value<int> id, Value<int> id,
Value<SourceQualities> audioQuality, Value<SourceQualities> audioQuality,
Value<bool> albumColorSync, Value<bool> albumColorSync,
Value<bool> amoledDarkTheme,
Value<bool> checkUpdate, Value<bool> checkUpdate,
Value<bool> normalizeAudio, Value<bool> normalizeAudio,
Value<bool> showSystemTrayIcon, Value<bool> showSystemTrayIcon,
@ -4001,14 +3956,13 @@ typedef $$PreferencesTableTableCreateCompanionBuilder
Value<SourceCodecs> downloadMusicCodec, Value<SourceCodecs> downloadMusicCodec,
Value<bool> discordPresence, Value<bool> discordPresence,
Value<bool> endlessPlayback, Value<bool> endlessPlayback,
Value<bool> enableConnect, Value<bool> playerWakelock,
}); });
typedef $$PreferencesTableTableUpdateCompanionBuilder typedef $$PreferencesTableTableUpdateCompanionBuilder
= PreferencesTableCompanion Function({ = PreferencesTableCompanion Function({
Value<int> id, Value<int> id,
Value<SourceQualities> audioQuality, Value<SourceQualities> audioQuality,
Value<bool> albumColorSync, Value<bool> albumColorSync,
Value<bool> amoledDarkTheme,
Value<bool> checkUpdate, Value<bool> checkUpdate,
Value<bool> normalizeAudio, Value<bool> normalizeAudio,
Value<bool> showSystemTrayIcon, Value<bool> showSystemTrayIcon,
@ -4029,7 +3983,7 @@ typedef $$PreferencesTableTableUpdateCompanionBuilder
Value<SourceCodecs> downloadMusicCodec, Value<SourceCodecs> downloadMusicCodec,
Value<bool> discordPresence, Value<bool> discordPresence,
Value<bool> endlessPlayback, Value<bool> endlessPlayback,
Value<bool> enableConnect, Value<bool> playerWakelock,
}); });
class $$PreferencesTableTableTableManager extends RootTableManager< class $$PreferencesTableTableTableManager extends RootTableManager<
@ -4053,7 +4007,6 @@ class $$PreferencesTableTableTableManager extends RootTableManager<
Value<int> id = const Value.absent(), Value<int> id = const Value.absent(),
Value<SourceQualities> audioQuality = const Value.absent(), Value<SourceQualities> audioQuality = const Value.absent(),
Value<bool> albumColorSync = const Value.absent(), Value<bool> albumColorSync = const Value.absent(),
Value<bool> amoledDarkTheme = const Value.absent(),
Value<bool> checkUpdate = const Value.absent(), Value<bool> checkUpdate = const Value.absent(),
Value<bool> normalizeAudio = const Value.absent(), Value<bool> normalizeAudio = const Value.absent(),
Value<bool> showSystemTrayIcon = const Value.absent(), Value<bool> showSystemTrayIcon = const Value.absent(),
@ -4074,13 +4027,12 @@ class $$PreferencesTableTableTableManager extends RootTableManager<
Value<SourceCodecs> downloadMusicCodec = const Value.absent(), Value<SourceCodecs> downloadMusicCodec = const Value.absent(),
Value<bool> discordPresence = const Value.absent(), Value<bool> discordPresence = const Value.absent(),
Value<bool> endlessPlayback = const Value.absent(), Value<bool> endlessPlayback = const Value.absent(),
Value<bool> enableConnect = const Value.absent(), Value<bool> playerWakelock = const Value.absent(),
}) => }) =>
PreferencesTableCompanion( PreferencesTableCompanion(
id: id, id: id,
audioQuality: audioQuality, audioQuality: audioQuality,
albumColorSync: albumColorSync, albumColorSync: albumColorSync,
amoledDarkTheme: amoledDarkTheme,
checkUpdate: checkUpdate, checkUpdate: checkUpdate,
normalizeAudio: normalizeAudio, normalizeAudio: normalizeAudio,
showSystemTrayIcon: showSystemTrayIcon, showSystemTrayIcon: showSystemTrayIcon,
@ -4101,13 +4053,12 @@ class $$PreferencesTableTableTableManager extends RootTableManager<
downloadMusicCodec: downloadMusicCodec, downloadMusicCodec: downloadMusicCodec,
discordPresence: discordPresence, discordPresence: discordPresence,
endlessPlayback: endlessPlayback, endlessPlayback: endlessPlayback,
enableConnect: enableConnect, playerWakelock: playerWakelock,
), ),
createCompanionCallback: ({ createCompanionCallback: ({
Value<int> id = const Value.absent(), Value<int> id = const Value.absent(),
Value<SourceQualities> audioQuality = const Value.absent(), Value<SourceQualities> audioQuality = const Value.absent(),
Value<bool> albumColorSync = const Value.absent(), Value<bool> albumColorSync = const Value.absent(),
Value<bool> amoledDarkTheme = const Value.absent(),
Value<bool> checkUpdate = const Value.absent(), Value<bool> checkUpdate = const Value.absent(),
Value<bool> normalizeAudio = const Value.absent(), Value<bool> normalizeAudio = const Value.absent(),
Value<bool> showSystemTrayIcon = const Value.absent(), Value<bool> showSystemTrayIcon = const Value.absent(),
@ -4128,13 +4079,12 @@ class $$PreferencesTableTableTableManager extends RootTableManager<
Value<SourceCodecs> downloadMusicCodec = const Value.absent(), Value<SourceCodecs> downloadMusicCodec = const Value.absent(),
Value<bool> discordPresence = const Value.absent(), Value<bool> discordPresence = const Value.absent(),
Value<bool> endlessPlayback = const Value.absent(), Value<bool> endlessPlayback = const Value.absent(),
Value<bool> enableConnect = const Value.absent(), Value<bool> playerWakelock = const Value.absent(),
}) => }) =>
PreferencesTableCompanion.insert( PreferencesTableCompanion.insert(
id: id, id: id,
audioQuality: audioQuality, audioQuality: audioQuality,
albumColorSync: albumColorSync, albumColorSync: albumColorSync,
amoledDarkTheme: amoledDarkTheme,
checkUpdate: checkUpdate, checkUpdate: checkUpdate,
normalizeAudio: normalizeAudio, normalizeAudio: normalizeAudio,
showSystemTrayIcon: showSystemTrayIcon, showSystemTrayIcon: showSystemTrayIcon,
@ -4155,7 +4105,7 @@ class $$PreferencesTableTableTableManager extends RootTableManager<
downloadMusicCodec: downloadMusicCodec, downloadMusicCodec: downloadMusicCodec,
discordPresence: discordPresence, discordPresence: discordPresence,
endlessPlayback: endlessPlayback, endlessPlayback: endlessPlayback,
enableConnect: enableConnect, playerWakelock: playerWakelock,
), ),
)); ));
} }
@ -4180,11 +4130,6 @@ class $$PreferencesTableTableFilterComposer
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnFilters(column, joinBuilders: joinBuilders)); ColumnFilters(column, joinBuilders: joinBuilders));
ColumnFilters<bool> get amoledDarkTheme => $state.composableBuilder(
column: $state.table.amoledDarkTheme,
builder: (column, joinBuilders) =>
ColumnFilters(column, joinBuilders: joinBuilders));
ColumnFilters<bool> get checkUpdate => $state.composableBuilder( ColumnFilters<bool> get checkUpdate => $state.composableBuilder(
column: $state.table.checkUpdate, column: $state.table.checkUpdate,
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
@ -4307,8 +4252,8 @@ class $$PreferencesTableTableFilterComposer
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnFilters(column, joinBuilders: joinBuilders)); ColumnFilters(column, joinBuilders: joinBuilders));
ColumnFilters<bool> get enableConnect => $state.composableBuilder( ColumnFilters<bool> get playerWakelock => $state.composableBuilder(
column: $state.table.enableConnect, column: $state.table.playerWakelock,
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnFilters(column, joinBuilders: joinBuilders)); ColumnFilters(column, joinBuilders: joinBuilders));
} }
@ -4331,11 +4276,6 @@ class $$PreferencesTableTableOrderingComposer
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnOrderings(column, joinBuilders: joinBuilders)); ColumnOrderings(column, joinBuilders: joinBuilders));
ColumnOrderings<bool> get amoledDarkTheme => $state.composableBuilder(
column: $state.table.amoledDarkTheme,
builder: (column, joinBuilders) =>
ColumnOrderings(column, joinBuilders: joinBuilders));
ColumnOrderings<bool> get checkUpdate => $state.composableBuilder( ColumnOrderings<bool> get checkUpdate => $state.composableBuilder(
column: $state.table.checkUpdate, column: $state.table.checkUpdate,
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
@ -4436,8 +4376,8 @@ class $$PreferencesTableTableOrderingComposer
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnOrderings(column, joinBuilders: joinBuilders)); ColumnOrderings(column, joinBuilders: joinBuilders));
ColumnOrderings<bool> get enableConnect => $state.composableBuilder( ColumnOrderings<bool> get playerWakelock => $state.composableBuilder(
column: $state.table.enableConnect, column: $state.table.playerWakelock,
builder: (column, joinBuilders) => builder: (column, joinBuilders) =>
ColumnOrderings(column, joinBuilders: joinBuilders)); ColumnOrderings(column, joinBuilders: joinBuilders));
} }

View File

@ -45,8 +45,6 @@ class PreferencesTable extends Table {
.withDefault(Constant(SourceQualities.high.name))(); .withDefault(Constant(SourceQualities.high.name))();
BoolColumn get albumColorSync => BoolColumn get albumColorSync =>
boolean().withDefault(const Constant(true))(); boolean().withDefault(const Constant(true))();
BoolColumn get amoledDarkTheme =>
boolean().withDefault(const Constant(false))();
BoolColumn get checkUpdate => boolean().withDefault(const Constant(true))(); BoolColumn get checkUpdate => boolean().withDefault(const Constant(true))();
BoolColumn get normalizeAudio => BoolColumn get normalizeAudio =>
boolean().withDefault(const Constant(false))(); boolean().withDefault(const Constant(false))();
@ -88,8 +86,8 @@ class PreferencesTable extends Table {
boolean().withDefault(const Constant(true))(); boolean().withDefault(const Constant(true))();
BoolColumn get endlessPlayback => BoolColumn get endlessPlayback =>
boolean().withDefault(const Constant(true))(); boolean().withDefault(const Constant(true))();
BoolColumn get enableConnect => BoolColumn get playerWakelock =>
boolean().withDefault(const Constant(false))(); boolean().withDefault(const Constant(true))();
// Default values as PreferencesTableData // Default values as PreferencesTableData
static PreferencesTableData defaults() { static PreferencesTableData defaults() {
@ -97,7 +95,6 @@ class PreferencesTable extends Table {
id: 0, id: 0,
audioQuality: SourceQualities.high, audioQuality: SourceQualities.high,
albumColorSync: true, albumColorSync: true,
amoledDarkTheme: false,
checkUpdate: true, checkUpdate: true,
normalizeAudio: false, normalizeAudio: false,
showSystemTrayIcon: false, showSystemTrayIcon: false,
@ -118,7 +115,7 @@ class PreferencesTable extends Table {
downloadMusicCodec: SourceCodecs.m4a, downloadMusicCodec: SourceCodecs.m4a,
discordPresence: true, discordPresence: true,
endlessPlayback: true, endlessPlayback: true,
enableConnect: false, playerWakelock: true,
); );
} }
} }

View File

@ -19,6 +19,7 @@ import shared_preferences_foundation
import sqflite import sqflite
import sqlite3_flutter_libs import sqlite3_flutter_libs
import url_launcher_macos import url_launcher_macos
import wakelock_plus
import window_manager import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
@ -36,5 +37,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
} }

View File

@ -259,7 +259,7 @@
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0920; LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1540; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
331C80D4294CF70F00263BE5 = { 331C80D4294CF70F00263BE5 = {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1540" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -310,6 +310,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.6" version: "2.3.6"
dbus:
dependency: transitive
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
desktop_webview_window: desktop_webview_window:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1526,6 +1534,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.5" version: "14.2.5"
wakelock_plus:
dependency: "direct main"
description:
name: wakelock_plus
sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484
url: "https://pub.dev"
source: hosted
version: "1.2.8"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:

View File

@ -100,6 +100,7 @@ dependencies:
flutter_inappwebview: ^6.0.0 flutter_inappwebview: ^6.0.0
timezone: ^0.9.4 timezone: ^0.9.4
url_launcher: ^6.3.0 url_launcher: ^6.3.0
wakelock_plus: ^1.2.8
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: