代码格式优化完毕

This commit is contained in:
toly
2022-03-26 21:25:40 +08:00
parent 36b5adbd7b
commit 59f8125e1a
265 changed files with 1684 additions and 1494 deletions

View File

@@ -12,6 +12,8 @@ import '../../../../app/utils/color_utils.dart';
// " 其他属性与Text相同,详见之。",
// }
class CustomRichText extends StatelessWidget {
const CustomRichText({Key? key}) : super(key: key);
final str = " 发光强度简称光强国际单位是坎德拉简写cd。"
"1cd是指光源在指定方向的单位立体角内发出的光通量。"
"光源辐射是均匀时则光强为I=F/ΩΩ为立体角单位为球面度sr,F为光通量"

View File

@@ -10,12 +10,14 @@ import 'package:flutter/material.dart';
// "使用WidgetSpan来承载普通组件作为RichText的内容",
// }
class RichTextWithWidget extends StatelessWidget {
const RichTextWithWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return RichText(
text: TextSpan(
text: 'hello ',
style: TextStyle(color: Colors.black, fontSize: 18),
style: const TextStyle(color: Colors.black, fontSize: 18),
children: <InlineSpan>[
WidgetSpan(
child: Image.asset(
@@ -24,29 +26,29 @@ class RichTextWithWidget extends StatelessWidget {
),
alignment: PlaceholderAlignment.baseline,
baseline: TextBaseline.ideographic),
TextSpan(
const TextSpan(
text: ' , welcome to ',
style: TextStyle(color: Colors.blue, fontSize: 18),
),
WidgetSpan(
const WidgetSpan(
child: FlutterLogo(),
alignment: PlaceholderAlignment.baseline,
baseline: TextBaseline.ideographic),
TextSpan(
const TextSpan(
text: ' .\n',
),
TextSpan(
const TextSpan(
text: 'focus me on ',
style: TextStyle(color: Colors.orange, fontSize: 16),
),
TextSpan(
const TextSpan(
text: 'https://github_model.com/toly1994328',
style: TextStyle(
color: Colors.blue,
fontSize: 18,
decoration: TextDecoration.underline),
),
TextSpan(
const TextSpan(
text: ' .\n',
),
],