mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-14 04:33:16 +00:00
22fbbb051e
shown as 1 line when content fits, wraps into column when not.
33 lines
821 B
Dart
33 lines
821 B
Dart
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,
|
|
children: [
|
|
Icon(
|
|
isWarning ? Icons.warning_amber_outlined : Icons.info_outline,
|
|
size: 24,
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
),
|
|
Text(
|
|
text,
|
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|