• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flutter code sample for {{id}}
2
3{{description}}
4
5import 'package:flutter/widgets.dart';
6
7{{code-imports}}
8
9void main() => runApp(new MyApp());
10
11/// This Widget is the main application widget.
12class MyApp extends StatelessWidget {
13  @override
14  Widget build(BuildContext context) {
15    return WidgetsApp(
16      title: 'Flutter Code Sample',
17      home: MyStatefulWidget(),
18      color: const Color(0xffffffff),
19    );
20  }
21}
22
23{{code-preamble}}
24
25/// This is the stateful widget that the main application instantiates.
26class MyStatefulWidget extends StatefulWidget {
27  MyStatefulWidget({Key key}) : super(key: key);
28
29  @override
30  _MyStatefulWidgetState createState() => _MyStatefulWidgetState();
31}
32
33// This is the private State class that goes with MyStatefulWidget.
34class _MyStatefulWidgetState extends State<MyStatefulWidget> {
35  {{code}}
36}
37