mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

* feat: add riverpod based favorite album provider * feat: add album is saved, new releases and tracks providers * feat: add artist related providers * feat: add all categories providers * feat: add lyrics provider * feat: add playlist related providers * feat: add search provider * feat: add view and spotify friends provider * feat: add playlist create and update and favorite handlers * feat: use providers in home screen * chore: fix dart lint issues * feat: use new providers for playlist and albums screen * feat: use providers in artist page * feat: use providers on library page * feat: use provider for playlist and album card and heart button * feat: use provider in search page * feat: use providers in generate playlist * feat: use provider in lyrics screen * feat: use provider for create playlist * feat: use provider in add track dialog * feat: use providers in remaining pages and remove fl_query * fix: remove direct access to provider.value * fix: glitching when loading * fix: user album loading next page indicator * feat: make many provider autoDispose after 5 minutes of no usage * fix: ignore episodes in tracks
86 lines
3.0 KiB
Dart
86 lines
3.0 KiB
Dart
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:spotube/collections/env.dart';
|
|
import 'package:spotube/collections/spotube_icons.dart';
|
|
import 'package:spotube/components/settings/section_card_with_heading.dart';
|
|
import 'package:spotube/components/shared/adaptive/adaptive_list_tile.dart';
|
|
import 'package:spotube/extensions/context.dart';
|
|
import 'package:spotube/provider/user_preferences/user_preferences_provider.dart';
|
|
import 'package:url_launcher/url_launcher_string.dart';
|
|
|
|
class SettingsAboutSection extends HookConsumerWidget {
|
|
const SettingsAboutSection({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final preferences = ref.watch(userPreferencesProvider);
|
|
final preferencesNotifier = ref.watch(userPreferencesProvider.notifier);
|
|
|
|
return SectionCardWithHeading(
|
|
heading: context.l10n.about,
|
|
children: [
|
|
AdaptiveListTile(
|
|
leading: const Icon(
|
|
SpotubeIcons.heart,
|
|
color: Colors.pink,
|
|
),
|
|
title: SizedBox(
|
|
height: 50,
|
|
width: 200,
|
|
child: Align(
|
|
alignment: Alignment.centerLeft,
|
|
child: AutoSizeText(
|
|
context.l10n.u_love_spotube,
|
|
maxLines: 1,
|
|
style: const TextStyle(
|
|
color: Colors.pink,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
trailing: (context, update) => FilledButton(
|
|
style: ButtonStyle(
|
|
backgroundColor: MaterialStatePropertyAll(Colors.red[100]),
|
|
foregroundColor:
|
|
const MaterialStatePropertyAll(Colors.pinkAccent),
|
|
padding: const MaterialStatePropertyAll(EdgeInsets.all(15)),
|
|
),
|
|
onPressed: () {
|
|
launchUrlString(
|
|
"https://opencollective.com/spotube",
|
|
mode: LaunchMode.externalApplication,
|
|
);
|
|
},
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const Icon(SpotubeIcons.heart),
|
|
const SizedBox(width: 5),
|
|
Text(context.l10n.please_sponsor),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
if (Env.enableUpdateChecker)
|
|
SwitchListTile(
|
|
secondary: const Icon(SpotubeIcons.update),
|
|
title: Text(context.l10n.check_for_updates),
|
|
value: preferences.checkUpdate,
|
|
onChanged: (checked) => preferencesNotifier.setCheckUpdate(checked),
|
|
),
|
|
ListTile(
|
|
leading: const Icon(SpotubeIcons.info),
|
|
title: Text(context.l10n.about_spotube),
|
|
trailing: const Icon(SpotubeIcons.angleRight),
|
|
onTap: () {
|
|
GoRouter.of(context).push("/settings/about");
|
|
},
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|