-
Notifications
You must be signed in to change notification settings - Fork 0
/
SingleChildScrollAbout.dart
43 lines (40 loc) · 1.27 KB
/
SingleChildScrollAbout.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import 'package:flutter/material.dart';
import 'package:flutter_starter_notes/component/CommonTitle.dart';
class SingleChildScrollAbout extends StatelessWidget {
SingleChildScrollAbout({Key key, this.title});
final String title;
final String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Scrollbar(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
CommonTitle('SingleChildScrollAbout 介绍与示例'),
Container(
padding: EdgeInsets.all(16),
child: Text(
"SingleChildScrollView类似于Android中的ScrollView,它只能接收一个子Widget。"),
),
Column(
//动态创建一个List<Widget>
children: str
.split("")
//每一个字母都用一个Text显示,字体为原来的两倍
.map((c) => Text(
c,
textScaleFactor: 2.0,
))
.toList(),
)
],
),
),
),
);
}
}