diff --git a/android/app/src/debug/res/drawable/ic_launcher_foreground.xml b/android/app/src/debug/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 000000000..f1023f683 --- /dev/null +++ b/android/app/src/debug/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/android/app/src/main/ic_launcher-web.png b/android/app/src/main/ic_launcher-web.png deleted file mode 100644 index df48ca3ed..000000000 Binary files a/android/app/src/main/ic_launcher-web.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/app/src/main/res/drawable/ic_launcher_foreground.xml index b0d6c39b3..8f7ff6c1e 100644 --- a/android/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,29 +1,30 @@ - - - - - - + android:viewportWidth="108" + android:viewportHeight="108"> + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index ac7522098..18c76a697 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 8fa6c9f68..644a73bb4 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 846937c91..2764beb47 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index e7cf75b20..6cccc47ff 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 854d57520..7e9003c34 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 4c2fb3b15..c70ef8f6b 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 105ff1c9d..70801fc46 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index d1e0ebb0a..335d15d58 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index c31b8d6b5..4f856ac51 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index 0b928e479..0552c72b5 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/profile/res/drawable/ic_launcher_foreground.xml b/android/app/src/profile/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 000000000..87fb28844 --- /dev/null +++ b/android/app/src/profile/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/assets/aves_logo.svg b/assets/aves_logo.svg index dc161703a..a3c89f30d 100644 --- a/assets/aves_logo.svg +++ b/assets/aves_logo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/lib/image_providers/uri_picture_provider.dart b/lib/image_providers/uri_picture_provider.dart deleted file mode 100644 index b50168c93..000000000 --- a/lib/image_providers/uri_picture_provider.dart +++ /dev/null @@ -1,60 +0,0 @@ -import 'package:aves/services/services.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_svg/flutter_svg.dart'; - -class UriPicture extends PictureProvider { - const UriPicture({ - required this.uri, - required this.mimeType, - ColorFilter? colorFilter, - }) : super(colorFilter); - - final String uri, mimeType; - - @override - Future obtainKey(PictureConfiguration picture) { - return SynchronousFuture(this); - } - - @override - PictureStreamCompleter load(UriPicture key, {PictureErrorListener? onError}) { - return OneFramePictureStreamCompleter(_loadAsync(key, onError: onError), informationCollector: () sync* { - yield DiagnosticsProperty('uri', uri); - }); - } - - Future _loadAsync(UriPicture key, {PictureErrorListener? onError}) async { - assert(key == this); - - final data = await imageFileService.getSvg(uri, mimeType); - if (data.isEmpty) { - return null; - } - - final decoder = SvgPicture.svgByteDecoder; - if (onError != null) { - return decoder( - data, - colorFilter, - key.toString(), - ).catchError((error, stack) async { - onError(error, stack); - return Future.error(error, stack); - }); - } - return decoder(data, colorFilter, key.toString()); - } - - @override - bool operator ==(Object other) { - if (other.runtimeType != runtimeType) return false; - return other is UriPicture && other.uri == uri && other.colorFilter == colorFilter; - } - - @override - int get hashCode => hashValues(uri, colorFilter); - - @override - String toString() => '$runtimeType#${shortHash(this)}{uri=$uri, mimeType=$mimeType, colorFilter=$colorFilter}'; -} diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index a0b131b4e..7034249ac 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -197,12 +197,6 @@ class Constants { licenseUrl: 'https://github.com/mobiten/flutter_staggered_animations/blob/master/LICENSE', sourceUrl: 'https://github.com/mobiten/flutter_staggered_animations', ), - Dependency( - name: 'Flutter SVG', - license: 'MIT', - licenseUrl: 'https://github.com/dnfield/flutter_svg/blob/master/LICENSE', - sourceUrl: 'https://github.com/dnfield/flutter_svg', - ), Dependency( name: 'Material Design Icons Flutter', license: 'MIT', diff --git a/lib/widgets/common/identity/aves_logo.dart b/lib/widgets/common/identity/aves_logo.dart index 89abc6903..869abcee6 100644 --- a/lib/widgets/common/identity/aves_logo.dart +++ b/lib/widgets/common/identity/aves_logo.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class AvesLogo extends StatelessWidget { final double size; @@ -16,11 +15,99 @@ class AvesLogo extends StatelessWidget { radius: size / 2, child: Padding( padding: EdgeInsets.only(top: size / 15), - child: SvgPicture.asset( - 'assets/aves_logo.svg', - width: size / 1.4, + child: CustomPaint( + size: Size(size / 1.4, size / 1.4), + painter: AvesLogoPainter(), ), ), ); } } + +class AvesLogoPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + final dim = size.width / 100; + final strokePaint = Paint() + ..style = PaintingStyle.stroke + ..color = Colors.black + ..strokeWidth = dim * 2.346 + ..strokeJoin = StrokeJoin.round; + + final path0 = Path(); + path0.moveTo(dim * 3.925, dim * 16.034); + path0.relativeLineTo(dim * 56.9, dim * 56.9); + path0.relativeArcToPoint(Offset(dim * 3.423, dim * 0), radius: Radius.circular(dim * 2.42), rotation: 0.001, clockwise: false); + path0.lineTo(dim * 74.852, dim * 62.33); + path0.relativeArcToPoint(Offset(dim * 0, dim * -9.601), radius: Radius.circular(dim * 6.79), rotation: 90.001, clockwise: false); + path0.lineTo(dim * 34.067, dim * 11.942); + path0.relativeArcToPoint(Offset(dim * -5.844, dim * -2.42), radius: Radius.circular(dim * 8.264), rotation: 22.5, clockwise: false); + path0.relativeLineTo(dim * -21.6, dim * 0); + path0.relativeArcToPoint(Offset(dim * -2.697, dim * 6.512), radius: Radius.circular(dim * 3.815), rotation: 112.5, clockwise: false); + path0.close(); + + canvas.drawPath(path0, strokePaint); + canvas.drawPath( + path0, + Paint() + ..style = PaintingStyle.fill + ..color = const Color(0xff3f51b5), + ); + + Path path1 = Path(); + path1.moveTo(dim * 36.36, dim * 65.907); + path1.lineTo(dim * 36.36, dim * 94.65); + path1.relativeArcToPoint(Offset(dim * 4.364, dim * 1.808), radius: Radius.circular(dim * 2.557), rotation: 22.5, clockwise: false); + path1.relativeLineTo(dim * 13.093, dim * -13.094); + path1.relativeArcToPoint(Offset(dim * 0, dim * -8.728), radius: Radius.circular(dim * 6.172), rotation: 90, clockwise: false); + path1.lineTo(dim * 42.532, dim * 63.35); + path1.relativeArcToPoint(Offset(dim * -6.172, dim * 2.557), radius: Radius.circular(dim * 3.616), rotation: 157.5, clockwise: false); + path1.close(); + + canvas.drawPath(path1, strokePaint); + canvas.drawPath( + path1, + Paint() + ..style = PaintingStyle.fill + ..color = const Color(0xff4caf50), + ); + + Path path2 = Path(); + path2.moveTo(dim * 79.653, dim * 40.078); + path2.lineTo(dim * 79.653, dim * 11.335); + path2.relativeArcToPoint(Offset(dim * -4.364, dim * -1.808), radius: Radius.circular(dim * 2.557), rotation: 22.5, clockwise: false); + path2.lineTo(dim * 62.195, dim * 22.62); + path2.relativeArcToPoint(Offset(dim * 0, dim * 8.729), radius: Radius.circular(dim * 6.172), rotation: 90, clockwise: false); + path2.relativeLineTo(dim * 11.286, dim * 11.285); + path2.relativeArcToPoint(Offset(dim * 6.172, dim * -2.556), radius: Radius.circular(dim * 3.616), rotation: 157.5, clockwise: false); + path2.close(); + + canvas.drawPath(path2, strokePaint); + canvas.drawPath( + path2, + Paint() + ..style = PaintingStyle.fill + ..color = const Color(0xffffc107), + ); + + Path path3 = Path(); + path3.moveTo(dim * 96.613, dim * 16.867); + path3.relativeLineTo(dim * -7.528, dim * -7.528); + path3.relativeArcToPoint(Offset(dim * -3.273, dim * 1.355), radius: Radius.circular(dim * 1.917), rotation: 157.5, clockwise: false); + path3.relativeLineTo(dim * 0, dim * 6.173); + path3.relativeArcToPoint(Offset(dim * 4.629, dim * 4.629), radius: Radius.circular(dim * 4.63), rotation: 45, clockwise: false); + path3.relativeLineTo(dim * 4.255, dim * 0); + path3.relativeArcToPoint(Offset(dim * 1.917, dim * -4.63), radius: Radius.circular(dim * 2.712), rotation: 112.5, clockwise: false); + path3.close(); + + canvas.drawPath(path3, strokePaint); + canvas.drawPath( + path3, + Paint() + ..style = PaintingStyle.fill + ..color = const Color(0xffff5722)); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => true; +} diff --git a/lib/widgets/debug/cache.dart b/lib/widgets/debug/cache.dart index 55f93711d..a88073833 100644 --- a/lib/widgets/debug/cache.dart +++ b/lib/widgets/debug/cache.dart @@ -2,7 +2,6 @@ import 'package:aves/services/services.dart'; import 'package:aves/utils/file_utils.dart'; import 'package:aves/widgets/common/identity/aves_expansion_tile.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class DebugCacheSection extends StatefulWidget { const DebugCacheSection({Key? key}) : super(key: key); @@ -39,22 +38,6 @@ class _DebugCacheSectionState extends State with AutomaticKee ), ], ), - Row( - children: [ - Expanded( - child: Text('SVG cache: ${PictureProvider.cache.count} items'), - ), - const SizedBox(width: 8), - ElevatedButton( - onPressed: () { - PictureProvider.cache.clear(); - - setState(() {}); - }, - child: const Text('Clear'), - ), - ], - ), Row( children: [ const Expanded( diff --git a/pubspec.lock b/pubspec.lock index 446e3e934..027b9c1b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -335,13 +335,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.22.0" flutter_test: dependency: "direct dev" description: flutter @@ -630,13 +623,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.1" path_parsing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a696ad29d..f97b358e3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,6 @@ dependencies: flutter_map: flutter_markdown: flutter_staggered_animations: - flutter_svg: get_it: github: google_api_availability: