Diagrams for API docs rank 10-20 in most views (#37624)
This commit is contained in:
parent
f167067d94
commit
5019321243
@ -77,6 +77,71 @@ enum ThemeMode {
|
|||||||
/// If [home], [routes], [onGenerateRoute], and [onUnknownRoute] are all null,
|
/// If [home], [routes], [onGenerateRoute], and [onUnknownRoute] are all null,
|
||||||
/// and [builder] is not null, then no [Navigator] is created.
|
/// and [builder] is not null, then no [Navigator] is created.
|
||||||
///
|
///
|
||||||
|
/// {@tool sample}
|
||||||
|
/// This example shows how to create a [MaterialApp] that disables the "debug"
|
||||||
|
/// banner with a [home] route that will be displayed when the app is launched.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// MaterialApp(
|
||||||
|
/// home: Scaffold(
|
||||||
|
/// appBar: AppBar(
|
||||||
|
/// title: const Text('Home'),
|
||||||
|
/// ),
|
||||||
|
/// ),
|
||||||
|
/// debugShowCheckedModeBanner: false,
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
|
/// {@tool sample}
|
||||||
|
/// This example shows how to create a [MaterialApp] that uses the [routes]
|
||||||
|
/// `Map` to define the "home" route and an "about" route.
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// MaterialApp(
|
||||||
|
/// routes: <String, WidgetBuilder>{
|
||||||
|
/// '/': (BuildContext context) {
|
||||||
|
/// return Scaffold(
|
||||||
|
/// appBar: AppBar(
|
||||||
|
/// title: const Text('Home Route'),
|
||||||
|
/// ),
|
||||||
|
/// );
|
||||||
|
/// },
|
||||||
|
/// '/about': (BuildContext context) {
|
||||||
|
/// return Scaffold(
|
||||||
|
/// appBar: AppBar(
|
||||||
|
/// title: const Text('About Route'),
|
||||||
|
/// ),
|
||||||
|
/// );
|
||||||
|
/// }
|
||||||
|
/// },
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
|
/// {@tool sample}
|
||||||
|
/// This example shows how to create a [MaterialApp] that defines a [theme] that
|
||||||
|
/// will be used for material widgets in the app.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// MaterialApp(
|
||||||
|
/// theme: ThemeData(
|
||||||
|
/// brightness: Brightness.dark,
|
||||||
|
/// primaryColor: Colors.blueGrey
|
||||||
|
/// ),
|
||||||
|
/// home: Scaffold(
|
||||||
|
/// appBar: AppBar(
|
||||||
|
/// title: const Text('MaterialApp Theme'),
|
||||||
|
/// ),
|
||||||
|
/// ),
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
/// * [Scaffold], which provides standard app elements like an [AppBar] and a [Drawer].
|
/// * [Scaffold], which provides standard app elements like an [AppBar] and a [Drawer].
|
||||||
|
@ -532,8 +532,10 @@ class DropdownButtonHideUnderline extends InheritedWidget {
|
|||||||
///
|
///
|
||||||
/// {@tool snippet --template=stateful_widget_scaffold}
|
/// {@tool snippet --template=stateful_widget_scaffold}
|
||||||
///
|
///
|
||||||
/// This sample shows a `DropdownButton` whose value is one of
|
/// This sample shows a `DropdownButton` with a customized icon, text style,
|
||||||
/// "One", "Two", "Free", or "Four".
|
/// and underline and whose value is one of "One", "Two", "Free", or "Four".
|
||||||
|
///
|
||||||
|
/// 
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// String dropdownValue = 'One';
|
/// String dropdownValue = 'One';
|
||||||
@ -544,6 +546,16 @@ class DropdownButtonHideUnderline extends InheritedWidget {
|
|||||||
/// body: Center(
|
/// body: Center(
|
||||||
/// child: DropdownButton<String>(
|
/// child: DropdownButton<String>(
|
||||||
/// value: dropdownValue,
|
/// value: dropdownValue,
|
||||||
|
/// icon: Icon(Icons.arrow_downward),
|
||||||
|
/// iconSize: 24,
|
||||||
|
/// elevation: 16,
|
||||||
|
/// style: TextStyle(
|
||||||
|
/// color: Colors.deepPurple
|
||||||
|
/// ),
|
||||||
|
/// underline: Container(
|
||||||
|
/// height: 2,
|
||||||
|
/// color: Colors.deepPurpleAccent,
|
||||||
|
/// ),
|
||||||
/// onChanged: (String newValue) {
|
/// onChanged: (String newValue) {
|
||||||
/// setState(() {
|
/// setState(() {
|
||||||
/// dropdownValue = newValue;
|
/// dropdownValue = newValue;
|
||||||
|
@ -44,6 +44,8 @@ import 'theme_data.dart';
|
|||||||
///
|
///
|
||||||
/// This example shows a simple [FlatButton].
|
/// This example shows a simple [FlatButton].
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// FlatButton(
|
/// FlatButton(
|
||||||
/// onPressed: () {
|
/// onPressed: () {
|
||||||
@ -63,6 +65,8 @@ import 'theme_data.dart';
|
|||||||
/// It turns black-on-grey when disabled.
|
/// It turns black-on-grey when disabled.
|
||||||
/// The button has 8px of padding on each side, and the text is 20px high.
|
/// The button has 8px of padding on each side, and the text is 20px high.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// FlatButton(
|
/// FlatButton(
|
||||||
/// color: Colors.blue,
|
/// color: Colors.blue,
|
||||||
|
@ -61,21 +61,23 @@ class _DefaultHeroTag {
|
|||||||
/// This example shows how to make a simple [FloatingActionButton] in a
|
/// This example shows how to make a simple [FloatingActionButton] in a
|
||||||
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon].
|
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon].
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Scaffold(
|
/// return Scaffold(
|
||||||
/// appBar: AppBar(
|
/// appBar: AppBar(
|
||||||
/// title: Text('Floating Action Button Sample'),
|
/// title: const Text('Floating Action Button'),
|
||||||
/// ),
|
/// ),
|
||||||
/// body: Center(
|
/// body: Center(
|
||||||
/// child: Text('Press the button below!')
|
/// child: const Text('Press the button below!')
|
||||||
/// ),
|
/// ),
|
||||||
/// floatingActionButton: FloatingActionButton(
|
/// floatingActionButton: FloatingActionButton(
|
||||||
/// onPressed: () {
|
/// onPressed: () {
|
||||||
/// // Add your onPressed code here!
|
/// // Add your onPressed code here!
|
||||||
/// },
|
/// },
|
||||||
/// child: Icon(Icons.thumb_up),
|
/// child: Icon(Icons.navigation),
|
||||||
/// backgroundColor: Colors.pink,
|
/// backgroundColor: Colors.green,
|
||||||
/// ),
|
/// ),
|
||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
@ -84,17 +86,19 @@ class _DefaultHeroTag {
|
|||||||
///
|
///
|
||||||
/// {@tool snippet --template=stateless_widget_material}
|
/// {@tool snippet --template=stateless_widget_material}
|
||||||
/// This example shows how to make an extended [FloatingActionButton] in a
|
/// This example shows how to make an extended [FloatingActionButton] in a
|
||||||
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon] and a
|
/// [Scaffold], with a pink [backgroundColor], a thumbs up [Icon] and a
|
||||||
/// [Text] label.
|
/// [Text] label.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Scaffold(
|
/// return Scaffold(
|
||||||
/// appBar: AppBar(
|
/// appBar: AppBar(
|
||||||
/// title: Text('Floating Action Button Sample'),
|
/// title: const Text('Floating Action Button Label'),
|
||||||
/// ),
|
/// ),
|
||||||
/// body: Center(
|
/// body: Center(
|
||||||
/// child: Text('Press the extended button below!'),
|
/// child: const Text('Press the button with a label below!'),
|
||||||
/// ),
|
/// ),
|
||||||
/// floatingActionButton: FloatingActionButton.extended(
|
/// floatingActionButton: FloatingActionButton.extended(
|
||||||
/// onPressed: () {
|
/// onPressed: () {
|
||||||
|
@ -21,6 +21,38 @@ import 'package:flutter/widgets.dart';
|
|||||||
/// uses-material-design: true
|
/// uses-material-design: true
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
/// {@tool sample}
|
||||||
|
/// This example shows how to create a [Row] of [Icon]s in different colors and
|
||||||
|
/// sizes. The first [Icon] uses a [semanticLabel] to announce in accessibility
|
||||||
|
/// modes like TalkBack and VoiceOver.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// Row(
|
||||||
|
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
/// children: const <Widget>[
|
||||||
|
/// Icon(
|
||||||
|
/// Icons.favorite,
|
||||||
|
/// color: Colors.pink,
|
||||||
|
/// size: 24.0,
|
||||||
|
/// semanticLabel: 'Text to announce in accessibility modes',
|
||||||
|
/// ),
|
||||||
|
/// Icon(
|
||||||
|
/// Icons.audiotrack,
|
||||||
|
/// color: Colors.green,
|
||||||
|
/// size: 30.0,
|
||||||
|
/// ),
|
||||||
|
/// Icon(
|
||||||
|
/// Icons.beach_access,
|
||||||
|
/// color: Colors.blue,
|
||||||
|
/// size: 36.0,
|
||||||
|
/// ),
|
||||||
|
/// ],
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
/// * [Icon]
|
/// * [Icon]
|
||||||
|
@ -30,6 +30,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// override. The style is mixed with the ambient [DefaultTextStyle] by the
|
/// override. The style is mixed with the ambient [DefaultTextStyle] by the
|
||||||
/// [Text] widget.
|
/// [Text] widget.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Text(
|
/// Text(
|
||||||
/// 'No, we need bold strokes. We need this plan.',
|
/// 'No, we need bold strokes. We need this plan.',
|
||||||
@ -44,6 +46,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// As in the previous example, the [Text] widget is given a specific style
|
/// As in the previous example, the [Text] widget is given a specific style
|
||||||
/// override which is implicitly mixed with the ambient [DefaultTextStyle].
|
/// override which is implicitly mixed with the ambient [DefaultTextStyle].
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Text(
|
/// Text(
|
||||||
/// 'Welcome to the present, we\'re running a real nation.',
|
/// 'Welcome to the present, we\'re running a real nation.',
|
||||||
@ -68,6 +72,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// The [backgroundColor] is treated as a shorthand for
|
/// The [backgroundColor] is treated as a shorthand for
|
||||||
/// `background: Paint()..color = backgroundColor`.
|
/// `background: Paint()..color = backgroundColor`.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// RichText(
|
/// RichText(
|
||||||
/// text: TextSpan(
|
/// text: TextSpan(
|
||||||
@ -96,6 +102,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// In this example, the ambient [DefaultTextStyle] is explicitly manipulated to
|
/// In this example, the ambient [DefaultTextStyle] is explicitly manipulated to
|
||||||
/// obtain a [TextStyle] that doubles the default font size.
|
/// obtain a [TextStyle] that doubles the default font size.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Text(
|
/// Text(
|
||||||
/// 'These are wise words, enterprising men quote \'em.',
|
/// 'These are wise words, enterprising men quote \'em.',
|
||||||
@ -124,8 +132,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Text(
|
/// Text(
|
||||||
/// 'Don\'t act surprised, you guys, cuz I wrote \'em!',
|
/// 'Ladies and gentlemen, you coulda been anywhere in the world tonight, but you’re here with us in New York City.',
|
||||||
/// style: TextStyle(fontSize: 10, height: 5.0),
|
/// style: TextStyle(height: 5, fontSize: 10),
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
/// {@end-tool}
|
/// {@end-tool}
|
||||||
@ -145,6 +153,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// ambient [DefaultTextStyle], since no explicit style is given and [RichText]
|
/// ambient [DefaultTextStyle], since no explicit style is given and [RichText]
|
||||||
/// does not automatically use the ambient [DefaultTextStyle].)
|
/// does not automatically use the ambient [DefaultTextStyle].)
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// RichText(
|
/// RichText(
|
||||||
/// text: TextSpan(
|
/// text: TextSpan(
|
||||||
@ -266,6 +276,8 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// argument as shown in the example below:
|
/// argument as shown in the example below:
|
||||||
///
|
///
|
||||||
/// {@tool sample}
|
/// {@tool sample}
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// const TextStyle(fontFamily: 'Raleway')
|
/// const TextStyle(fontFamily: 'Raleway')
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -4376,6 +4376,8 @@ class Flexible extends ParentDataWidget<Flex> {
|
|||||||
/// This example shows how to use an [Expanded] widget in a [Column] so that
|
/// This example shows how to use an [Expanded] widget in a [Column] so that
|
||||||
/// it's middle child, a [Container] here, expands to fill the space.
|
/// it's middle child, a [Container] here, expands to fill the space.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Scaffold(
|
/// return Scaffold(
|
||||||
@ -4386,18 +4388,18 @@ class Flexible extends ParentDataWidget<Flex> {
|
|||||||
/// child: Column(
|
/// child: Column(
|
||||||
/// children: <Widget>[
|
/// children: <Widget>[
|
||||||
/// Container(
|
/// Container(
|
||||||
/// color: Colors.red,
|
/// color: Colors.blue,
|
||||||
/// height: 100,
|
/// height: 100,
|
||||||
/// width: 100,
|
/// width: 100,
|
||||||
/// ),
|
/// ),
|
||||||
/// Expanded(
|
/// Expanded(
|
||||||
/// child: Container(
|
/// child: Container(
|
||||||
/// color: Colors.blue,
|
/// color: Colors.amber,
|
||||||
/// width: 100,
|
/// width: 100,
|
||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
/// Container(
|
/// Container(
|
||||||
/// color: Colors.red,
|
/// color: Colors.blue,
|
||||||
/// height: 100,
|
/// height: 100,
|
||||||
/// width: 100,
|
/// width: 100,
|
||||||
/// ),
|
/// ),
|
||||||
@ -4413,6 +4415,8 @@ class Flexible extends ParentDataWidget<Flex> {
|
|||||||
/// This example shows how to use an [Expanded] widget in a [Row] with multiple
|
/// This example shows how to use an [Expanded] widget in a [Row] with multiple
|
||||||
/// children expanded, utilizing the [flex] factor to prioritize available space.
|
/// children expanded, utilizing the [flex] factor to prioritize available space.
|
||||||
///
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Scaffold(
|
/// return Scaffold(
|
||||||
@ -4425,7 +4429,7 @@ class Flexible extends ParentDataWidget<Flex> {
|
|||||||
/// Expanded(
|
/// Expanded(
|
||||||
/// flex: 2,
|
/// flex: 2,
|
||||||
/// child: Container(
|
/// child: Container(
|
||||||
/// color: Colors.red,
|
/// color: Colors.amber,
|
||||||
/// height: 100,
|
/// height: 100,
|
||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
@ -4437,7 +4441,7 @@ class Flexible extends ParentDataWidget<Flex> {
|
|||||||
/// Expanded(
|
/// Expanded(
|
||||||
/// flex: 1,
|
/// flex: 1,
|
||||||
/// child: Container(
|
/// child: Container(
|
||||||
/// color: Colors.red,
|
/// color: Colors.amber,
|
||||||
/// height: 100,
|
/// height: 100,
|
||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
|
@ -26,16 +26,33 @@ import 'icon_theme_data.dart';
|
|||||||
///
|
///
|
||||||
/// {@tool sample}
|
/// {@tool sample}
|
||||||
///
|
///
|
||||||
/// This example shows how to use [Icon] to create an addition icon, in the
|
/// This example shows how to create a [Row] of [Icon]s in different colors and
|
||||||
/// color pink, and 30 x 30 pixels in size.
|
/// sizes. The first [Icon] uses a [semanticLabel] to announce in accessibility
|
||||||
|
/// modes like TalkBack and VoiceOver.
|
||||||
///
|
///
|
||||||
/// 
|
/// 
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
|
/// Row(
|
||||||
|
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
/// children: const <Widget>[
|
||||||
/// Icon(
|
/// Icon(
|
||||||
/// Icons.add,
|
/// Icons.favorite,
|
||||||
/// color: Colors.pink,
|
/// color: Colors.pink,
|
||||||
|
/// size: 24.0,
|
||||||
|
/// semanticLabel: 'Text to announce in accessibility modes',
|
||||||
|
/// ),
|
||||||
|
/// Icon(
|
||||||
|
/// Icons.audiotrack,
|
||||||
|
/// color: Colors.green,
|
||||||
/// size: 30.0,
|
/// size: 30.0,
|
||||||
|
/// ),
|
||||||
|
/// Icon(
|
||||||
|
/// Icons.beach_access,
|
||||||
|
/// color: Colors.blue,
|
||||||
|
/// size: 36.0,
|
||||||
|
/// ),
|
||||||
|
/// ],
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
/// {@end-tool}
|
/// {@end-tool}
|
||||||
|
@ -339,6 +339,8 @@ abstract class ScrollView extends StatelessWidget {
|
|||||||
/// To control the initial scroll offset of the scroll view, provide a
|
/// To control the initial scroll offset of the scroll view, provide a
|
||||||
/// [controller] with its [ScrollController.initialScrollOffset] property set.
|
/// [controller] with its [ScrollController.initialScrollOffset] property set.
|
||||||
///
|
///
|
||||||
|
/// {@animation 400 376 https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_scroll_view.mp4}
|
||||||
|
///
|
||||||
/// {@tool sample}
|
/// {@tool sample}
|
||||||
///
|
///
|
||||||
/// This sample code shows a scroll view that contains a flexible pinned app
|
/// This sample code shows a scroll view that contains a flexible pinned app
|
||||||
@ -366,7 +368,7 @@ abstract class ScrollView extends StatelessWidget {
|
|||||||
/// return Container(
|
/// return Container(
|
||||||
/// alignment: Alignment.center,
|
/// alignment: Alignment.center,
|
||||||
/// color: Colors.teal[100 * (index % 9)],
|
/// color: Colors.teal[100 * (index % 9)],
|
||||||
/// child: Text('grid item $index'),
|
/// child: Text('Grid Item $index'),
|
||||||
/// );
|
/// );
|
||||||
/// },
|
/// },
|
||||||
/// childCount: 20,
|
/// childCount: 20,
|
||||||
@ -379,7 +381,7 @@ abstract class ScrollView extends StatelessWidget {
|
|||||||
/// return Container(
|
/// return Container(
|
||||||
/// alignment: Alignment.center,
|
/// alignment: Alignment.center,
|
||||||
/// color: Colors.lightBlue[100 * (index % 9)],
|
/// color: Colors.lightBlue[100 * (index % 9)],
|
||||||
/// child: Text('list item $index'),
|
/// child: Text('List Item $index'),
|
||||||
/// );
|
/// );
|
||||||
/// },
|
/// },
|
||||||
/// ),
|
/// ),
|
||||||
@ -612,7 +614,7 @@ abstract class BoxScrollView extends ScrollView {
|
|||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// ListView(
|
/// ListView(
|
||||||
/// padding: const EdgeInsets.all(8.0),
|
/// padding: const EdgeInsets.all(8),
|
||||||
/// children: <Widget>[
|
/// children: <Widget>[
|
||||||
/// Container(
|
/// Container(
|
||||||
/// height: 50,
|
/// height: 50,
|
||||||
@ -646,7 +648,7 @@ abstract class BoxScrollView extends ScrollView {
|
|||||||
/// final List<int> colorCodes = <int>[600, 500, 100];
|
/// final List<int> colorCodes = <int>[600, 500, 100];
|
||||||
///
|
///
|
||||||
/// ListView.builder(
|
/// ListView.builder(
|
||||||
/// padding: const EdgeInsets.all(8.0),
|
/// padding: const EdgeInsets.all(8),
|
||||||
/// itemCount: entries.length,
|
/// itemCount: entries.length,
|
||||||
/// itemBuilder: (BuildContext context, int index) {
|
/// itemBuilder: (BuildContext context, int index) {
|
||||||
/// return Container(
|
/// return Container(
|
||||||
@ -672,7 +674,7 @@ abstract class BoxScrollView extends ScrollView {
|
|||||||
/// final List<int> colorCodes = <int>[600, 500, 100];
|
/// final List<int> colorCodes = <int>[600, 500, 100];
|
||||||
///
|
///
|
||||||
/// ListView.separated(
|
/// ListView.separated(
|
||||||
/// padding: const EdgeInsets.all(8.0),
|
/// padding: const EdgeInsets.all(8),
|
||||||
/// itemCount: entries.length,
|
/// itemCount: entries.length,
|
||||||
/// itemBuilder: (BuildContext context, int index) {
|
/// itemBuilder: (BuildContext context, int index) {
|
||||||
/// return Container(
|
/// return Container(
|
||||||
@ -1284,45 +1286,102 @@ class ListView extends BoxScrollView {
|
|||||||
/// list.
|
/// list.
|
||||||
///
|
///
|
||||||
/// {@tool sample}
|
/// {@tool sample}
|
||||||
|
/// This example demonstrates how to create a [GridView] with two columns. The
|
||||||
|
/// children are spaced apart using the [crossAxisSpacing] and [mainAxisSpacing]
|
||||||
|
/// properties.
|
||||||
///
|
///
|
||||||
/// Here are two brief snippets showing a [GridView] and its equivalent using
|
/// 
|
||||||
/// [CustomScrollView]:
|
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// GridView.count(
|
/// GridView.count(
|
||||||
/// primary: false,
|
/// primary: false,
|
||||||
/// padding: const EdgeInsets.all(20.0),
|
/// padding: const EdgeInsets.all(20),
|
||||||
/// crossAxisSpacing: 10.0,
|
/// crossAxisSpacing: 10,
|
||||||
|
/// mainAxisSpacing: 10,
|
||||||
/// crossAxisCount: 2,
|
/// crossAxisCount: 2,
|
||||||
/// children: <Widget>[
|
/// children: <Widget>[
|
||||||
/// const Text('He\'d have you all unravel at the'),
|
/// Container(
|
||||||
/// const Text('Heed not the rabble'),
|
/// padding: const EdgeInsets.all(8),
|
||||||
/// const Text('Sound of screams but the'),
|
/// child: const Text('He\'d have you all unravel at the'),
|
||||||
/// const Text('Who scream'),
|
/// color: Colors.teal[100],
|
||||||
/// const Text('Revolution is coming...'),
|
/// ),
|
||||||
/// const Text('Revolution, they...'),
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Heed not the rabble'),
|
||||||
|
/// color: Colors.teal[200],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Sound of screams but the'),
|
||||||
|
/// color: Colors.teal[300],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Who scream'),
|
||||||
|
/// color: Colors.teal[400],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Revolution is coming...'),
|
||||||
|
/// color: Colors.teal[500],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Revolution, they...'),
|
||||||
|
/// color: Colors.teal[600],
|
||||||
|
/// ),
|
||||||
/// ],
|
/// ],
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
/// {@end-tool}
|
/// {@end-tool}
|
||||||
|
///
|
||||||
/// {@tool sample}
|
/// {@tool sample}
|
||||||
|
/// This example shows how to create the same grid as the previous example
|
||||||
|
/// using a [CustomScrollView] and a [SliverGrid].
|
||||||
|
///
|
||||||
|
/// 
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// CustomScrollView(
|
/// CustomScrollView(
|
||||||
/// primary: false,
|
/// primary: false,
|
||||||
/// slivers: <Widget>[
|
/// slivers: <Widget>[
|
||||||
/// SliverPadding(
|
/// SliverPadding(
|
||||||
/// padding: const EdgeInsets.all(20.0),
|
/// padding: const EdgeInsets.all(20),
|
||||||
/// sliver: SliverGrid.count(
|
/// sliver: SliverGrid.count(
|
||||||
/// crossAxisSpacing: 10.0,
|
/// crossAxisSpacing: 10,
|
||||||
|
/// mainAxisSpacing: 10,
|
||||||
/// crossAxisCount: 2,
|
/// crossAxisCount: 2,
|
||||||
/// children: <Widget>[
|
/// children: <Widget>[
|
||||||
/// const Text('He\'d have you all unravel at the'),
|
/// Container(
|
||||||
/// const Text('Heed not the rabble'),
|
/// padding: const EdgeInsets.all(8),
|
||||||
/// const Text('Sound of screams but the'),
|
/// child: const Text('He\'d have you all unravel at the'),
|
||||||
/// const Text('Who scream'),
|
/// color: Colors.green[100],
|
||||||
/// const Text('Revolution is coming...'),
|
/// ),
|
||||||
/// const Text('Revolution, they...'),
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Heed not the rabble'),
|
||||||
|
/// color: Colors.green[200],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Sound of screams but the'),
|
||||||
|
/// color: Colors.green[300],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Who scream'),
|
||||||
|
/// color: Colors.green[400],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Revolution is coming...'),
|
||||||
|
/// color: Colors.green[500],
|
||||||
|
/// ),
|
||||||
|
/// Container(
|
||||||
|
/// padding: const EdgeInsets.all(8),
|
||||||
|
/// child: const Text('Revolution, they...'),
|
||||||
|
/// color: Colors.green[600],
|
||||||
|
/// ),
|
||||||
/// ],
|
/// ],
|
||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user