37 lines
1005 B
Dart
37 lines
1005 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
|
|
class BuildText extends StatelessWidget {
|
|
const BuildText({
|
|
Key? key,
|
|
required this.text,
|
|
this.size = 18,
|
|
this.isMd = true,
|
|
}) : super(key: key);
|
|
|
|
final String text;
|
|
final double size;
|
|
final bool isMd;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final mdStyle = MarkdownStyleSheet(
|
|
p: TextStyle(fontSize: size, color: Colors.black, letterSpacing: 0.3),
|
|
textAlign: WrapAlignment.spaceBetween,
|
|
);
|
|
|
|
return Container(
|
|
padding: const EdgeInsets.all(12),
|
|
width: 375,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white, border: Border.all(color: Colors.grey[900]!)),
|
|
child: isMd
|
|
? MarkdownBody(data: text, styleSheet: mdStyle)
|
|
: Text(text,
|
|
textAlign: TextAlign.justify,
|
|
style: TextStyle(
|
|
fontSize: size, color: Colors.black, letterSpacing: 0.3)),
|
|
);
|
|
}
|
|
}
|