Flutter, fetching google_fonts at runtime via HTTP even in release mode

287

When you just get that once. this should be work.means your project must not running .you must stop running then pub get.

Share:
287
Bensal
Author by

Bensal

Updated on December 26, 2022

Comments

  • Bensal
    Bensal over 1 year

    If i'm right, google_fonts plugin loads font through http during debug. Later when our app is ready we have to download the font from the fonts.google.com . and store it in pubsec.yaml.

    I am developing a flutter application where all the available fonts should be shown to the users. But if i can't fetch it in the runtime, i will have to download every file, which counts over a thousand. It might become difficult as my app size increases and i will have to manually download them all.

    So my question is, can i fetch it in the runtime , or is there some other way to achieve it? Hope someone can answer me. Thank You

    edit: It ran without problems. The problem was not with google_fonts, my code was not reflecting changes, so i got wrong release apk

    • PRATIK PAWAR
      PRATIK PAWAR over 3 years
      add internet permission in android, google fonts will work fine in release mode
    • Bensal
      Bensal over 3 years
      i added it, but did not work without downloading it and adding it to asset in pubsec.yaml
    • Bensal
      Bensal over 3 years
      It was another error which was not related to google_fonts. The code was not updated so i got wrong release apk