1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-13 10:59:04 +00:00

Adjust desktop_photo_search's lint rules (#816)

This commit is contained in:
Brett Morgan
2021-06-08 07:48:14 +10:00
committed by GitHub
parent 7acef097f0
commit 9ad1fae51c
5 changed files with 14 additions and 10 deletions

View File

@@ -85,7 +85,8 @@ class FakeUnsplash implements Unsplash {
const fabKey = Key('fab');
class PhotoSearchModelTester extends StatelessWidget {
const PhotoSearchModelTester(this.query);
const PhotoSearchModelTester({required this.query, Key? key})
: super(key: key);
final String query;
@override
Widget build(BuildContext context) {
@@ -110,7 +111,7 @@ void main() {
final unsplashSearches = PhotoSearchModel(FakeUnsplash());
final testWidget = ChangeNotifierProvider<PhotoSearchModel>(
create: (context) => unsplashSearches,
child: const PhotoSearchModelTester('clouds'),
child: const PhotoSearchModelTester(query: 'clouds'),
);
await tester.pumpWidget(testWidget);
expect(unsplashSearches.entries.length, 0);
@@ -120,7 +121,7 @@ void main() {
final unsplashSearches = PhotoSearchModel(FakeUnsplash());
final testWidget = ChangeNotifierProvider<PhotoSearchModel>(
create: (context) => unsplashSearches,
child: const PhotoSearchModelTester('clouds'),
child: const PhotoSearchModelTester(query: 'clouds'),
);
await tester.pumpWidget(testWidget);
await tester.tap(find.byKey(fabKey));