Skip to content

Commit

Permalink
Updated Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasLixo committed Nov 19, 2024
1 parent 207b1c7 commit 8747e50
Show file tree
Hide file tree
Showing 28 changed files with 562 additions and 297 deletions.
2 changes: 1 addition & 1 deletion lib/app/app_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _AppWidgetState extends State<AppWidget> with WidgetsBindingObserver {
}

Future<void> _onEnterApp() async {
await AppShared.loadTheme();
await AppShared.loadTheme(isRebirth: false);
}

void _onExitApp() {}
Expand Down
7 changes: 6 additions & 1 deletion lib/app/core/controllers/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ import 'package:player_hub/app/core/enums/shared_attibutes.dart';
import 'package:player_hub/app/core/static/app_shared.dart';
import 'package:player_hub/app/core/interfaces/visualizer.dart';
import 'package:player_hub/app/core/static/app_manifest.dart';
import 'package:player_hub/app/core/types/app_functions.dart';
import 'package:get/get_utils/src/extensions/internacionalization.dart';

class PlayerController extends BaseAudioHandler with QueueHandler, SeekHandler {
class PlayerController extends BaseAudioHandler
with QueueHandler, SeekHandler, AppFunctions {
// ==================================================
final RxString songLog = ''.obs;
// address of sound in list
Expand Down Expand Up @@ -579,6 +582,8 @@ class PlayerController extends BaseAudioHandler with QueueHandler, SeekHandler {
playlistListSongs.putIfAbsent(title, () => <SongModel>[]);
await _updatePlaylistList();
await _updatePlaylistListSongs(title);
} else {
await showToast('playlist2'.tr);
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/app/core/static/app_shared.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ abstract class AppShared extends GetxController {
sharedMap[setting.name] = SharedAttributes.getAttributesMap[setting.name];
}

await loadTheme();
await loadTheme(isRebirth: true);
}

// ==================================================
static Future<void> loadTheme([
bool isRebirth = true,
]) async {
static Future<void> loadTheme({
required bool isRebirth,
}) async {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
Expand Down
3 changes: 3 additions & 0 deletions lib/app/core/types/app_translations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AppTranslations extends Translations {
'edit_replace': 'Trocar Imagem',
'playlist1': 'Recentes',
'playlist_not1': 'Sem Recentes',
'playlist2': 'Playlist já existe',
'cloud_error1': 'Sem Resultados',
'setting_title': 'Configurações',
'setting_ignore': 'Ignorar áudio menores que: @seconds segundos',
Expand Down Expand Up @@ -99,6 +100,7 @@ class AppTranslations extends Translations {
'edit_replace': 'Change Image',
'playlist1': 'Recents',
'playlist_not1': 'No Recents',
'playlist2': 'Playlist already exists',
'cloud_error1': 'No Results',
'setting_title': 'Settings',
'setting_ignore': 'Ignore audio shorter than: @seconds seconds',
Expand Down Expand Up @@ -158,6 +160,7 @@ class AppTranslations extends Translations {
'edit_replace': 'Cambiar imagen',
'playlist1': 'Recientes',
'playlist_not1': 'Sin recientes',
'playlist2': 'La lista de reproducción ya existe',
'cloud_error1': 'Sin resultados',
'setting_title': 'Configuraciones',
'setting_ignore': 'Ignorar audio de menos de: @seconds segundos',
Expand Down
6 changes: 3 additions & 3 deletions lib/app/pages/details/details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import 'package:player_hub/app/core/controllers/player.dart';
import 'package:player_hub/app/core/types/app_functions.dart';
import 'package:player_hub/app/routes/app_routes.dart';
import 'package:helper_hub/src/theme_widget.dart';
import 'package:player_hub/app/shared/widgets/crud_music.dart';
import 'package:player_hub/app/shared/more_vert/crud_music.dart';
import 'package:player_hub/app/shared/widgets/playlist_mode.dart';
import 'package:player_hub/app/shared/widgets/detailts_sheet.dart';
import 'package:player_hub/app/shared/more_vert/detailts_sheet.dart';

class DetailsPage extends StatefulWidget {
const DetailsPage({super.key});
Expand Down Expand Up @@ -45,7 +45,7 @@ class _DetailsPageState extends State<DetailsPage>

@override
void dispose() {
AppShared.loadTheme(false);
AppShared.loadTheme(isRebirth: false);
super.dispose();
}

Expand Down
102 changes: 68 additions & 34 deletions lib/app/pages/edit/edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,77 @@ class EditPage extends GetView<PlayerController> with AppFunctions {
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 12, 8, 0),
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Column(
children: <Widget>[
ListTile(
title: Text(
'edit_title'.tr,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: TextField(
cursorHeight: 28.0,
controller: textControllerTitle,
focusNode: null,
style: Theme.of(context).textTheme.titleMedium,
cursorColor: AppColors.current().text,
decoration: InputDecoration(
fillColor: AppColors.current().surface,
filled: true,
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(12),
),
borderSide:
BorderSide(color: AppColors.current().primary),
),
enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
),
borderSide: BorderSide(color: Colors.transparent),
),
floatingLabelBehavior: FloatingLabelBehavior.never,
),
),
),
ListTile(
title: Text(
'edit_artist'.tr,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: TextField(
cursorHeight: 28.0,
controller: textControllerArtist,
focusNode: null,
style: Theme.of(context).textTheme.titleMedium,
cursorColor: AppColors.current().text,
decoration: InputDecoration(
fillColor: AppColors.current().surface,
filled: true,
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(12),
),
borderSide:
BorderSide(color: AppColors.current().primary),
),
enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
),
borderSide: BorderSide(color: Colors.transparent),
),
floatingLabelBehavior: FloatingLabelBehavior.never,
),
),
),
const Space(
size: 12,
orientation: Axis.vertical,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
padding: const EdgeInsets.symmetric(horizontal: 14.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
Expand Down Expand Up @@ -188,38 +254,6 @@ class EditPage extends GetView<PlayerController> with AppFunctions {
],
),
),
ListTile(
title: Text(
'edit_title'.tr,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: TextField(
controller: textControllerTitle,
style: Theme.of(context).textTheme.titleMedium,
cursorColor: AppColors.current().text,
decoration: InputDecoration(
border: UnderlineInputBorder(
borderSide: BorderSide(color: AppColors.current().text),
),
),
),
),
ListTile(
title: Text(
'edit_artist'.tr,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: TextField(
controller: textControllerArtist,
style: Theme.of(context).textTheme.titleMedium,
cursorColor: AppColors.current().text,
decoration: InputDecoration(
border: UnderlineInputBorder(
borderSide: BorderSide(color: AppColors.current().text),
),
),
),
),
],
),
),
Expand Down
Loading

0 comments on commit 8747e50

Please sign in to comment.