selfprivacy.org.app/lib/ui/components/info_box/info_box.dart

33 lines
815 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
class InfoBox extends StatelessWidget {
const InfoBox({
required this.text,
this.isWarning = false,
super.key,
});
final String text;
final bool isWarning;
@override
Widget build(final BuildContext context) => Wrap(
spacing: 8.0,
runSpacing: 16.0,
crossAxisAlignment: WrapCrossAlignment.center,
2022-09-15 21:08:32 +00:00
children: [
Icon(
isWarning ? Icons.warning_amber_outlined : Icons.info_outline,
size: 24,
2024-08-21 09:22:20 +00:00
color: Theme.of(context).colorScheme.onSurface,
2022-09-15 21:08:32 +00:00
),
Text(
text,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
2024-08-21 09:22:20 +00:00
color: Theme.of(context).colorScheme.onSurface,
2022-09-15 21:08:32 +00:00
),
),
],
);
}