Creating the UI

We start by creating a new Dart file, play_music.dart, and a stateful widget, PlayMusic. In this file, we will create the three buttons, as stated earlier, to perform the basic functions. The following steps describe how to create the UI:

  1. Define a buildGenerateButton() method to create the RaisedButton variable that will be used to generate new music files:
 Widget buildGenerateButton() {   return Padding(     padding: EdgeInsets.only(left: 16, right: 16, top: 16),     child: RaisedButton(       child: Text("Generate Music"),       color: Colors.blue,       textColor: Colors.white,     ),   ); }

In the function defined previously, we create a RaisedButton with Generate Music text added as a child. The Colors.blue value of the color property is used to give ...

Get Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter 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.