mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 00:49:46 +08:00
refactor:按照代码规范调整markdow解析
This commit is contained in:
@ -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)
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user