Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit d2f5c33

Browse files
Remove pubspec.yaml examples from READMEs (#4198)
1 parent 9e23302 commit d2f5c33

52 files changed

Lines changed: 164 additions & 576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/e2e/README.md

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,3 @@
11
# e2e (deprecated)
22

3-
## DEPRECATED
4-
53
This package has been moved to [integration_test](https://github.com/flutter/plugins/tree/master/packages/integration_test).
6-
7-
## Old instructions
8-
9-
This package enables self-driving testing of Flutter code on devices and emulators.
10-
It adapts flutter_test results into a format that is compatible with `flutter drive`
11-
and native Android instrumentation testing.
12-
13-
## Usage
14-
15-
Add a dependency on the `e2e` package in the
16-
`dev_dependencies` section of pubspec.yaml. For plugins, do this in the
17-
pubspec.yaml of the example app.
18-
19-
Invoke `E2EWidgetsFlutterBinding.ensureInitialized()` at the start
20-
of a test file, e.g.
21-
22-
```dart
23-
import 'package:e2e/e2e.dart';
24-
25-
void main() {
26-
E2EWidgetsFlutterBinding.ensureInitialized();
27-
testWidgets("failing test example", (WidgetTester tester) async {
28-
expect(2 + 2, equals(5));
29-
});
30-
}
31-
```
32-
33-
## Test locations
34-
35-
It is recommended to put e2e tests in the `test/` folder of the app or package.
36-
For example apps, if the e2e test references example app code, it should go in
37-
`example/test/`. It is also acceptable to put e2e tests in `test_driver/` folder
38-
so that they're alongside the runner app (see below).
39-
40-
## Using Flutter driver to run tests
41-
42-
`E2EWidgetsTestBinding` supports launching the on-device tests with `flutter drive`.
43-
Note that the tests don't use the `FlutterDriver` API, they use `testWidgets` instead.
44-
45-
Put the a file named `<package_name>_e2e_test.dart` in the app' `test_driver` directory:
46-
47-
```dart
48-
import 'dart:async';
49-
50-
import 'package:e2e/e2e_driver.dart' as e2e;
51-
52-
Future<void> main() async => e2e.main();
53-
54-
```
55-
56-
To run a example app test with Flutter driver:
57-
58-
```
59-
cd example
60-
flutter drive test/<package_name>_e2e.dart
61-
```
62-
63-
To test plugin APIs using Flutter driver:
64-
65-
```
66-
cd example
67-
flutter drive --driver=test_driver/<package_name>_test.dart test/<package_name>_e2e.dart
68-
```
69-
70-
You can run tests on web in release or profile mode.
71-
72-
First you need to make sure you have downloaded the driver for the browser.
73-
74-
```
75-
cd example
76-
flutter drive -v --target=test_driver/<package_name>dart -d web-server --release --browser-name=chrome
77-
```
78-
79-
## Android device testing
80-
81-
Create an instrumentation test file in your application's
82-
**android/app/src/androidTest/java/com/example/myapp/** directory (replacing
83-
com, example, and myapp with values from your app's package name). You can name
84-
this test file MainActivityTest.java or another name of your choice.
85-
86-
```java
87-
package com.example.myapp;
88-
89-
import androidx.test.rule.ActivityTestRule;
90-
import dev.flutter.plugins.e2e.FlutterTestRunner;
91-
import org.junit.Rule;
92-
import org.junit.runner.RunWith;
93-
94-
@RunWith(FlutterTestRunner.class)
95-
public class MainActivityTest {
96-
@Rule
97-
public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class, true, false);
98-
}
99-
```
100-
101-
Update your application's **myapp/android/app/build.gradle** to make sure it
102-
uses androidx's version of AndroidJUnitRunner and has androidx libraries as a
103-
dependency.
104-
105-
```
106-
android {
107-
...
108-
defaultConfig {
109-
...
110-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
111-
}
112-
}
113-
114-
dependencies {
115-
testImplementation 'junit:junit:4.12'
116-
117-
// https://developer.android.com/jetpack/androidx/releases/test/#1.2.0
118-
androidTestImplementation 'androidx.test:runner:1.2.0'
119-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
120-
}
121-
```
122-
123-
To e2e test on a local Android device (emulated or physical):
124-
125-
```
126-
./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/<package_name>_e2e.dart
127-
```
128-
129-
## Firebase Test Lab
130-
131-
If this is your first time testing with Firebase Test Lab, you'll need to follow
132-
the guides in the [Firebase test lab
133-
documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE)
134-
to set up a project.
135-
136-
To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an
137-
instrumentation test for Android, after creating `androidTest` as suggested in the last section.
138-
139-
```bash
140-
pushd android
141-
# flutter build generates files in android/ for building the app
142-
flutter build apk
143-
./gradlew app:assembleAndroidTest
144-
./gradlew app:assembleDebug -Ptarget=<path_to_test>.dart
145-
popd
146-
```
147-
148-
Upload the build apks Firebase Test Lab, making sure to replace <PATH_TO_KEY_FILE>,
149-
<PROJECT_NAME>, <RESULTS_BUCKET>, and <RESULTS_DIRECTORY> with your values.
150-
151-
```bash
152-
gcloud auth activate-service-account --key-file=<PATH_TO_KEY_FILE>
153-
gcloud --quiet config set project <PROJECT_NAME>
154-
gcloud firebase test android run --type instrumentation \
155-
--app build/app/outputs/apk/debug/app-debug.apk \
156-
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk\
157-
--timeout 2m \
158-
--results-bucket=<RESULTS_BUCKET> \
159-
--results-dir=<RESULTS_DIRECTORY>
160-
```
161-
162-
You can pass additional parameters on the command line, such as the
163-
devices you want to test on. See
164-
[gcloud firebase test android run](https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run).
165-
166-
## iOS device testing
167-
168-
You need to change `iOS/Podfile` to avoid test target statically linking to the plugins. One way is to
169-
link all of the plugins dynamically:
170-
171-
```
172-
target 'Runner' do
173-
use_frameworks!
174-
...
175-
end
176-
```
177-
178-
To e2e test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool.
179-
180-
```
181-
flutter build ios -t test_driver/<package_name>_e2e.dart (--simulator)
182-
```
183-
184-
Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target
185-
(navigating `File > New > Target...` and set up the values) and a test file `RunnerTests.m` and
186-
change the code. You can change `RunnerTests.m` to the name of your choice.
187-
188-
```objective-c
189-
#import <XCTest/XCTest.h>
190-
#import <e2e/E2EIosTest.h>
191-
192-
E2E_IOS_RUNNER(RunnerTests)
193-
```
194-
195-
Now you can start RunnerTests to kick out e2e tests!

packages/file_selector/file_selector_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.8.1+1
2+
3+
- Updated installation instructions in README.
4+
15
# 0.8.1
26

37
- Return a non-null value from `getSavePath` for consistency with
Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
# file_selector_web
1+
# file\_selector\_web
22

33
The web implementation of [`file_selector`][1].
44

55
## Usage
66

7-
### Import the package
8-
To use this plugin in your Flutter Web app, simply add it as a dependency in
9-
your pubspec alongside the base `file_selector` plugin.
10-
11-
_(This is only temporary: in the future we hope to make this package an
12-
"endorsed" implementation of `file_selector`, so that it is automatically
13-
included in your Flutter Web app when you depend on `package:file_selector`.)_
14-
15-
This is what the above means to your `pubspec.yaml`:
16-
17-
```yaml
18-
...
19-
dependencies:
20-
...
21-
file_selector: ^0.7.0
22-
file_selector_web: ^0.7.0
23-
...
24-
```
25-
26-
### Use the plugin
27-
Once you have the `file_selector_web` dependency in your pubspec, you should
28-
be able to use `package:file_selector` as normal.
7+
This package is [endorsed][2], which means you can simply use `file_selector`
8+
normally. This package will be automatically included in your app when you do.
299

3010
[1]: https://pub.dev/packages/file_selector
11+
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin

packages/file_selector/file_selector_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: file_selector_web
22
description: Web platform implementation of file_selector
33
repository: https://github.com/flutter/plugins/tree/master/packages/file_selector/file_selector_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
5-
version: 0.8.1
5+
version: 0.8.1+1
66

77
environment:
88
sdk: ">=2.12.0 <3.0.0"

packages/google_sign_in/google_sign_in_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.10.0+1
2+
3+
* Updated installation instructions in README.
4+
15
## 0.10.0
26

37
* Migrate to null-safety.

packages/google_sign_in/google_sign_in_web/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
# google_sign_in_web
1+
# google\_sign\_in\_web
22

33
The web implementation of [google_sign_in](https://pub.dev/google_sign_in/google_sign_in)
44

55
## Usage
66

77
### Import the package
88

9-
This package is the endorsed implementation of `google_sign_in` for the web platform since version `4.1.0`, so it gets automatically added to your dependencies by depending on `google_sign_in: ^4.1.0`.
10-
11-
No modifications to your pubspec.yaml should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`):
12-
13-
```yaml
14-
...
15-
dependencies:
16-
...
17-
google_sign_in: ^4.1.0
18-
...
19-
...
20-
```
9+
This package is [endorsed](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin),
10+
which means you can simply use `google_sign_in`
11+
normally. This package will be automatically included in your app when you do.
2112

2213
### Web integration
2314

packages/google_sign_in/google_sign_in_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
33
for signing in with a Google account on Android, iOS and Web.
44
repository: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_web
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
6-
version: 0.10.0
6+
version: 0.10.0+1
77

88
environment:
99
sdk: ">=2.12.0 <3.0.0"

packages/image_picker/image_picker_for_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.2
2+
3+
* Updated installation instructions in README.
4+
15
# 2.1.1
26

37
* Implemented `getMultiImage`.

packages/image_picker/image_picker_for_web/README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# image_picker_for_web
1+
# image\_picker\_for\_web
22

33
A web implementation of [`image_picker`][1].
44

@@ -52,19 +52,9 @@ The argument `maxDuration` is not supported on the web.
5252

5353
### Import the package
5454

55-
This package is an unendorsed web platform implementation of `image_picker`.
56-
57-
In order to use this, you'll need to depend in `image_picker: ^0.6.7` (which was the first version of the plugin that allowed federation), and `image_picker_for_web: ^0.1.0`.
58-
59-
```yaml
60-
...
61-
dependencies:
62-
...
63-
image_picker: ^0.6.7
64-
image_picker_for_web: ^0.1.0
65-
...
66-
...
67-
```
55+
This package is [endorsed](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin),
56+
which means you can simply use `image_picker`
57+
normally. This package will be automatically included in your app when you do.
6858

6959
### Use the plugin
7060

packages/image_picker/image_picker_for_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker_for_web
22
description: Web platform implementation of image_picker
33
repository: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_for_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
5-
version: 2.1.1
5+
version: 2.1.2
66

77
environment:
88
sdk: ">=2.12.0 <3.0.0"

0 commit comments

Comments
 (0)