After making all the segments work properly, let's create the final material app. Inside the main.dart file, we create a StatelessWidget and override the build() method, as follows:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: GenerateLiveCaption()
);
}
}
Finally, we execute the code as follows:
void main() => runApp(MyApp());
You should be able to have an app screen as shown in the following screenshot:Â
Notice the captions displayed in the image, as follows:
- a laptop computer sitting on top of a desk.
- an open laptop computer sitting on top of a desk.
- an open laptop computer sitting on top of a wooden desk.
These captions are fairly accurate in their...