© Fu Cheng 2019
F. ChengFlutter Recipeshttps://doi.org/10.1007/978-1-4842-4982-6_13

13. Miscellaneous

Fu Cheng1 
(1)
Sandringham, Auckland, New Zealand
 

This chapter covers recipes of miscellaneous topics in Flutter.

13.1 Using Assets

Problem

You want to bundle static assets in the app.

Solution

Use assets.

Discussion

Flutter apps can include both code and static assets. There are two types of assets:
  • Data files including JSON, XML, and plain text files

  • Binary files including images and videos

Assets are declared in the flutter/assets section of the pubspec.yaml file. During the build process, these assets files are bundled into the app’s binary files. These assets can be accessed in the runtime. It’s common to put assets under the assets directory. In Listing ...

Get Flutter Recipes: Mobile Development Solutions for iOS and Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.