mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
chore: SafeArea
This commit is contained in:
parent
0a604a9ad5
commit
92dde7286f
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@ -17,6 +17,17 @@
|
|||||||
"dev"
|
"dev"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "spotube (mobile-skia)",
|
||||||
|
"type": "dart",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "lib/main.dart",
|
||||||
|
"args": [
|
||||||
|
"--flavor",
|
||||||
|
"dev",
|
||||||
|
"--no-enable-impeller"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "spotube (profile)",
|
"name": "spotube (profile)",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
|
@ -25,7 +25,9 @@ class SettingsMetadataProviderFormPage extends HookConsumerWidget {
|
|||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
final formKey = useMemoized(() => GlobalKey<FormBuilderState>(), []);
|
final formKey = useMemoized(() => GlobalKey<FormBuilderState>(), []);
|
||||||
|
|
||||||
return Scaffold(
|
return SafeArea(
|
||||||
|
bottom: false,
|
||||||
|
child: Scaffold(
|
||||||
headers: [
|
headers: [
|
||||||
TitleBar(
|
TitleBar(
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
@ -66,7 +68,8 @@ class SettingsMetadataProviderFormPage extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final field = fields[index] as MetadataFormFieldInputObject;
|
final field =
|
||||||
|
fields[index] as MetadataFormFieldInputObject;
|
||||||
return FormBuilderField(
|
return FormBuilderField(
|
||||||
name: field.id,
|
name: field.id,
|
||||||
initialValue: field.defaultValue,
|
initialValue: field.defaultValue,
|
||||||
@ -103,7 +106,8 @@ class SettingsMetadataProviderFormPage extends HookConsumerWidget {
|
|||||||
? TextInputType.number
|
? TextInputType.number
|
||||||
: TextInputType.text,
|
: TextInputType.text,
|
||||||
features: [
|
features: [
|
||||||
if (field.variant == FormFieldVariant.password)
|
if (field.variant ==
|
||||||
|
FormFieldVariant.password)
|
||||||
const InputFeature.passwordToggle(),
|
const InputFeature.passwordToggle(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -145,6 +149,7 @@ class SettingsMetadataProviderFormPage extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,9 @@ class SettingsMetadataProviderPage extends HookConsumerWidget {
|
|||||||
[plugins.asData?.value.plugins, pluginReposSnapshot.asData?.value],
|
[plugins.asData?.value.plugins, pluginReposSnapshot.asData?.value],
|
||||||
);
|
);
|
||||||
|
|
||||||
return Scaffold(
|
return SafeArea(
|
||||||
|
bottom: false,
|
||||||
|
child: Scaffold(
|
||||||
headers: const [
|
headers: const [
|
||||||
TitleBar(
|
TitleBar(
|
||||||
title: Text("Metadata provider plugin"),
|
title: Text("Metadata provider plugin"),
|
||||||
@ -87,9 +89,10 @@ class SettingsMetadataProviderPage extends HookConsumerWidget {
|
|||||||
child: IconButton.secondary(
|
child: IconButton.secondary(
|
||||||
icon: const Icon(SpotubeIcons.download),
|
icon: const Icon(SpotubeIcons.download),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (formKey.currentState?.saveAndValidate() ?? false) {
|
if (formKey.currentState?.saveAndValidate() ??
|
||||||
final url = formKey.currentState?.fields["plugin_url"]
|
false) {
|
||||||
?.value as String;
|
final url = formKey.currentState
|
||||||
|
?.fields["plugin_url"]?.value as String;
|
||||||
|
|
||||||
if (url.isNotEmpty) {
|
if (url.isNotEmpty) {
|
||||||
final pluginConfig = await pluginsNotifier
|
final pluginConfig = await pluginsNotifier
|
||||||
@ -148,7 +151,8 @@ class SettingsMetadataProviderPage extends HookConsumerWidget {
|
|||||||
separatorBuilder: (context, index) => const Gap(12),
|
separatorBuilder: (context, index) => const Gap(12),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final plugin = plugins.asData!.value.plugins[index];
|
final plugin = plugins.asData!.value.plugins[index];
|
||||||
final isDefault = plugins.asData!.value.defaultPlugin == index;
|
final isDefault =
|
||||||
|
plugins.asData!.value.defaultPlugin == index;
|
||||||
return MetadataInstalledPluginItem(
|
return MetadataInstalledPluginItem(
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
isDefault: isDefault,
|
isDefault: isDefault,
|
||||||
@ -237,6 +241,7 @@ class SettingsMetadataProviderPage extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:spotube/models/metadata/metadata.dart';
|
import 'package:spotube/models/metadata/metadata.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
import 'package:spotube/provider/metadata_plugin/core/auth.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/utils/paginated.dart';
|
import 'package:spotube/provider/metadata_plugin/utils/paginated.dart';
|
||||||
|
|
||||||
class MetadataPluginAlbumReleasesNotifier
|
class MetadataPluginAlbumReleasesNotifier
|
||||||
@ -17,7 +17,7 @@ class MetadataPluginAlbumReleasesNotifier
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
build() async {
|
build() async {
|
||||||
ref.watch(metadataPluginProvider);
|
ref.watch(metadataPluginAuthenticatedProvider);
|
||||||
return await fetch(0, 20);
|
return await fetch(0, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:spotube/models/metadata/metadata.dart';
|
import 'package:spotube/models/metadata/metadata.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
import 'package:spotube/provider/metadata_plugin/core/auth.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/utils/family_paginated.dart';
|
import 'package:spotube/provider/metadata_plugin/utils/family_paginated.dart';
|
||||||
|
|
||||||
class MetadataPluginBrowseSectionItemsNotifier
|
class MetadataPluginBrowseSectionItemsNotifier
|
||||||
@ -19,7 +19,7 @@ class MetadataPluginBrowseSectionItemsNotifier
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
build(arg) async {
|
build(arg) async {
|
||||||
ref.watch(metadataPluginProvider);
|
ref.watch(metadataPluginAuthenticatedProvider);
|
||||||
return await fetch(0, 20);
|
return await fetch(0, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:spotube/models/metadata/metadata.dart';
|
import 'package:spotube/models/metadata/metadata.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
import 'package:spotube/provider/metadata_plugin/core/auth.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/utils/paginated.dart';
|
import 'package:spotube/provider/metadata_plugin/utils/paginated.dart';
|
||||||
|
|
||||||
class MetadataPluginBrowseSectionsNotifier
|
class MetadataPluginBrowseSectionsNotifier
|
||||||
@ -19,7 +19,7 @@ class MetadataPluginBrowseSectionsNotifier
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
build() async {
|
build() async {
|
||||||
ref.watch(metadataPluginProvider);
|
ref.watch(metadataPluginAuthenticatedProvider);
|
||||||
return await fetch(0, 20);
|
return await fetch(0, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,8 @@ abstract class ServiceUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return "$title ${artists.map((e) => e.replaceAll(",", " ")).join(", ")}"
|
return "$title ${artists.map((e) => e.replaceAll(",", " ")).join(", ")}"
|
||||||
.toLowerCase()
|
|
||||||
.replaceAll(RegExp(r"\s*\[[^\]]*]"), ' ')
|
.replaceAll(RegExp(r"\s*\[[^\]]*]"), ' ')
|
||||||
.replaceAll(RegExp(r"\sfeat\.|\sft\."), ' ')
|
.replaceAll(RegExp(r"\sfeat\.|\sft\.", caseSensitive: false), ' ')
|
||||||
.replaceAll(RegExp(r"\s+"), ' ')
|
.replaceAll(RegExp(r"\s+"), ' ')
|
||||||
.trim();
|
.trim();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user