Updated dependencies, removed split view package, removed super context menu and fix android
This commit is contained in:
@@ -168,6 +168,7 @@ class _TranslationsSettingsCs implements TranslationsSettingsEn {
|
||||
@override String get moreInfoAppDescription => 'Odkaz na webové stránky aplikace';
|
||||
@override String get moreApps => 'Moje další aplikace';
|
||||
@override String get moreAppsDescription => 'Další projekty, kontakt, podpora a další';
|
||||
@override String get selectAnOption => 'Vyberte možnost';
|
||||
@override late final _TranslationsSettingsCustomizationCs customization = _TranslationsSettingsCustomizationCs._(_root);
|
||||
@override late final _TranslationsSettingsGeneralSettingsCs generalSettings = _TranslationsSettingsGeneralSettingsCs._(_root);
|
||||
}
|
||||
@@ -598,6 +599,7 @@ extension on TranslationsCs {
|
||||
'settings.moreInfoAppDescription' => 'Odkaz na webové stránky aplikace',
|
||||
'settings.moreApps' => 'Moje další aplikace',
|
||||
'settings.moreAppsDescription' => 'Další projekty, kontakt, podpora a další',
|
||||
'settings.selectAnOption' => 'Vyberte možnost',
|
||||
'settings.customization.customization' => 'Přizpůsobení',
|
||||
'settings.customization.customizationDescription' => 'Nastavte motiv aplikace a barevnou paletu.',
|
||||
'settings.customization.theme' => 'Motiv',
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
"moreInfoAppDescription": "Odkaz na webové stránky aplikace",
|
||||
"moreApps": "Moje další aplikace",
|
||||
"moreAppsDescription": "Další projekty, kontakt, podpora a další",
|
||||
"selectAnOption": "Vyberte možnost",
|
||||
"customization": {
|
||||
"customization": "Přizpůsobení",
|
||||
"customizationDescription": "Nastavte motiv aplikace a barevnou paletu.",
|
||||
|
||||
@@ -319,6 +319,9 @@ class TranslationsSettingsEn {
|
||||
/// en: 'More apps, contact, donations and more'
|
||||
String get moreAppsDescription => 'More apps, contact, donations and more';
|
||||
|
||||
/// en: 'Select an option'
|
||||
String get selectAnOption => 'Select an option';
|
||||
|
||||
late final TranslationsSettingsCustomizationEn customization = TranslationsSettingsCustomizationEn._(_root);
|
||||
late final TranslationsSettingsGeneralSettingsEn generalSettings = TranslationsSettingsGeneralSettingsEn._(_root);
|
||||
}
|
||||
@@ -1031,6 +1034,7 @@ extension on Translations {
|
||||
'settings.moreInfoAppDescription' => 'Link to the app\'s information page',
|
||||
'settings.moreApps' => 'My other apps',
|
||||
'settings.moreAppsDescription' => 'More apps, contact, donations and more',
|
||||
'settings.selectAnOption' => 'Select an option',
|
||||
'settings.customization.customization' => 'Customization',
|
||||
'settings.customization.customizationDescription' => 'Set the app theme and color palette.',
|
||||
'settings.customization.theme' => 'Theme',
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
"moreInfoAppDescription": "Link to the app's information page",
|
||||
"moreApps": "My other apps",
|
||||
"moreAppsDescription": "More apps, contact, donations and more",
|
||||
"selectAnOption": "Select an option",
|
||||
"customization": {
|
||||
"customization": "Customization",
|
||||
"customizationDescription": "Set the app theme and color palette.",
|
||||
|
||||
@@ -168,6 +168,7 @@ class _TranslationsSettingsEs implements TranslationsSettingsEn {
|
||||
@override String get moreInfoAppDescription => 'Enlace a la página web de información de la aplicación';
|
||||
@override String get moreApps => 'Mis otras aplicaciones';
|
||||
@override String get moreAppsDescription => 'Más aplicaciones, contacto, donaciones y más';
|
||||
@override String get selectAnOption => 'Selecciona una opción';
|
||||
@override late final _TranslationsSettingsCustomizationEs customization = _TranslationsSettingsCustomizationEs._(_root);
|
||||
@override late final _TranslationsSettingsGeneralSettingsEs generalSettings = _TranslationsSettingsGeneralSettingsEs._(_root);
|
||||
}
|
||||
@@ -598,6 +599,7 @@ extension on TranslationsEs {
|
||||
'settings.moreInfoAppDescription' => 'Enlace a la página web de información de la aplicación',
|
||||
'settings.moreApps' => 'Mis otras aplicaciones',
|
||||
'settings.moreAppsDescription' => 'Más aplicaciones, contacto, donaciones y más',
|
||||
'settings.selectAnOption' => 'Selecciona una opción',
|
||||
'settings.customization.customization' => 'Personalización',
|
||||
'settings.customization.customizationDescription' => 'Configura el tema y la paleta de colores.',
|
||||
'settings.customization.theme' => 'Tema',
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
"moreInfoAppDescription": "Enlace a la página web de información de la aplicación",
|
||||
"moreApps": "Mis otras aplicaciones",
|
||||
"moreAppsDescription": "Más aplicaciones, contacto, donaciones y más",
|
||||
"selectAnOption": "Selecciona una opción",
|
||||
"customization": {
|
||||
"customization": "Personalización",
|
||||
"customizationDescription": "Configura el tema y la paleta de colores.",
|
||||
|
||||
@@ -168,6 +168,7 @@ class _TranslationsSettingsTr implements TranslationsSettingsEn {
|
||||
@override String get moreInfoAppDescription => 'Uygulamanın bilgi sayfasına bağlantı';
|
||||
@override String get moreApps => 'Diğer uygulamalarım';
|
||||
@override String get moreAppsDescription => 'Daha fazla uygulama, iletişim, bağış ve daha fazlası';
|
||||
@override String get selectAnOption => 'Bir seçenek seçin';
|
||||
@override late final _TranslationsSettingsCustomizationTr customization = _TranslationsSettingsCustomizationTr._(_root);
|
||||
@override late final _TranslationsSettingsGeneralSettingsTr generalSettings = _TranslationsSettingsGeneralSettingsTr._(_root);
|
||||
}
|
||||
@@ -598,6 +599,7 @@ extension on TranslationsTr {
|
||||
'settings.moreInfoAppDescription' => 'Uygulamanın bilgi sayfasına bağlantı',
|
||||
'settings.moreApps' => 'Diğer uygulamalarım',
|
||||
'settings.moreAppsDescription' => 'Daha fazla uygulama, iletişim, bağış ve daha fazlası',
|
||||
'settings.selectAnOption' => 'Bir seçenek seçin',
|
||||
'settings.customization.customization' => 'Özelleştirme',
|
||||
'settings.customization.customizationDescription' => 'Uygulama temasını ve renk paletini ayarlayın.',
|
||||
'settings.customization.theme' => 'Tema',
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
"moreInfoAppDescription": "Uygulamanın bilgi sayfasına bağlantı",
|
||||
"moreApps": "Diğer uygulamalarım",
|
||||
"moreAppsDescription": "Daha fazla uygulama, iletişim, bağış ve daha fazlası",
|
||||
"selectAnOption": "Bir seçenek seçin",
|
||||
"customization": {
|
||||
"customization": "Özelleştirme",
|
||||
"customizationDescription": "Uygulama temasını ve renk paletini ayarlayın.",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
|
||||
import 'package:linkdy/screens/settings/ui/customization/customization.dart';
|
||||
import 'package:linkdy/screens/settings/provider/settings.provider.dart';
|
||||
@@ -24,10 +23,11 @@ class SettingsScreen extends ConsumerWidget {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth > Sizes.tabletBreakpoint) {
|
||||
return const SplitView.material(
|
||||
hideDivider: true,
|
||||
flexWidth: FlexWidth(mainViewFlexWidth: 1, secondaryViewFlexWidth: 2),
|
||||
child: _List(tabletView: true),
|
||||
return Row(
|
||||
children: [
|
||||
const Expanded(flex: 1, child: _List(tabletView: true)),
|
||||
Expanded(flex: 2, child: Material(child: const _DetailPanel())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return const _List(tabletView: false);
|
||||
@@ -163,7 +163,6 @@ class _SettingsTile extends ConsumerWidget {
|
||||
selectedItem: ref.watch(settingsProvider).selectedScreen,
|
||||
onTap: () {
|
||||
ref.read(settingsProvider.notifier).setSelectedScreen(thisItem);
|
||||
SplitView.of(context).setSecondary(screenToNavigate);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
@@ -178,3 +177,26 @@ class _SettingsTile extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _DetailPanel extends ConsumerWidget {
|
||||
const _DetailPanel();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final selectedScreen = ref.watch(settingsProvider).selectedScreen;
|
||||
|
||||
switch (selectedScreen) {
|
||||
case 0:
|
||||
return const Customization();
|
||||
case 1:
|
||||
return const GeneralSettings();
|
||||
default:
|
||||
return Center(
|
||||
child: Text(
|
||||
t.settings.selectAnOption,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:super_context_menu/super_context_menu.dart';
|
||||
|
||||
import 'package:linkdy/models/data/bookmarks.dart';
|
||||
import 'package:linkdy/i18n/strings.g.dart';
|
||||
|
||||
// Wait until the context menu close animation animation finishes
|
||||
Duration _durationTime = const Duration(milliseconds: 150);
|
||||
|
||||
class BookmarkContextMenu extends ConsumerWidget {
|
||||
final Widget child;
|
||||
final Bookmark bookmark;
|
||||
@@ -31,69 +27,119 @@ class BookmarkContextMenu extends ConsumerWidget {
|
||||
required this.onShareInternally,
|
||||
});
|
||||
|
||||
void _showBottomSheet(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isDismissible: true,
|
||||
builder: (ctx) => SafeArea(
|
||||
bottom: true,
|
||||
top: true,
|
||||
child: Wrap(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
bookmark.unread == true ? Icons.mark_email_read_rounded : Icons.mark_as_unread_rounded,
|
||||
),
|
||||
title: Text(
|
||||
bookmark.unread == true
|
||||
? t.bookmarks.bookmarkOptions.markAsRead
|
||||
: t.bookmarks.bookmarkOptions.markAsUnread,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
onReadUnread(bookmark);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
bookmark.isArchived == true ? Icons.unarchive_rounded : Icons.archive_rounded,
|
||||
),
|
||||
title: Text(
|
||||
bookmark.isArchived == true
|
||||
? t.bookmarks.bookmarkOptions.unarchive
|
||||
: t.bookmarks.bookmarkOptions.archive,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
onArchiveUnarchive(bookmark);
|
||||
},
|
||||
),
|
||||
ExpansionTile(
|
||||
leading: const Icon(Icons.share_rounded),
|
||||
title: Text(t.bookmarks.bookmarkOptions.shareOptions),
|
||||
children: [
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 44),
|
||||
leading: const Icon(Icons.input_rounded),
|
||||
title: Text(
|
||||
bookmark.shared == true
|
||||
? t.bookmarks.bookmarkOptions.unshareInternally
|
||||
: t.bookmarks.bookmarkOptions.shareInternally,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
onShareInternally(bookmark);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 44),
|
||||
leading: const Icon(Icons.output_rounded),
|
||||
title: Text(t.bookmarks.bookmarkOptions.shareThirdPartyApp),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
Share.share(bookmark.url!);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.edit_rounded),
|
||||
title: Text(t.bookmarks.bookmarkOptions.edit),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
onEdit(bookmark);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
Icons.delete_rounded,
|
||||
color: Theme.of(ctx).colorScheme.error,
|
||||
),
|
||||
title: Text(
|
||||
t.bookmarks.bookmarkOptions.delete,
|
||||
style: TextStyle(color: Theme.of(ctx).colorScheme.error),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(ctx);
|
||||
onDelete(bookmark);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return ContextMenuWidget(
|
||||
menuProvider: (request) => Menu(
|
||||
children: [
|
||||
MenuAction(
|
||||
callback: () => Future.delayed(_durationTime).then((value) => onReadUnread(bookmark)),
|
||||
title: bookmark.unread == true
|
||||
? t.bookmarks.bookmarkOptions.markAsRead
|
||||
: t.bookmarks.bookmarkOptions.markAsUnread,
|
||||
image: MenuImage.icon(
|
||||
bookmark.unread == true ? Icons.mark_email_read_rounded : Icons.mark_as_unread_rounded,
|
||||
),
|
||||
),
|
||||
MenuAction(
|
||||
callback: () => Future.delayed(_durationTime).then((value) => onArchiveUnarchive(bookmark)),
|
||||
title: bookmark.isArchived == true
|
||||
? t.bookmarks.bookmarkOptions.unarchive
|
||||
: t.bookmarks.bookmarkOptions.archive,
|
||||
image: MenuImage.icon(
|
||||
bookmark.isArchived == true ? Icons.unarchive_rounded : Icons.archive_rounded,
|
||||
),
|
||||
),
|
||||
Menu(
|
||||
title: t.bookmarks.bookmarkOptions.shareOptions,
|
||||
image: MenuImage.icon(Icons.share_rounded),
|
||||
children: [
|
||||
MenuAction(
|
||||
callback: () => Future.delayed(_durationTime).then((value) => onShareInternally(bookmark)),
|
||||
title: bookmark.shared == true
|
||||
? t.bookmarks.bookmarkOptions.unshareInternally
|
||||
: t.bookmarks.bookmarkOptions.shareInternally,
|
||||
image: MenuImage.icon(Icons.input_rounded),
|
||||
),
|
||||
MenuAction(
|
||||
callback: () {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
Future.delayed(_durationTime).then(
|
||||
(value) => Share.share(
|
||||
bookmark.url!,
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
),
|
||||
);
|
||||
},
|
||||
title: t.bookmarks.bookmarkOptions.shareThirdPartyApp,
|
||||
image: MenuImage.icon(Icons.output_rounded),
|
||||
),
|
||||
],
|
||||
),
|
||||
MenuSeparator(),
|
||||
MenuAction(
|
||||
callback: () => Future.delayed(_durationTime).then((value) => onEdit(bookmark)),
|
||||
title: t.bookmarks.bookmarkOptions.edit,
|
||||
image: MenuImage.icon(Icons.edit_rounded),
|
||||
),
|
||||
MenuAction(
|
||||
callback: () => Future.delayed(_durationTime).then((value) => onDelete(bookmark)),
|
||||
title: t.bookmarks.bookmarkOptions.delete,
|
||||
image: MenuImage.icon(Icons.delete_rounded),
|
||||
attributes: const MenuActionAttributes(destructive: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
return GestureDetector(
|
||||
onLongPress: () => _showBottomSheet(context),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user