Add Sample code to SlideTransition (#41009)
This commit is contained in:
committed by
GitHub
parent
43932aa2ca
commit
81e693a7fe
@@ -101,6 +101,11 @@ follows:
|
||||
`stateful_widget_scaffold`, except that it wraps the stateful widget with a
|
||||
`Scaffold` _and_ a `Center`.
|
||||
|
||||
- [`stateful_widget_scaffold_center_freeform_state`](stateful_widget_scaffold_center_freeform_state.tmpl) :
|
||||
Similar to `stateful_widget_scaffold_center` except that the code block has
|
||||
to contain the entire state class defined as:
|
||||
`class _MyStatefulWidgetState extends State<MyStatefulWidget>`
|
||||
|
||||
- [`stateless_widget_scaffold`](stateless_widget_scaffold.tmpl) : Similar to
|
||||
`stateless_widget_material`, except that it wraps the stateless widget with a
|
||||
`Scaffold`.
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// Flutter code sample for {{id}}
|
||||
|
||||
{{description}}
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
{{code-imports}}
|
||||
|
||||
void main() => runApp(new MyApp());
|
||||
|
||||
/// This Widget is the main application widget.
|
||||
class MyApp extends StatelessWidget {
|
||||
static const String _title = 'Flutter Code Sample';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: _title,
|
||||
home: Scaffold(
|
||||
appBar: AppBar(title: const Text(_title)),
|
||||
body: Center(
|
||||
child: MyStatefulWidget(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
{{code-preamble}}
|
||||
|
||||
class MyStatefulWidget extends StatefulWidget {
|
||||
MyStatefulWidget({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyStatefulWidgetState createState() => _MyStatefulWidgetState();
|
||||
}
|
||||
|
||||
{{code}}
|
||||
Reference in New Issue
Block a user