The first screen that we will create in the app is a screen that will allow the user to "throw" a single dice: no rules, no play. We'll just give the user a random value between 1 and 6. This will give us the opportunity to see a Flare animation in action in a Flutter screen. To do this, perform the following steps:
- Create a new file in the lib folder of the project, called single.dart.
- At the top of the file, import three files—the usual material.dart, our dice.dart file, and the library that will allow us to use Flare, which is flare_actor.dart, as follows:
import 'dice.dart';import 'package:flutter/material.dart';import 'package:flare_flutter/flare_actor.dart';
- Create a stateful widget, using the stful ...