mirror of
https://github.com/flutter/samples.git
synced 2026-03-21 20:08:16 +00:00
Replace pub run usages with dart run (#2777)
Following up on https://github.com/dart-lang/pub/issues/4737, this PR replaces deprecated `pub run` commands with `dart run`.
This commit is contained in:
@@ -38,7 +38,7 @@ page.
|
|||||||
* If the `schema.dart` is modified, the generated classes can be updated with
|
* If the `schema.dart` is modified, the generated classes can be updated with
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flutter pub run pigeon --input pigeon/schema.dart \
|
dart run pigeon --input pigeon/schema.dart \
|
||||||
--dart_out lib/api.dart \
|
--dart_out lib/api.dart \
|
||||||
--objc_header_out ../ios_books/IosBooks/api.h \
|
--objc_header_out ../ios_books/IosBooks/api.h \
|
||||||
--objc_source_out ../ios_books/IosBooks/api.m \
|
--objc_source_out ../ios_books/IosBooks/api.m \
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ in `pigeon/schema.dart` is updated, the generated classes can also be re-
|
|||||||
generated using:
|
generated using:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
flutter pub run pigeon --input pigeon/schema.dart \
|
dart run pigeon --input pigeon/schema.dart \
|
||||||
--dart_out lib/api.dart \
|
--dart_out lib/api.dart \
|
||||||
--objc_header_out ../ios_books/IosBooks/api.h \
|
--objc_header_out ../ios_books/IosBooks/api.h \
|
||||||
--objc_source_out ../ios_books/IosBooks/api.m \
|
--objc_source_out ../ios_books/IosBooks/api.m \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
flutter pub run pigeon --input pigeon/schema.dart \
|
dart run pigeon --input pigeon/schema.dart \
|
||||||
--dart_out lib/api.dart \
|
--dart_out lib/api.dart \
|
||||||
--objc_header_out ../ios_books/IosBooks/api.h \
|
--objc_header_out ../ios_books/IosBooks/api.h \
|
||||||
--objc_source_out ../ios_books/IosBooks/api.m \
|
--objc_source_out ../ios_books/IosBooks/api.m \
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Future<void> generateJsonBindings() async => _logProcessOutput(
|
|||||||
|
|
||||||
@Task()
|
@Task()
|
||||||
Future<void> watch() async => _logProcessOutput(
|
Future<void> watch() async => _logProcessOutput(
|
||||||
Process.start('flutter', ['pub', 'run', 'build_runner', 'watch']),
|
Process.start('dart', ['run', 'build_runner', 'watch']),
|
||||||
);
|
);
|
||||||
|
|
||||||
@Task()
|
@Task()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Future<void> generateJsonBindings() async => _logProcessOutput(
|
|||||||
|
|
||||||
@Task()
|
@Task()
|
||||||
Future<void> watch() async => _logProcessOutput(
|
Future<void> watch() async => _logProcessOutput(
|
||||||
Process.start('flutter', ['pub', 'run', 'build_runner', 'watch']),
|
Process.start('dart', ['run', 'build_runner', 'watch']),
|
||||||
);
|
);
|
||||||
|
|
||||||
@Task()
|
@Task()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ lib
|
|||||||
|
|
||||||
The state management approach is intentionally low-level. That way, it's easy to
|
The state management approach is intentionally low-level. That way, it's easy to
|
||||||
take this project and run with it, without having to learn new paradigms, or having
|
take this project and run with it, without having to learn new paradigms, or having
|
||||||
to remember to run `flutter pub run build_runner watch`. You are,
|
to remember to run `dart run build_runner watch`. You are,
|
||||||
of course, encouraged to use whatever paradigm, helper package or code generation
|
of course, encouraged to use whatever paradigm, helper package or code generation
|
||||||
scheme that you prefer.
|
scheme that you prefer.
|
||||||
|
|
||||||
@@ -522,7 +522,7 @@ To update the launcher icon, first change the files
|
|||||||
Then, run the following:
|
Then, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flutter pub run flutter_launcher_icons:main
|
dart run flutter_launcher_icons:main
|
||||||
```
|
```
|
||||||
|
|
||||||
You can [configure](https://github.com/fluttercommunity/flutter_launcher_icons#book-guide)
|
You can [configure](https://github.com/fluttercommunity/flutter_launcher_icons#book-guide)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Run with `flutter pub run ffigen --config ffigen.yaml`.
|
# Run with `dart run ffigen --config ffigen.yaml`.
|
||||||
name: PedometerBindings
|
name: PedometerBindings
|
||||||
description: "Bindings for CM pedometers"
|
description: "Bindings for CM pedometers"
|
||||||
language: objc
|
language: objc
|
||||||
|
|||||||
Reference in New Issue
Block a user