Adapted bookmarks list to tablet mode
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/favicon_loader.provider.dart';
|
||||
import 'package:linkdy/screens/bookmarks/model/bookmarks.model.dart';
|
||||
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
import 'package:linkdy/providers/router.provider.dart';
|
||||
import 'package:linkdy/router/paths.dart';
|
||||
import 'package:linkdy/utils/open_url.dart';
|
||||
import 'package:linkdy/models/data/bookmarks.dart';
|
||||
import 'package:linkdy/providers/api_client.provider.dart';
|
||||
import 'package:linkdy/constants/enums.dart';
|
||||
@@ -93,6 +98,16 @@ class Bookmarks extends _$Bookmarks {
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void selectBookmark(Bookmark bookmark, double width) {
|
||||
if (width <= Sizes.tabletBreakpoint && ref.watch(appStatusProvider).useInAppBrowser == true) {
|
||||
ref.watch(routerProvider).push(RoutesPaths.webview, extra: bookmark);
|
||||
} else if (width <= Sizes.tabletBreakpoint && ref.watch(appStatusProvider).useInAppBrowser == true) {
|
||||
openUrl(bookmark.url!);
|
||||
}
|
||||
state.selectedBookmark = bookmark;
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> refresh() async {
|
||||
await ref.read(bookmarksRequestProvider(state.readStatus, state.limit).future);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ final bookmarksRequestLoadMoreProvider =
|
||||
);
|
||||
|
||||
typedef BookmarksRequestLoadMoreRef = AutoDisposeFutureProviderRef<void>;
|
||||
String _$bookmarksHash() => r'6ebfea9e1b2b70e692527de3a3cccd0c85946c12';
|
||||
String _$bookmarksHash() => r'80e94e586950b9072f229958f98c88069086d7ab';
|
||||
|
||||
/// See also [Bookmarks].
|
||||
@ProviderFor(Bookmarks)
|
||||
|
||||
@@ -6,6 +6,11 @@ import 'package:linkdy/screens/bookmarks/provider/bookmarks.provider.dart';
|
||||
import 'package:linkdy/screens/bookmarks/provider/common_functions.dart';
|
||||
import 'package:linkdy/screens/bookmarks/model/search_bookmarks.model.dart';
|
||||
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
import 'package:linkdy/providers/router.provider.dart';
|
||||
import 'package:linkdy/router/paths.dart';
|
||||
import 'package:linkdy/utils/open_url.dart';
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
import 'package:linkdy/constants/enums.dart';
|
||||
import 'package:linkdy/models/data/bookmarks.dart';
|
||||
@@ -99,6 +104,16 @@ class SearchBookmarks extends _$SearchBookmarks {
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void selectBookmark(Bookmark bookmark, double width) {
|
||||
if (width <= Sizes.tabletBreakpoint && ref.watch(appStatusProvider).useInAppBrowser == true) {
|
||||
ref.watch(routerProvider).push(RoutesPaths.webview, extra: bookmark);
|
||||
} else if (width <= Sizes.tabletBreakpoint && ref.watch(appStatusProvider).useInAppBrowser == true) {
|
||||
openUrl(bookmark.url!);
|
||||
}
|
||||
state.selectedBookmark = bookmark;
|
||||
ref.notifyListeners();
|
||||
}
|
||||
|
||||
void deleteBookmark(Bookmark bookmark) async {
|
||||
final result = await BookmarkCommonFunctions.deleteBookmark<SearchBookmarksModel>(
|
||||
ref: ref,
|
||||
|
||||
@@ -174,7 +174,7 @@ final fetchSearchBookmarksLoadMoreProvider =
|
||||
);
|
||||
|
||||
typedef FetchSearchBookmarksLoadMoreRef = AutoDisposeFutureProviderRef<void>;
|
||||
String _$searchBookmarksHash() => r'bdb0eedf3ebdde4b2cb4795efe61ce42e4c85d00';
|
||||
String _$searchBookmarksHash() => r'3daf460b8389e8bcf8498c4bdf3935e88f4ce156';
|
||||
|
||||
/// See also [SearchBookmarks].
|
||||
@ProviderFor(SearchBookmarks)
|
||||
|
||||
Reference in New Issue
Block a user