43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class Warning extends StatelessWidget {
|
|
const Warning({super.key, required this.content});
|
|
final List<TextSpan> content;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color:
|
|
(MediaQuery.of(context).platformBrightness == Brightness.light)
|
|
? const Color.fromARGB(255, 151, 141, 48)
|
|
: Colors.yellow,
|
|
width: 2),
|
|
borderRadius: BorderRadius.circular(8),
|
|
color: (MediaQuery.of(context).platformBrightness == Brightness.dark)
|
|
? const Color.fromARGB(255, 151, 141, 48)
|
|
: Colors.yellow,
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(12.0),
|
|
child: Row(
|
|
children: [
|
|
const Icon(
|
|
Icons.warning,
|
|
size: 50,
|
|
),
|
|
const SizedBox(
|
|
width: 10,
|
|
),
|
|
Flexible(
|
|
child: RichText(
|
|
text: TextSpan(children: content),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|