"Fossies" - the Fresh Open Source Software Archive

Member "flutter-1.22.4/dev/snippets/config/templates/stateful_widget_scaffold_center_freeform_state.tmpl" (13 Nov 2020, 900 Bytes) of package /linux/misc/flutter-1.22.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /// Flutter code sample for {{element}}
    2 
    3 {{description}}
    4 
    5 import 'package:flutter/material.dart';
    6 
    7 {{code-imports}}
    8 
    9 void main() => runApp(new MyApp());
   10 
   11 /// This is the main application widget.
   12 class MyApp extends StatelessWidget {
   13   static const String _title = 'Flutter Code Sample';
   14 
   15   @override
   16   Widget build(BuildContext context) {
   17     return MaterialApp(
   18       title: _title,
   19       home: Scaffold(
   20         appBar: AppBar(title: const Text(_title)),
   21         body: Center(
   22           child: MyStatefulWidget(),
   23         ),
   24       ),
   25     );
   26   }
   27 }
   28 
   29 {{code-preamble}}
   30 
   31 /// This is the stateful widget that the main application instantiates.
   32 class MyStatefulWidget extends StatefulWidget {
   33   MyStatefulWidget({Key key}) : super(key: key);
   34 
   35   @override
   36   _MyStatefulWidgetState createState() => _MyStatefulWidgetState();
   37 }
   38 
   39 /// This is the private State class that goes with MyStatefulWidget.
   40 {{code}}