fluttercommunity / font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Other
842 stars 241 forks source link

📝 Updated README.md to help first setup #217

Closed b099l3 closed 2 years ago

b099l3 commented 2 years ago

When running the setup for the first time I hit some problems that seem to be common with some other PR/issues I have updated the readme to hopefully helps others in adding a custom version

From following the steps I hit these errors: Example of running flutter pub get following steps in docs, similar issue in #216 :

Error detected in pubspec.yaml:
Expected "fonts" to be a list, but got null (Null).
Please correct the pubspec.yaml file at /Users/b099l3/Developer/font_awesome_flutter/pubspec.yaml

where I needed to comment out lines 24-25 in pubspec.yaml:

...
flutter:
  fonts:
...

then from running ./util/configurator.sh I got this:

####  #   #####################################################################
###  ###  ############ Font Awesome Flutter Configurator ######################
#   #   # #####################################################################

Using font_awesome_flutter version 10.1.0
Downloading https://api.github.com/repos/fluttercommunity/font_awesome_flutter/releases

Custom icons.json found, generating files
Duotone icons are no longer supported. Automatically disabled them.

Generating icon definitions
Formatted lib/font_awesome_flutter.dart
Formatted 1 file (1 changed) in 0.87 seconds.

Generating example code
Formatted example/lib/icons.dart
Formatted 1 file (1 changed) in 0.61 seconds.
Unhandled exception:
RangeError (index): Invalid value: Not in inclusive range 0..43: -1
#0      List.[] (dart:core-patch/growable_array.dart:260:36)
#1      adjustPubspecFontIncludes (file:///Users/b099l3/Developer//font_awesome_flutter/util/lib/main.dart:194:37)
#2      main (file:///Users/b099l3/Developer//font_awesome_flutter/util/lib/main.dart:165:3)
<asynchronous suspension>

Where I realised the generation relies on those lines being there so uncomment, and re-ran to find no errors.

michaelspiss commented 2 years ago

Hi @b099l3! Seems like I was a bit too eager while removing the duotone generator code and accidentally removed the style collector as well. No idea how I didn't spot the empty pubspec during the commit check. I provided a fix and everything should work as expected again. I highly appreciate your effort to provide a simple workaround for others while this issue persisted!

b099l3 commented 2 years ago

No worries thanks for the quick update and fix!