From 73a0331d137c04204ec07593076e8a838a68851e Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Tue, 11 Jun 2024 22:04:42 -0500 Subject: [PATCH] chore(mocktail_image_network): include `pkg:flutter_svg` in example --- .../mocktail_image_network/example/lib/main.dart | 15 ++++++++++++--- .../mocktail_image_network/example/pubspec.yaml | 1 + .../example/test/image_test.dart | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/mocktail_image_network/example/lib/main.dart b/packages/mocktail_image_network/example/lib/main.dart index 8215ba3..fe9fd49 100644 --- a/packages/mocktail_image_network/example/lib/main.dart +++ b/packages/mocktail_image_network/example/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; /// {@template fake_app} /// Sample app used to showcase `mocktail_image_network` @@ -12,9 +13,17 @@ class FakeApp extends StatelessWidget { return MaterialApp( home: Scaffold( body: Center( - child: Image.network( - // URL to the Flutter logo from https://flutter.dev/brand - 'https://storage.googleapis.com/cms-storage-bucket/c823e53b3a1a7b0d36a9.png', + child: Column( + children: [ + Image.network( + // URL to the png Flutter logo from https://flutter.dev/brand + 'https://storage.googleapis.com/cms-storage-bucket/c823e53b3a1a7b0d36a9.png', + ), + SvgPicture.network( + // URL to the svg Flutter logo from https://flutter.dev/brand + 'https://storage.googleapis.com/cms-storage-bucket/847ae81f5430402216fd.svg', + ), + ], ), ), ), diff --git a/packages/mocktail_image_network/example/pubspec.yaml b/packages/mocktail_image_network/example/pubspec.yaml index 4cef473..07cee08 100644 --- a/packages/mocktail_image_network/example/pubspec.yaml +++ b/packages/mocktail_image_network/example/pubspec.yaml @@ -8,6 +8,7 @@ environment: dependencies: flutter: sdk: flutter + flutter_svg: ^2.0.0 dev_dependencies: flutter_test: diff --git a/packages/mocktail_image_network/example/test/image_test.dart b/packages/mocktail_image_network/example/test/image_test.dart index 0511413..d86426c 100644 --- a/packages/mocktail_image_network/example/test/image_test.dart +++ b/packages/mocktail_image_network/example/test/image_test.dart @@ -1,5 +1,6 @@ import 'package:example/main.dart'; import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail_image_network/mocktail_image_network.dart'; @@ -7,5 +8,6 @@ void main() { testWidgets('can use mocktail for network images', (tester) async { await mockNetworkImages(() async => tester.pumpWidget(const FakeApp())); expect(find.byType(Image), findsOneWidget); + expect(find.byType(SvgPicture), findsOneWidget); }); }