Bug fixes
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
/// To regenerate, run: `dart run slang`
|
/// To regenerate, run: `dart run slang`
|
||||||
///
|
///
|
||||||
/// Locales: 3
|
/// Locales: 3
|
||||||
/// Strings: 621 (207 per locale)
|
/// Strings: 624 (208 per locale)
|
||||||
///
|
///
|
||||||
/// Built on 2025-04-03 at 20:13 UTC
|
/// Built on 2025-04-03 at 20:45 UTC
|
||||||
|
|
||||||
// coverage:ignore-file
|
// coverage:ignore-file
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -296,6 +296,7 @@ class _StringsWebviewEn {
|
|||||||
String get copyLinkClipboard => 'Copy link to clipboard';
|
String get copyLinkClipboard => 'Copy link to clipboard';
|
||||||
String get linkCopiedClipboard => 'Link copied to the clipboard.';
|
String get linkCopiedClipboard => 'Link copied to the clipboard.';
|
||||||
String get share => 'Share';
|
String get share => 'Share';
|
||||||
|
String get invalidBookmarkData => 'The bookmark has invalid data or it\'s corrupted.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: colors
|
// Path: colors
|
||||||
@@ -709,6 +710,7 @@ class _StringsWebviewEs implements _StringsWebviewEn {
|
|||||||
@override String get copyLinkClipboard => 'Copiar enlace al portapapeles';
|
@override String get copyLinkClipboard => 'Copiar enlace al portapapeles';
|
||||||
@override String get linkCopiedClipboard => 'Enlace copiado al portapapeles.';
|
@override String get linkCopiedClipboard => 'Enlace copiado al portapapeles.';
|
||||||
@override String get share => 'Compartir';
|
@override String get share => 'Compartir';
|
||||||
|
@override String get invalidBookmarkData => 'El marcador tiene datos inválidos o está corrupto.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: colors
|
// Path: colors
|
||||||
@@ -1122,6 +1124,7 @@ class _StringsWebviewTr implements _StringsWebviewEn {
|
|||||||
@override String get copyLinkClipboard => 'Bağlantıyı panoya kopyala';
|
@override String get copyLinkClipboard => 'Bağlantıyı panoya kopyala';
|
||||||
@override String get linkCopiedClipboard => 'Bağlantı panoya kopyalandı.';
|
@override String get linkCopiedClipboard => 'Bağlantı panoya kopyalandı.';
|
||||||
@override String get share => 'Paylaş';
|
@override String get share => 'Paylaş';
|
||||||
|
@override String get invalidBookmarkData => 'The bookmark has invalid data or it\'s corrupted.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: colors
|
// Path: colors
|
||||||
@@ -1566,6 +1569,7 @@ extension on Translations {
|
|||||||
case 'webview.copyLinkClipboard': return 'Copy link to clipboard';
|
case 'webview.copyLinkClipboard': return 'Copy link to clipboard';
|
||||||
case 'webview.linkCopiedClipboard': return 'Link copied to the clipboard.';
|
case 'webview.linkCopiedClipboard': return 'Link copied to the clipboard.';
|
||||||
case 'webview.share': return 'Share';
|
case 'webview.share': return 'Share';
|
||||||
|
case 'webview.invalidBookmarkData': return 'The bookmark has invalid data or it\'s corrupted.';
|
||||||
case 'colors.red': return 'Red';
|
case 'colors.red': return 'Red';
|
||||||
case 'colors.green': return 'Green';
|
case 'colors.green': return 'Green';
|
||||||
case 'colors.blue': return 'Blue';
|
case 'colors.blue': return 'Blue';
|
||||||
@@ -1781,6 +1785,7 @@ extension on _StringsEs {
|
|||||||
case 'webview.copyLinkClipboard': return 'Copiar enlace al portapapeles';
|
case 'webview.copyLinkClipboard': return 'Copiar enlace al portapapeles';
|
||||||
case 'webview.linkCopiedClipboard': return 'Enlace copiado al portapapeles.';
|
case 'webview.linkCopiedClipboard': return 'Enlace copiado al portapapeles.';
|
||||||
case 'webview.share': return 'Compartir';
|
case 'webview.share': return 'Compartir';
|
||||||
|
case 'webview.invalidBookmarkData': return 'El marcador tiene datos inválidos o está corrupto.';
|
||||||
case 'colors.red': return 'Rojo';
|
case 'colors.red': return 'Rojo';
|
||||||
case 'colors.green': return 'Verde';
|
case 'colors.green': return 'Verde';
|
||||||
case 'colors.blue': return 'Azul';
|
case 'colors.blue': return 'Azul';
|
||||||
@@ -1996,6 +2001,7 @@ extension on _StringsTr {
|
|||||||
case 'webview.copyLinkClipboard': return 'Bağlantıyı panoya kopyala';
|
case 'webview.copyLinkClipboard': return 'Bağlantıyı panoya kopyala';
|
||||||
case 'webview.linkCopiedClipboard': return 'Bağlantı panoya kopyalandı.';
|
case 'webview.linkCopiedClipboard': return 'Bağlantı panoya kopyalandı.';
|
||||||
case 'webview.share': return 'Paylaş';
|
case 'webview.share': return 'Paylaş';
|
||||||
|
case 'webview.invalidBookmarkData': return 'The bookmark has invalid data or it\'s corrupted.';
|
||||||
case 'colors.red': return 'Kırmızı';
|
case 'colors.red': return 'Kırmızı';
|
||||||
case 'colors.green': return 'Yeşil';
|
case 'colors.green': return 'Yeşil';
|
||||||
case 'colors.blue': return 'Mavi';
|
case 'colors.blue': return 'Mavi';
|
||||||
|
|||||||
@@ -227,7 +227,8 @@
|
|||||||
"openInSystemBrowser": "Open in system browser",
|
"openInSystemBrowser": "Open in system browser",
|
||||||
"copyLinkClipboard": "Copy link to clipboard",
|
"copyLinkClipboard": "Copy link to clipboard",
|
||||||
"linkCopiedClipboard": "Link copied to the clipboard.",
|
"linkCopiedClipboard": "Link copied to the clipboard.",
|
||||||
"share": "Share"
|
"share": "Share",
|
||||||
|
"invalidBookmarkData": "The bookmark has invalid data or it's corrupted."
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
"red": "Red",
|
"red": "Red",
|
||||||
|
|||||||
@@ -227,7 +227,8 @@
|
|||||||
"openInSystemBrowser": "Abrir en el navegador del sistema",
|
"openInSystemBrowser": "Abrir en el navegador del sistema",
|
||||||
"copyLinkClipboard": "Copiar enlace al portapapeles",
|
"copyLinkClipboard": "Copiar enlace al portapapeles",
|
||||||
"linkCopiedClipboard": "Enlace copiado al portapapeles.",
|
"linkCopiedClipboard": "Enlace copiado al portapapeles.",
|
||||||
"share": "Compartir"
|
"share": "Compartir",
|
||||||
|
"invalidBookmarkData": "El marcador tiene datos inválidos o está corrupto."
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
"red": "Rojo",
|
"red": "Rojo",
|
||||||
|
|||||||
@@ -227,7 +227,8 @@
|
|||||||
"openInSystemBrowser": "Sistem tarayıcısında aç",
|
"openInSystemBrowser": "Sistem tarayıcısında aç",
|
||||||
"copyLinkClipboard": "Bağlantıyı panoya kopyala",
|
"copyLinkClipboard": "Bağlantıyı panoya kopyala",
|
||||||
"linkCopiedClipboard": "Bağlantı panoya kopyalandı.",
|
"linkCopiedClipboard": "Bağlantı panoya kopyalandı.",
|
||||||
"share": "Paylaş"
|
"share": "Paylaş",
|
||||||
|
"invalidBookmarkData": "The bookmark has invalid data or it's corrupted."
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
"red": "Kırmızı",
|
"red": "Kırmızı",
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class BookmarkForm extends _$BookmarkForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initializeProviderUrl(String url) {
|
void initializeProviderUrl(String url) {
|
||||||
|
try {
|
||||||
final decoded = Uri.decodeComponent(url);
|
final decoded = Uri.decodeComponent(url);
|
||||||
var value = decoded.contains(":~:text=") ? decoded.split(":~:text=")[1] : null;
|
var value = decoded.contains(":~:text=") ? decoded.split(":~:text=")[1] : null;
|
||||||
state.urlController.text = value ?? decoded;
|
state.urlController.text = value ?? decoded;
|
||||||
@@ -71,6 +72,11 @@ class BookmarkForm extends _$BookmarkForm {
|
|||||||
} else {
|
} else {
|
||||||
state.urlError = t.bookmarks.addBookmark.invalidUrl;
|
state.urlError = t.bookmarks.addBookmark.invalidUrl;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
state.urlController.text = url;
|
||||||
|
state.urlError = t.bookmarks.addBookmark.invalidUrl;
|
||||||
|
ref.notifyListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateUrl(String value) {
|
void validateUrl(String value) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|||||||
import 'package:linkdy/screens/webview/ui/webview.dart';
|
import 'package:linkdy/screens/webview/ui/webview.dart';
|
||||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||||
import 'package:linkdy/screens/bookmarks/model/bookmarks.model.dart';
|
import 'package:linkdy/screens/bookmarks/model/bookmarks.model.dart';
|
||||||
|
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||||
|
|
||||||
import 'package:linkdy/config/sizes.dart';
|
import 'package:linkdy/config/sizes.dart';
|
||||||
import 'package:linkdy/constants/global_keys.dart';
|
import 'package:linkdy/constants/global_keys.dart';
|
||||||
@@ -33,7 +34,7 @@ FutureOr<void> bookmarksRequest(
|
|||||||
sort: "${type == SortingType.title ? "title" : "added"}_${way == SortingWay.ascendant ? "asc" : "desc"}",
|
sort: "${type == SortingType.title ? "title" : "added"}_${way == SortingWay.ascendant ? "asc" : "desc"}",
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.successful == true) {
|
if (result.successful == true && result.content?.results != null && result.content?.count != null) {
|
||||||
ref.read(bookmarksProvider).bookmarks = result.content!.results!;
|
ref.read(bookmarksProvider).bookmarks = result.content!.results!;
|
||||||
ref.read(bookmarksProvider).maxNumber = result.content!.count!;
|
ref.read(bookmarksProvider).maxNumber = result.content!.count!;
|
||||||
ref.read(bookmarksProvider).currentPage = 0;
|
ref.read(bookmarksProvider).currentPage = 0;
|
||||||
@@ -89,10 +90,20 @@ class Bookmarks extends _$Bookmarks {
|
|||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: _webViewRoute,
|
path: _webViewRoute,
|
||||||
pageBuilder: (context, state) => CustomTransitionPage(
|
pageBuilder: (context, state) {
|
||||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
final extra = state.extra;
|
||||||
|
if (extra is Bookmark) {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: WebViewScreen(bookmark: extra),
|
||||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
),
|
);
|
||||||
|
} else {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: const InvalidBookmarkScreen(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:linkdy/screens/webview/ui/webview.dart';
|
|||||||
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
||||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||||
import 'package:linkdy/screens/bookmarks/model/search_bookmarks.model.dart';
|
import 'package:linkdy/screens/bookmarks/model/search_bookmarks.model.dart';
|
||||||
|
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||||
|
|
||||||
import 'package:linkdy/config/sizes.dart';
|
import 'package:linkdy/config/sizes.dart';
|
||||||
import 'package:linkdy/providers/app_status.provider.dart';
|
import 'package:linkdy/providers/app_status.provider.dart';
|
||||||
@@ -30,7 +31,6 @@ FutureOr<void> fetchSearchBookmarks(FetchSearchBookmarksRef ref, int limit) asyn
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (result.successful == true) {
|
if (result.successful == true) {
|
||||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(result.content!.results!);
|
|
||||||
ref.read(searchBookmarksProvider).bookmarks = result.content!.results!;
|
ref.read(searchBookmarksProvider).bookmarks = result.content!.results!;
|
||||||
ref.read(searchBookmarksProvider).maxNumber = result.content!.count!;
|
ref.read(searchBookmarksProvider).maxNumber = result.content!.count!;
|
||||||
ref.read(searchBookmarksProvider).currentPage = 0;
|
ref.read(searchBookmarksProvider).currentPage = 0;
|
||||||
@@ -81,10 +81,20 @@ class SearchBookmarks extends _$SearchBookmarks {
|
|||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: _webViewRoute,
|
path: _webViewRoute,
|
||||||
pageBuilder: (context, state) => CustomTransitionPage(
|
pageBuilder: (context, state) {
|
||||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
final extra = state.extra;
|
||||||
|
if (extra is Bookmark) {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: WebViewScreen(bookmark: extra),
|
||||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
),
|
);
|
||||||
|
} else {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: const InvalidBookmarkScreen(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:linkdy/screens/webview/ui/webview.dart';
|
|||||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||||
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
||||||
import 'package:linkdy/screens/filtered_bookmarks/model/filtered_bookmarks.model.dart';
|
import 'package:linkdy/screens/filtered_bookmarks/model/filtered_bookmarks.model.dart';
|
||||||
|
import 'package:linkdy/screens/webview/ui/invalid_bookmark.dart';
|
||||||
|
|
||||||
import 'package:linkdy/config/sizes.dart';
|
import 'package:linkdy/config/sizes.dart';
|
||||||
import 'package:linkdy/constants/global_keys.dart';
|
import 'package:linkdy/constants/global_keys.dart';
|
||||||
@@ -35,7 +36,6 @@ FutureOr<void> tagBookmarksRequest(TagBookmarksRequestRef ref, Tag? tag, String?
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (bookmarksResult.successful == true) {
|
if (bookmarksResult.successful == true) {
|
||||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(bookmarksResult.content!.results!);
|
|
||||||
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
||||||
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
||||||
if (tag == null) ref.read(filteredBookmarksProvider).tag = tagResult!.content!;
|
if (tag == null) ref.read(filteredBookmarksProvider).tag = tagResult!.content!;
|
||||||
@@ -83,7 +83,6 @@ FutureOr<void> filteredBookmarksRequest(FilteredBookmarksRequestRef ref, Filtere
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (bookmarksResult.successful == true) {
|
if (bookmarksResult.successful == true) {
|
||||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(bookmarksResult.content!.results!);
|
|
||||||
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
ref.read(filteredBookmarksProvider).bookmarks = bookmarksResult.content!.results!;
|
||||||
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
ref.read(filteredBookmarksProvider).maxNumber = bookmarksResult.content!.count!;
|
||||||
ref.read(filteredBookmarksProvider).currentPage = 0;
|
ref.read(filteredBookmarksProvider).currentPage = 0;
|
||||||
@@ -115,7 +114,6 @@ FutureOr<void> filteredBookmarksRequestLoadMore(TagBookmarksRequestLoadMoreRef r
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (result.successful == true) {
|
if (result.successful == true) {
|
||||||
// ref.read(faviconStoreProvider.notifier).loadFavicons(result.content!.results!);
|
|
||||||
provider.bookmarks = [...provider.bookmarks, ...result.content!.results!];
|
provider.bookmarks = [...provider.bookmarks, ...result.content!.results!];
|
||||||
provider.maxNumber = result.content!.count!;
|
provider.maxNumber = result.content!.count!;
|
||||||
provider.currentPage = provider.currentPage + 1;
|
provider.currentPage = provider.currentPage + 1;
|
||||||
@@ -141,10 +139,20 @@ class FilteredBookmarks extends _$FilteredBookmarks {
|
|||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: _webViewRoute,
|
path: _webViewRoute,
|
||||||
pageBuilder: (context, state) => CustomTransitionPage(
|
pageBuilder: (context, state) {
|
||||||
child: WebViewScreen(bookmark: state.extra as Bookmark),
|
final extra = state.extra;
|
||||||
|
if (extra is Bookmark) {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: WebViewScreen(bookmark: extra),
|
||||||
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
),
|
);
|
||||||
|
} else {
|
||||||
|
return CustomTransitionPage(
|
||||||
|
child: const InvalidBookmarkScreen(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
18
lib/screens/webview/ui/invalid_bookmark.dart
Normal file
18
lib/screens/webview/ui/invalid_bookmark.dart
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:linkdy/i18n/strings.g.dart';
|
||||||
|
|
||||||
|
import 'package:linkdy/widgets/error_screen.dart';
|
||||||
|
|
||||||
|
class InvalidBookmarkScreen extends StatelessWidget {
|
||||||
|
const InvalidBookmarkScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(),
|
||||||
|
body: Center(
|
||||||
|
child: ErrorScreen(error: t.webview.invalidBookmarkData),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user