mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Adds documentation for the stateless widget template, and adds an "imports" section to both templates.
33 lines
649 B
Cheetah
33 lines
649 B
Cheetah
{{description}}
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
{{code-imports}}
|
|
|
|
void main() => runApp(new MyApp());
|
|
|
|
class MyApp extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return new MaterialApp(
|
|
title: 'Flutter Code Sample for {{id}}',
|
|
theme: new ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
),
|
|
home: new MyStatelessWidget(),
|
|
);
|
|
}
|
|
}
|
|
|
|
{{code-preamble}}
|
|
|
|
class MyStatelessWidget extends StatelessWidget {
|
|
MyStatelessWidget({Key key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return {{code}};
|
|
}
|
|
}
|