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

This converts existing ## Sample code samples to {@tool sample}...{@end-tool} form. Also: 1. Fixed a minor bug in analyze-sample-code.dart 2. Made the snippet tool only insert descriptions if the description is non-empty. 3. Moved the Card diagram to before the code sample.
31 lines
631 B
Cheetah
31 lines
631 B
Cheetah
{{description}}
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
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}};
|
|
}
|
|
}
|