As you have seen, Flare is a great tool to build animations, but it would be completely useless for our purposes if we couldn't use them in a Flutter app. These are a few easy steps to help us do so:
- Adding the flare_flutter package
- Exporting the Flare animation as a file
- Including the exported file into the app assets
- Declaring the assets into the pubspec.yaml file
Once the setup is complete, we'll also need to integrate Flare in our Dart code so that we can interact with our users and show them the relevant animation. Let's begin, as follows:
- Create a new Flutter project, calling it 'Dice', and update the main.dart file so that it contains the following code:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends ...