Large header settings
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 3
|
||||
/// Strings: 582 (194 per locale)
|
||||
/// Strings: 591 (197 per locale)
|
||||
///
|
||||
/// Built on 2024-06-11 at 12:16 UTC
|
||||
/// Built on 2024-06-11 at 16:25 UTC
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
@@ -502,6 +502,9 @@ class _StringsSettingsGeneralSettingsEn {
|
||||
String get internalBrowser => 'App internal browser';
|
||||
String get browserCustomTab => 'Browser custom tab';
|
||||
String get systemBrowser => 'System browser';
|
||||
String get tags => 'Tags';
|
||||
String get defaultTags => 'Default tags';
|
||||
String get defaultTagsDescription => 'Define a list of tags that will be added by default when creating a bookmark';
|
||||
}
|
||||
|
||||
// Path: settings.generalSettings.disconnectModal
|
||||
@@ -892,6 +895,9 @@ class _StringsSettingsGeneralSettingsEs implements _StringsSettingsGeneralSettin
|
||||
@override String get internalBrowser => 'Navegador interno de la app';
|
||||
@override String get browserCustomTab => 'Pestaña personalizada del navegador';
|
||||
@override String get systemBrowser => 'Navegador del sistema';
|
||||
@override String get tags => 'Etiquetas';
|
||||
@override String get defaultTags => 'Etiquetas por defecto';
|
||||
@override String get defaultTagsDescription => 'Define una lista de etiquetas que se añadirán por defecto al crear un marcador';
|
||||
}
|
||||
|
||||
// Path: settings.generalSettings.disconnectModal
|
||||
@@ -1282,6 +1288,9 @@ class _StringsSettingsGeneralSettingsTr implements _StringsSettingsGeneralSettin
|
||||
@override String get internalBrowser => 'App internal browser';
|
||||
@override String get browserCustomTab => 'Browser custom tab';
|
||||
@override String get systemBrowser => 'System browser';
|
||||
@override String get tags => 'Tags';
|
||||
@override String get defaultTags => 'Default tags';
|
||||
@override String get defaultTagsDescription => 'Define a list of tags that will be added by default when creating a bookmark';
|
||||
}
|
||||
|
||||
// Path: settings.generalSettings.disconnectModal
|
||||
@@ -1477,6 +1486,9 @@ extension on Translations {
|
||||
case 'settings.generalSettings.internalBrowser': return 'App internal browser';
|
||||
case 'settings.generalSettings.browserCustomTab': return 'Browser custom tab';
|
||||
case 'settings.generalSettings.systemBrowser': return 'System browser';
|
||||
case 'settings.generalSettings.tags': return 'Tags';
|
||||
case 'settings.generalSettings.defaultTags': return 'Default tags';
|
||||
case 'settings.generalSettings.defaultTagsDescription': return 'Define a list of tags that will be added by default when creating a bookmark';
|
||||
case 'webview.goBack': return 'Go back';
|
||||
case 'webview.goForward': return 'Go forward';
|
||||
case 'webview.reload': return 'Reload';
|
||||
@@ -1679,6 +1691,9 @@ extension on _StringsEs {
|
||||
case 'settings.generalSettings.internalBrowser': return 'Navegador interno de la app';
|
||||
case 'settings.generalSettings.browserCustomTab': return 'Pestaña personalizada del navegador';
|
||||
case 'settings.generalSettings.systemBrowser': return 'Navegador del sistema';
|
||||
case 'settings.generalSettings.tags': return 'Etiquetas';
|
||||
case 'settings.generalSettings.defaultTags': return 'Etiquetas por defecto';
|
||||
case 'settings.generalSettings.defaultTagsDescription': return 'Define una lista de etiquetas que se añadirán por defecto al crear un marcador';
|
||||
case 'webview.goBack': return 'Ir atrás';
|
||||
case 'webview.goForward': return 'Ir adelante';
|
||||
case 'webview.reload': return 'Recargar';
|
||||
@@ -1881,6 +1896,9 @@ extension on _StringsTr {
|
||||
case 'settings.generalSettings.internalBrowser': return 'App internal browser';
|
||||
case 'settings.generalSettings.browserCustomTab': return 'Browser custom tab';
|
||||
case 'settings.generalSettings.systemBrowser': return 'System browser';
|
||||
case 'settings.generalSettings.tags': return 'Tags';
|
||||
case 'settings.generalSettings.defaultTags': return 'Default tags';
|
||||
case 'settings.generalSettings.defaultTagsDescription': return 'Define a list of tags that will be added by default when creating a bookmark';
|
||||
case 'webview.goBack': return 'Geri dön';
|
||||
case 'webview.goForward': return 'İleri git';
|
||||
case 'webview.reload': return 'Yenile';
|
||||
|
||||
@@ -202,7 +202,10 @@
|
||||
"openLinksWith": "Open links with...",
|
||||
"internalBrowser": "App internal browser",
|
||||
"browserCustomTab": "Browser custom tab",
|
||||
"systemBrowser": "System browser"
|
||||
"systemBrowser": "System browser",
|
||||
"tags": "Tags",
|
||||
"defaultTags": "Default tags",
|
||||
"defaultTagsDescription": "Define a list of tags that will be added by default when creating a bookmark"
|
||||
}
|
||||
},
|
||||
"webview": {
|
||||
|
||||
@@ -202,7 +202,10 @@
|
||||
"openLinksWith": "Abrir enlaces con...",
|
||||
"internalBrowser": "Navegador interno de la app",
|
||||
"browserCustomTab": "Pestaña personalizada del navegador",
|
||||
"systemBrowser": "Navegador del sistema"
|
||||
"systemBrowser": "Navegador del sistema",
|
||||
"tags": "Etiquetas",
|
||||
"defaultTags": "Etiquetas por defecto",
|
||||
"defaultTagsDescription": "Define una lista de etiquetas que se añadirán por defecto al crear un marcador"
|
||||
}
|
||||
},
|
||||
"webview": {
|
||||
|
||||
@@ -202,7 +202,10 @@
|
||||
"openLinksWith": "Open links with...",
|
||||
"internalBrowser": "App internal browser",
|
||||
"browserCustomTab": "Browser custom tab",
|
||||
"systemBrowser": "System browser"
|
||||
"systemBrowser": "System browser",
|
||||
"tags": "Tags",
|
||||
"defaultTags": "Default tags",
|
||||
"defaultTagsDescription": "Define a list of tags that will be added by default when creating a bookmark"
|
||||
}
|
||||
},
|
||||
"webview": {
|
||||
|
||||
@@ -16,137 +16,162 @@ import 'package:linkdy/i18n/strings.g.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
|
||||
class Customization extends ConsumerWidget {
|
||||
const Customization({Key? key}) : super(key: key);
|
||||
const Customization({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(t.settings.customization.customization),
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
children: [
|
||||
SectionLabel(
|
||||
label: t.settings.customization.theme,
|
||||
padding: const EdgeInsets.only(top: 10, left: 16, right: 16, bottom: 5),
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
title: Text(t.settings.customization.customization),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
CustomSwitchListTile(
|
||||
value: ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
onChanged: (value) => ref
|
||||
.read(appStatusProvider.notifier)
|
||||
.setTheme(value == true ? SelectedTheme.system : SelectedTheme.light),
|
||||
title: t.settings.customization.systemDefined,
|
||||
),
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
SliverList.list(
|
||||
children: [
|
||||
ThemeModeButton(
|
||||
icon: Icons.light_mode,
|
||||
value: 1,
|
||||
selected: ref.watch(appStatusProvider).selectedTheme.index,
|
||||
label: t.settings.customization.light,
|
||||
onChanged: (value) => ref.read(appStatusProvider.notifier).setTheme(SelectedTheme.values[value]),
|
||||
disabled: ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
SectionLabel(
|
||||
label: t.settings.customization.theme,
|
||||
padding: const EdgeInsets.only(top: 10, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
ThemeModeButton(
|
||||
icon: Icons.dark_mode,
|
||||
value: 2,
|
||||
selected: ref.watch(appStatusProvider).selectedTheme.index,
|
||||
label: t.settings.customization.dark,
|
||||
onChanged: (value) => ref.read(appStatusProvider.notifier).setTheme(SelectedTheme.values[value]),
|
||||
disabled: ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
Column(
|
||||
children: [
|
||||
CustomSwitchListTile(
|
||||
value: ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
onChanged: (value) => ref
|
||||
.read(appStatusProvider.notifier)
|
||||
.setTheme(value == true ? SelectedTheme.system : SelectedTheme.light),
|
||||
title: t.settings.customization.systemDefined,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ThemeModeButton(
|
||||
icon: Icons.light_mode,
|
||||
value: 1,
|
||||
selected: ref.watch(appStatusProvider).selectedTheme.index,
|
||||
label: t.settings.customization.light,
|
||||
onChanged: (value) =>
|
||||
ref.read(appStatusProvider.notifier).setTheme(SelectedTheme.values[value]),
|
||||
disabled:
|
||||
ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
),
|
||||
ThemeModeButton(
|
||||
icon: Icons.dark_mode,
|
||||
value: 2,
|
||||
selected: ref.watch(appStatusProvider).selectedTheme.index,
|
||||
label: t.settings.customization.dark,
|
||||
onChanged: (value) =>
|
||||
ref.read(appStatusProvider.notifier).setTheme(SelectedTheme.values[value]),
|
||||
disabled:
|
||||
ref.watch(appStatusProvider).selectedTheme == SelectedTheme.system ? true : false,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SectionLabel(
|
||||
label: t.settings.customization.color,
|
||||
padding: const EdgeInsets.only(top: 45, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
if (ref.watch(appStatusProvider).supportsDynamicTheme)
|
||||
CustomSwitchListTile(
|
||||
value: ref.watch(appStatusProvider).useDynamicTheme,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setUseDynamicTheme,
|
||||
title: t.settings.customization.useDynamicTheme,
|
||||
),
|
||||
if (ref.watch(appStatusProvider).supportsDynamicTheme == false ||
|
||||
(ref.watch(appStatusProvider).supportsDynamicTheme == true &&
|
||||
ref.watch(appStatusProvider).useDynamicTheme == false))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8, left: 16, right: 16),
|
||||
child: Scrollbar(
|
||||
controller: ref.watch(customizationProvider).scrollController,
|
||||
thumbVisibility: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
|
||||
interactive: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
|
||||
thickness: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 8 : 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 70,
|
||||
child: ListView.builder(
|
||||
controller: ref.watch(customizationProvider).scrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: colors.length,
|
||||
padding: const EdgeInsets.all(0),
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Row(
|
||||
children: [
|
||||
ColorItem(
|
||||
index: index,
|
||||
total: colors.length,
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: ref.watch(appStatusProvider).selectedColor,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setSelectedColor,
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
width: 1,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return ColorItem(
|
||||
index: index,
|
||||
total: colors.length,
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: ref.watch(appStatusProvider).selectedColor,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setSelectedColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text(
|
||||
colorTranslation(ref.watch(appStatusProvider).selectedColor),
|
||||
style: TextStyle(color: Theme.of(context).listTileTheme.iconColor, fontSize: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SectionLabel(
|
||||
label: t.settings.customization.color,
|
||||
padding: const EdgeInsets.only(top: 45, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
if (ref.watch(appStatusProvider).supportsDynamicTheme)
|
||||
CustomSwitchListTile(
|
||||
value: ref.watch(appStatusProvider).useDynamicTheme,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setUseDynamicTheme,
|
||||
title: t.settings.customization.useDynamicTheme,
|
||||
),
|
||||
if (ref.watch(appStatusProvider).supportsDynamicTheme == false ||
|
||||
(ref.watch(appStatusProvider).supportsDynamicTheme == true &&
|
||||
ref.watch(appStatusProvider).useDynamicTheme == false))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8, left: 16, right: 16),
|
||||
child: Scrollbar(
|
||||
controller: ref.watch(customizationProvider).scrollController,
|
||||
thumbVisibility: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
|
||||
interactive: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
|
||||
thickness: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 8 : 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 70,
|
||||
child: ListView.builder(
|
||||
controller: ref.watch(customizationProvider).scrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: colors.length,
|
||||
padding: const EdgeInsets.all(0),
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Row(
|
||||
children: [
|
||||
ColorItem(
|
||||
index: index,
|
||||
total: colors.length,
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: ref.watch(appStatusProvider).selectedColor,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setSelectedColor,
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
width: 1,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return ColorItem(
|
||||
index: index,
|
||||
total: colors.length,
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: ref.watch(appStatusProvider).selectedColor,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setSelectedColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text(
|
||||
colorTranslation(ref.watch(appStatusProvider).selectedColor),
|
||||
style: TextStyle(color: Theme.of(context).listTileTheme.iconColor, fontSize: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:linkdy/constants/enums.dart';
|
||||
|
||||
import 'package:linkdy/i18n/strings.g.dart';
|
||||
import 'package:linkdy/screens/settings/ui/general_settings/browser_mode_selection_modal.dart';
|
||||
import 'package:linkdy/screens/settings/ui/general_settings/disconnect_modal.dart';
|
||||
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
import 'package:linkdy/widgets/section_label.dart';
|
||||
|
||||
import 'package:linkdy/i18n/strings.g.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
import 'package:linkdy/constants/enums.dart';
|
||||
|
||||
class GeneralSettings extends ConsumerWidget {
|
||||
const GeneralSettings({super.key});
|
||||
|
||||
@@ -33,47 +33,76 @@ class GeneralSettings extends ConsumerWidget {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(t.settings.generalSettings.generalSettings),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
SectionLabel(label: t.settings.generalSettings.bookmarks),
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.generalSettings.showFavicon),
|
||||
subtitle: Text(t.settings.generalSettings.showFaviconDescription),
|
||||
value: ref.watch(appStatusProvider).showFavicon,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setShowFavicon,
|
||||
),
|
||||
ListTile(
|
||||
title: Text(t.settings.generalSettings.openLinksWith),
|
||||
subtitle: Text(browserLabel()),
|
||||
onTap: openBrowserSelectionSheet,
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Divider(),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FilledButton.icon(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => const DisconnectModal(),
|
||||
),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
label: Text(
|
||||
t.settings.generalSettings.disconnectFromServer,
|
||||
),
|
||||
style: const ButtonStyle(
|
||||
foregroundColor: MaterialStatePropertyAll(Colors.white),
|
||||
backgroundColor: MaterialStatePropertyAll(Colors.red),
|
||||
),
|
||||
),
|
||||
],
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
title: Text(t.settings.generalSettings.generalSettings),
|
||||
),
|
||||
),
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
SectionLabel(label: t.settings.generalSettings.bookmarks),
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.generalSettings.showFavicon),
|
||||
subtitle: Text(t.settings.generalSettings.showFaviconDescription),
|
||||
value: ref.watch(appStatusProvider).showFavicon,
|
||||
onChanged: ref.read(appStatusProvider.notifier).setShowFavicon,
|
||||
),
|
||||
ListTile(
|
||||
title: Text(t.settings.generalSettings.openLinksWith),
|
||||
subtitle: Text(browserLabel()),
|
||||
onTap: openBrowserSelectionSheet,
|
||||
),
|
||||
SectionLabel(label: t.settings.generalSettings.tags),
|
||||
ListTile(
|
||||
title: Text(t.settings.generalSettings.defaultTags),
|
||||
subtitle: Text(t.settings.generalSettings.defaultTagsDescription),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Divider(),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FilledButton.icon(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => const DisconnectModal(),
|
||||
),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
label: Text(
|
||||
t.settings.generalSettings.disconnectFromServer,
|
||||
),
|
||||
style: const ButtonStyle(
|
||||
foregroundColor: MaterialStatePropertyAll(Colors.white),
|
||||
backgroundColor: MaterialStatePropertyAll(Colors.red),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import 'package:linkdy/widgets/section_label.dart';
|
||||
import 'package:linkdy/widgets/custom_list_tile.dart';
|
||||
import 'package:linkdy/widgets/custom_settings_tile.dart';
|
||||
|
||||
import 'package:linkdy/providers/router.provider.dart';
|
||||
import 'package:linkdy/providers/app_info.provider.dart';
|
||||
import 'package:linkdy/utils/open_url.dart';
|
||||
import 'package:linkdy/constants/strings.dart';
|
||||
@@ -51,77 +50,100 @@ class _List extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(onPressed: () => ref.read(routerProvider).pop()),
|
||||
title: Text(t.settings.settings),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
SectionLabel(label: t.settings.appSettings),
|
||||
_SettingsTile(
|
||||
icon: Icons.palette_rounded,
|
||||
title: t.settings.customization.customization,
|
||||
subtitle: t.settings.customization.customizationDescription,
|
||||
thisItem: 0,
|
||||
twoColumns: tabletView,
|
||||
screenToNavigate: const Customization(),
|
||||
),
|
||||
_SettingsTile(
|
||||
icon: Icons.settings_rounded,
|
||||
title: t.settings.generalSettings.generalSettings,
|
||||
subtitle: t.settings.generalSettings.generalSettingsDescription,
|
||||
thisItem: 1,
|
||||
screenToNavigate: const GeneralSettings(),
|
||||
twoColumns: tabletView,
|
||||
),
|
||||
SectionLabel(label: t.settings.aboutApp),
|
||||
CustomListTile(
|
||||
title: t.settings.linkdingRepository,
|
||||
subtitle: t.settings.linkdingRepositoryDescription,
|
||||
trailing: Icon(
|
||||
Icons.open_in_new_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
title: Text(t.settings.settings),
|
||||
),
|
||||
onTap: () => openUrlCustomTab(Urls.linkdingRepo),
|
||||
),
|
||||
CustomListTile(
|
||||
title: t.settings.appVersion,
|
||||
subtitle: ref.watch(appInfoProvider).version,
|
||||
),
|
||||
CustomListTile(
|
||||
title: t.settings.createdBy,
|
||||
subtitle: Strings.createdBy,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
if (Platform.isAndroid)
|
||||
IconButton(
|
||||
onPressed: () => openUrlCustomTab(Urls.playStoreLink),
|
||||
icon: SvgPicture.asset(
|
||||
'assets/resources/google-play.svg',
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
width: 30,
|
||||
height: 30,
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
SectionLabel(label: t.settings.appSettings),
|
||||
_SettingsTile(
|
||||
icon: Icons.palette_rounded,
|
||||
title: t.settings.customization.customization,
|
||||
subtitle: t.settings.customization.customizationDescription,
|
||||
thisItem: 0,
|
||||
twoColumns: tabletView,
|
||||
screenToNavigate: const Customization(),
|
||||
),
|
||||
tooltip: t.settings.visitGooglePlay,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => openUrlCustomTab(Urls.gitHubRepo),
|
||||
icon: SvgPicture.asset(
|
||||
'assets/resources/github.svg',
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
width: 30,
|
||||
height: 30,
|
||||
),
|
||||
tooltip: t.settings.visitGitHubRepo,
|
||||
_SettingsTile(
|
||||
icon: Icons.settings_rounded,
|
||||
title: t.settings.generalSettings.generalSettings,
|
||||
subtitle: t.settings.generalSettings.generalSettingsDescription,
|
||||
thisItem: 1,
|
||||
screenToNavigate: const GeneralSettings(),
|
||||
twoColumns: tabletView,
|
||||
),
|
||||
SectionLabel(label: t.settings.aboutApp),
|
||||
CustomListTile(
|
||||
title: t.settings.linkdingRepository,
|
||||
subtitle: t.settings.linkdingRepositoryDescription,
|
||||
trailing: Icon(
|
||||
Icons.open_in_new_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
onTap: () => openUrlCustomTab(Urls.linkdingRepo),
|
||||
),
|
||||
CustomListTile(
|
||||
title: t.settings.appVersion,
|
||||
subtitle: ref.watch(appInfoProvider).version,
|
||||
),
|
||||
CustomListTile(
|
||||
title: t.settings.createdBy,
|
||||
subtitle: Strings.createdBy,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
if (Platform.isAndroid)
|
||||
IconButton(
|
||||
onPressed: () => openUrlCustomTab(Urls.playStoreLink),
|
||||
icon: SvgPicture.asset(
|
||||
'assets/resources/google-play.svg',
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
width: 30,
|
||||
height: 30,
|
||||
),
|
||||
tooltip: t.settings.visitGooglePlay,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => openUrlCustomTab(Urls.gitHubRepo),
|
||||
icon: SvgPicture.asset(
|
||||
'assets/resources/github.svg',
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
width: 30,
|
||||
height: 30,
|
||||
),
|
||||
tooltip: t.settings.visitGitHubRepo,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -131,7 +153,6 @@ class _SettingsTile extends ConsumerWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final IconData icon;
|
||||
final Widget? trailing;
|
||||
final Widget screenToNavigate;
|
||||
final int thisItem;
|
||||
final bool twoColumns;
|
||||
@@ -140,7 +161,6 @@ class _SettingsTile extends ConsumerWidget {
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.icon,
|
||||
this.trailing,
|
||||
required this.screenToNavigate,
|
||||
required this.thisItem,
|
||||
required this.twoColumns,
|
||||
@@ -153,7 +173,6 @@ class _SettingsTile extends ConsumerWidget {
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
icon: icon,
|
||||
trailing: trailing,
|
||||
thisItem: thisItem,
|
||||
selectedItem: ref.watch(settingsProvider).selectedScreen,
|
||||
onTap: () {
|
||||
@@ -166,7 +185,6 @@ class _SettingsTile extends ConsumerWidget {
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
icon: icon,
|
||||
trailing: trailing,
|
||||
onTap: () {
|
||||
Navigator.of(context, rootNavigator: true).push(MaterialPageRoute(builder: (context) => screenToNavigate));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user