mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-01 14:58:50 +08:00
refactor:按照代码规范调整markdow解析
This commit is contained in:
@ -6,7 +6,6 @@
|
||||
/// target: AppBar 的示例
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
|
||||
import './demo.dart' as AppBarDemo;
|
||||
import 'package:flutter_go/components/widget_demo.dart';
|
||||
@ -47,7 +46,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'AppBar',
|
||||
codeUrl: 'components/Bar/AppBar/demo.dart',
|
||||
contentList: [allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/material/AppBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -56,36 +55,17 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 AppBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
AppBarDemo.AppBarLessDefaultSimple(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text2),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
AppBarDemo.AppBarLessDefaultComplex(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
])
|
||||
);
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
AppBarDemo.AppBarLessDefaultSimple(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text2,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
AppBarDemo.AppBarLessDefaultComplex(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
];
|
||||
}
|
||||
|
||||
// 带align的text
|
||||
Widget textAlignBar(String txt) {
|
||||
return Align(
|
||||
alignment: FractionalOffset.centerLeft,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(height: 20.0),
|
||||
MarkdownBody(data: txt)
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,6 @@ import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import './demo.dart' as BottomAppBarDemo;
|
||||
|
||||
const String _Text0 =
|
||||
@ -38,7 +37,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'BottomAppBar',
|
||||
codeUrl: 'components/Bar/BottomAppBar/demo.dart',
|
||||
contentList: [allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/material/BottomAppBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -47,20 +46,15 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 BottomAppBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
BottomAppBarDemo.AppBarLessDefaultSimple(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
])
|
||||
);
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
BottomAppBarDemo.AppBarLessDefaultSimple(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,6 @@ import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import './demo.dart' as ButtonBarDemo;
|
||||
|
||||
const String _Text0 =
|
||||
@ -41,7 +40,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'ButtonBar',
|
||||
codeUrl: 'components/Bar/ButtonBar/demo.dart',
|
||||
contentList: [allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/material/ButtonBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -50,18 +49,13 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 ButtonBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
//SizedBox(height: 20.0), // 间距
|
||||
ButtonBarDemo.ButtonBarLessDefault()
|
||||
])
|
||||
);
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
//SizedBox(height: 20.0), // 间距
|
||||
ButtonBarDemo.ButtonBarLessDefault()
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import './demo.dart' as FlexibleSpaceBarDemo;
|
||||
|
||||
const String _Text0 =
|
||||
@ -28,7 +27,7 @@ const String _Text1 =
|
||||
|
||||
|
||||
class Demo extends StatefulWidget {
|
||||
static const String routeName = '/components//Bar/FlexibleSpaceBar';
|
||||
static const String routeName = '/components/Bar/FlexibleSpaceBar';
|
||||
|
||||
@override
|
||||
_DemoState createState() => _DemoState();
|
||||
@ -40,7 +39,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'FlexibleSpaceBar',
|
||||
codeUrl: 'components/Bar/FlexibleSpaceBar/demo.dart',
|
||||
contentList: [allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/material/FlexibleSpaceBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -49,19 +48,14 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 FlexibleSpaceBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
FlexibleSpaceBarDemo.FlexibleSpaceBarLessDefault(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
])
|
||||
);
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
FlexibleSpaceBarDemo.FlexibleSpaceBarLessDefault(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import './demo.dart' as SliverAppBarDemo;
|
||||
|
||||
const String _Text0 =
|
||||
@ -40,7 +39,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'SliverAppBar',
|
||||
codeUrl: 'components/Bar/SliverAppBar/demo.dart',
|
||||
contentList:[allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/widgets/SliverAppBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -49,31 +48,13 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 SliverAppBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
SliverAppBarDemo.SliverAppBarLessDefault()
|
||||
])
|
||||
);
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
SliverAppBarDemo.SliverAppBarLessDefault()
|
||||
];
|
||||
}
|
||||
|
||||
// 带align的text
|
||||
Widget textAlignBar(String txt) {
|
||||
return Align(
|
||||
alignment: FractionalOffset.centerLeft,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(height: 20.0),
|
||||
MarkdownBody(data: txt)
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,10 +4,7 @@
|
||||
/// Time: 上午12:06
|
||||
/// email: zhu.yan@alibaba-inc.com
|
||||
/// target: SnackBar 的示例
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
|
||||
import 'package:flutter_go/components/widget_demo.dart';
|
||||
import './demo.dart' as SnackBarDemo;
|
||||
@ -40,7 +37,7 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'SnackBar',
|
||||
codeUrl: 'components/Bar/SnackBar/demo.dart',
|
||||
contentList: [allDomes(context, this)],
|
||||
contentList: allDomes(context, this),
|
||||
docUrl: 'https://docs.flutter.io/flutter/material/SnackBar-class.html',
|
||||
);
|
||||
}
|
||||
@ -49,32 +46,13 @@ class _DemoState extends State<Demo> {
|
||||
// 所有的 SnackBar widget
|
||||
// context: 运行上下文
|
||||
// that: 指向有状态的 StatefulWidget
|
||||
Widget allDomes(BuildContext context, _DemoState that) {
|
||||
return Container(
|
||||
//padding: EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
MarkdownBody(data: _Text0),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
MarkdownBody(data: _Text1),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
SnackBarDemo.SnackBarLessDefault(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
// 带align的text
|
||||
Widget textAlignBar(String txt) {
|
||||
return Align(
|
||||
alignment: FractionalOffset.centerLeft,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(height: 20.0),
|
||||
MarkdownBody(data: txt)
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
List allDomes(BuildContext context, _DemoState that) {
|
||||
return [
|
||||
_Text0,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
_Text1,
|
||||
SizedBox(height: 20.0), // 间距
|
||||
SnackBarDemo.SnackBarLessDefault(),
|
||||
SizedBox(height: 20.0), // 间距
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user