Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: generate config file feature documentation #485

Merged
merged 2 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.13.1 (15th April 2023)

- Can now use `flutter_launcher_icons` instead of `flutter_icons` [#478](https://github.com/fluttercommunity/flutter_launcher_icons/pull/478)
- Can use command `flutter pub run flutter_launcher_icons:generate` to automatically generate config file [#475](https://github.com/fluttercommunity/flutter_launcher_icons/pull/475)


## 0.13.0 (7th April 2023)
Expand Down
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,36 @@ A command-line tool which simplifies the task of updating your Flutter app's lau

### 1. Setup the config file

Add your Flutter Launcher Icons configuration to your `pubspec.yaml` or create a new config file called `flutter_launcher_icons.yaml`.
Run the following command to create a new config automatically:

```shell
flutter pub run flutter_launcher_icons:generate
```

This will create a new file called `flutter_launcher_icons.yaml` in your `flutter` project's root directory.

If you want to override the default location or name of the config file, use the `-f` flag:

```shell
flutter pub run flutter_launcher_icons:generate -f <your config file name here>
```

To override an existing config file, use the `-o` flag:

```shell
flutter pub run flutter_launcher_icons:generate -o
```

OR

Add your Flutter Launcher Icons configuration to your `pubspec.yaml`.
An example is shown below. More complex examples [can be found in the example projects](https://github.com/fluttercommunity/flutter_launcher_icons/tree/master/example).

```yaml
dev_dependencies:
flutter_launcher_icons: "^0.13.1"

flutter_icons:
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Expand All @@ -36,25 +58,25 @@ flutter_icons:
image_path: "path/to/image.png"
```

If you name your configuration file something other than `flutter_launcher_icons.yaml` or `pubspec.yaml` you will need to specify
the name of the file when running the package.
### 2. Run the package

After setting up the configuration, all that is left to do is run the package.

```shell
flutter pub get
flutter pub run flutter_launcher_icons -f <your config file name here>
flutter pub run flutter_launcher_icons
```

Note: If you are not using the existing `pubspec.yaml` ensure that your config file is located in the same directory as it.

### 2. Run the package

After setting up the configuration, all that is left to do is run the package.
If you name your configuration file something other than `flutter_launcher_icons.yaml` or `pubspec.yaml` you will need to specify
the name of the file when running the package.

```shell
flutter pub get
flutter pub run flutter_launcher_icons
flutter pub run flutter_launcher_icons -f <your config file name here>
```

Note: If you are not using the existing `pubspec.yaml` ensure that your config file is located in the same directory as it.

If you encounter any issues [please report them here](https://github.com/fluttercommunity/flutter_launcher_icons/issues).

In the above configuration, the package is setup to replace the existing launcher icons in both the Android and iOS project
Expand Down