Use sliver-based scrolling in more places (#7892)

This patch uses sliver-based two more gallery demos, the stocks example,
in the date picker, and in markdown.
This commit is contained in:
Adam Barth
2017-02-05 21:39:24 -08:00
committed by GitHub
parent 0bcecef5de
commit 31e2a500f7
8 changed files with 135 additions and 127 deletions

View File

@@ -64,15 +64,15 @@ class MarkdownBody extends MarkdownBodyRaw {
/// by default not using syntax highlighting, but it's possible to pass in
/// a custom [syntaxHighlighter].
///
/// Typically, you may want to wrap the [MarkdownBody] widget in a [Padding] and
/// a [ScrollableViewport], or use the [Markdown] class
/// Typically, you may want to wrap the [MarkdownBody] widget in a
/// [SingleChildScrollView], or use the [Markdown] class.
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new EdgeInsets.all(16.0),
/// child: new Markdown(data: markdownSource)
/// )
/// )
/// ```dart
/// new SingleChildScrollView(
/// padding: new EdgeInsets.all(16.0),
/// child: new Markdown(data: markdownSource),
/// ),
/// ```
MarkdownBody({
String data,
SyntaxHighlighter syntaxHighlighter,

View File

@@ -52,16 +52,16 @@ class MarkdownRaw extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new ScrollableViewport(
child: new Padding(
padding: padding,
child: createMarkdownBody(
data: data,
markdownStyle: markdownStyle,
syntaxHighlighter: syntaxHighlighter,
onTapLink: onTapLink
)
)
// TODO(abarth): We should use a ListView here and lazily build the widgets
// from the markdown.
return new SingleChildScrollView(
padding: padding,
child: createMarkdownBody(
data: data,
markdownStyle: markdownStyle,
syntaxHighlighter: syntaxHighlighter,
onTapLink: onTapLink,
),
);
}
@@ -93,17 +93,17 @@ class MarkdownBodyRaw extends StatefulWidget {
/// highlighting, but it's possible to pass in a custom [syntaxHighlighter].
///
/// Typically, you may want to wrap the [MarkdownBodyRaw] widget in a
/// [Padding] and a [ScrollableViewport], or use the [Markdown class]
/// a [ScrollableViewport], or use the [Markdown class].
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new EdgeInsets.all(16.0),
/// child: new MarkdownBodyRaw(
/// data: markdownSource,
/// markdownStyle: myStyle
/// )
/// )
/// )
/// ```dart
/// new SingleChildScrollView(
/// padding: new EdgeInsets.all(16.0),
/// child: new MarkdownBodyRaw(
/// data: markdownSource,
/// markdownStyle: myStyle,
/// ),
/// ),
/// ```
MarkdownBodyRaw({
this.data,
this.markdownStyle,