Bug fixes

This commit is contained in:
Juan Gilsanz Polo
2024-03-24 02:46:30 +01:00
parent 75aa31ad11
commit 822c65c4e6
3 changed files with 297 additions and 263 deletions

View File

@@ -57,7 +57,9 @@ class BookmarkItem extends ConsumerWidget {
padding: tabletMode ? const EdgeInsets.symmetric(horizontal: 8) : const EdgeInsets.all(0), padding: tabletMode ? const EdgeInsets.symmetric(horizontal: 8) : const EdgeInsets.all(0),
child: ClipRRect( child: ClipRRect(
borderRadius: tabletMode ? BorderRadius.circular(28) : BorderRadius.circular(0), borderRadius: tabletMode ? BorderRadius.circular(28) : BorderRadius.circular(0),
child: ContextMenuWidget( child: Builder(
builder: (context) {
return ContextMenuWidget(
menuProvider: (request) => Menu( menuProvider: (request) => Menu(
children: [ children: [
MenuAction( MenuAction(
@@ -90,9 +92,15 @@ class BookmarkItem extends ConsumerWidget {
image: MenuImage.icon(Icons.input_rounded), image: MenuImage.icon(Icons.input_rounded),
), ),
MenuAction( MenuAction(
callback: () => Future.delayed(_durationTime).then( callback: () {
(value) => Share.shareUri(Uri.parse(bookmark.url!)), 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, title: t.bookmarks.bookmarkOptions.shareThirdPartyApp,
image: MenuImage.icon(Icons.output_rounded), image: MenuImage.icon(Icons.output_rounded),
), ),
@@ -333,6 +341,8 @@ class BookmarkItem extends ConsumerWidget {
), ),
), ),
), ),
);
},
), ),
), ),
); );

View File

@@ -48,12 +48,12 @@ class WebViewScreen extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
bookmark.title != "" ? bookmark.title! : bookmark.websiteTitle!, bookmark.title ?? bookmark.websiteTitle ?? "Website",
style: const TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
bookmark.url!, bookmark.url ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Theme.of(context).colorScheme.onSurfaceVariant, color: Theme.of(context).colorScheme.onSurfaceVariant,

View File

@@ -75,9 +75,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -97,9 +99,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -119,9 +123,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -139,9 +145,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -157,9 +165,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -179,9 +189,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -197,9 +209,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -212,9 +226,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -224,9 +240,11 @@ class ApiClientService {
return const ApiResponse(successful: true); return const ApiResponse(successful: true);
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -242,9 +260,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -266,9 +286,11 @@ class ApiClientService {
return const ApiResponse(successful: true); return const ApiResponse(successful: true);
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
@@ -284,9 +306,11 @@ class ApiClientService {
); );
} on DioException { } on DioException {
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (e, stackTrace) { } on FormatException catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace); Sentry.captureException(e, stackTrace: stackTrace);
return const ApiResponse(successful: false); return const ApiResponse(successful: false);
} catch (_) {
return const ApiResponse(successful: false);
} }
} }
} }