123456789101112131415161718192021222324252627282930 |
- import 'package:flutter/material.dart';
- /**
- * 表单中必填的文本描述,文本后加红色*标识
- * 使用富文本的方式实现
- */
- class FormRequireText extends StatelessWidget {
- final String text;
- FormRequireText({required this.text});
- @override
- Widget build(BuildContext context) {
- return RichText(
- text: TextSpan(
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.w400, color: Colors.white),
- children: <TextSpan>[
- TextSpan(
- text: text,
- ),
- TextSpan(
- text: " *",
- style: TextStyle(color: Colors.red),
- ),
- ],
- ),
- );
- }
- }
|