forked from lxm_flutter/FlutterUnit
35 lines
948 B
Dart
35 lines
948 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// create by 张风捷特烈 on 2020-03-29
|
|
/// contact me by email 1981462002@qq.com
|
|
/// 说明:
|
|
|
|
|
|
// {
|
|
// "widgetId": 2,
|
|
// "priority": 6,
|
|
// "name": "是否包裹与越界效果",
|
|
// "subtitle": "【softWrap】 : 是否换行 【bool】\n"
|
|
// "【overflow】 : 越界效果 【TextOverflow】\n"
|
|
// "下面softWrap=false; overflow依次是:clip、fade、ellipsis、visible ",
|
|
// }
|
|
class SoftWrapText extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Wrap(
|
|
spacing: 10,
|
|
runSpacing: 10,
|
|
children: TextOverflow.values
|
|
.map((e) => Container(
|
|
width: 150,
|
|
color: Colors.cyanAccent.withAlpha(33),
|
|
height: 150 * 0.618 * 0.618,
|
|
child: Text(" 张风捷特烈 toly " * 5,
|
|
overflow: e,
|
|
softWrap: false),
|
|
))
|
|
.toList(),
|
|
);
|
|
}
|
|
}
|