mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Lands beta branch into master for 2.5 (#895)
This commit is contained in:
@@ -28,7 +28,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.8.2"
|
||||
version: "2.8.1"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -36,27 +36,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
built_value:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -85,13 +64,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -113,13 +85,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -134,13 +99,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -152,7 +110,7 @@ packages:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.4"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -172,20 +130,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -193,13 +144,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
mockito:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: mockito
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.15"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -227,7 +171,7 @@ packages:
|
||||
name: pigeon
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.2"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -240,13 +184,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -288,7 +225,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.3"
|
||||
version: "0.4.2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -13,11 +13,10 @@ dependencies:
|
||||
sdk: flutter
|
||||
|
||||
dev_dependencies:
|
||||
pigeon: ^1.0.0
|
||||
mockito: ^5.0.0
|
||||
pigeon: ^1.0.2
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^1.0.0
|
||||
flutter_lints: ^1.0.4
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_module_books/api.dart';
|
||||
import 'package:flutter_module_books/main.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Pressing clear calls the cancel API', (tester) async {
|
||||
@@ -20,7 +19,7 @@ void main() {
|
||||
|
||||
await tester.tap(find.byIcon(Icons.clear));
|
||||
|
||||
verify(mockHostApi.cancel());
|
||||
expect(mockHostApi.cancelCalls, 1);
|
||||
});
|
||||
|
||||
testWidgets('Pressing done calls the finish editing API', (tester) async {
|
||||
@@ -34,8 +33,22 @@ void main() {
|
||||
|
||||
await tester.tap(find.byIcon(Icons.check));
|
||||
|
||||
verify(mockHostApi.finishEditingBook(any));
|
||||
expect(mockHostApi.booksFinished.length, 1);
|
||||
});
|
||||
}
|
||||
|
||||
class MockHostBookApi extends Mock implements HostBookApi {}
|
||||
// A super-simple mock for testing that calls are made to the API.
|
||||
class MockHostBookApi implements HostBookApi {
|
||||
int cancelCalls = 0;
|
||||
final booksFinished = <Book>[];
|
||||
|
||||
@override
|
||||
Future<void> cancel() async {
|
||||
cancelCalls++;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> finishEditingBook(Book arg) async {
|
||||
booksFinished.add(arg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user