Browse Source

fix(neon): Fix svg loading for web

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/372/head
jld3103 1 year ago
parent
commit
9e2d14f0e7
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/neon/neon/lib/src/utils/push_utils.dart

4
packages/neon/neon/lib/src/utils/push_utils.dart

@ -7,7 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart' show SvgFileLoader, vg; import 'package:flutter_svg/flutter_svg.dart' show SvgStringLoader, vg;
import 'package:image/image.dart' as img; import 'package:image/image.dart' as img;
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:neon/src/blocs/accounts.dart'; import 'package:neon/src/blocs/accounts.dart';
@ -106,7 +106,7 @@ class PushUtils {
final cacheManager = DefaultCacheManager(); final cacheManager = DefaultCacheManager();
final file = await cacheManager.getSingleFile(notification.icon!); final file = await cacheManager.getSingleFile(notification.icon!);
final pictureInfo = await vg.loadPicture(SvgFileLoader(file), null); final pictureInfo = await vg.loadPicture(SvgStringLoader(file.readAsStringSync()), null);
const largeIconSize = 256; const largeIconSize = 256;
final scale = largeIconSize / pictureInfo.size.longestSide; final scale = largeIconSize / pictureInfo.size.longestSide;

Loading…
Cancel
Save