stateless_widget_cupertino_page_scaffold.tmpl 854 Bytes
Newer Older
1 2
// Flutter code sample for {{element}}
//
3 4
{{description}}

5
{{code-dartImports}}
6

7
import 'package:flutter/cupertino.dart';
8 9
{{code-imports}}

10
void main() => runApp(const MyApp());
11 12 13

/// This is the main application widget.
class MyApp extends StatelessWidget {
14 15
  const MyApp({Key? key}) : super(key: key);

16 17 18 19
  static const String _title = 'Flutter Code Sample';

  @override
  Widget build(BuildContext context) {
20
    return const CupertinoApp(
21 22 23 24 25 26 27 28 29 30 31 32 33 34
      title: _title,
      home: CupertinoPageScaffold(
        navigationBar: CupertinoNavigationBar(middle: const Text(_title)),
        body: MyStatelessWidget(),
      ),
    );
  }
}


{{code-preamble}}

/// This is the stateless widget that the main application instantiates.
class MyStatelessWidget extends StatelessWidget {
35
  const MyStatelessWidget({Key? key}) : super(key: key);
36 37

  @override
38
{{code}}
39
}