The first step toward creating the game is to build the basic components of the UI. After creating a new app, we'll build a ball, a bat, and a text for the score:
- Let's create a new app, which we can call simple_pong.
- In the main.dart file, in the build() method of the MyApp stateless widget, we'll return a MaterialApp, whose title is "Pong Demo", and, for the theme, we'll use the classic blue as primarySwatch.
- In the home of MaterialApp, we'll place a scaffold whose AppBar will take a text containing "Simple Pong".
- In the body, we'll place an empty container for now, but we will fix that later on.
You can see the steps listed in the following code:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext...