m3_lightmeter/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart

39 lines
967 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:lightmeter/res/dimens.dart';
2023-09-01 20:52:49 +00:00
class IconPlaceholder extends StatelessWidget {
final IconData icon;
final String text;
const IconPlaceholder({
required this.icon,
required this.text,
super.key,
});
@override
Widget build(BuildContext context) {
return ConstrainedBox(
2023-09-01 20:52:49 +00:00
constraints: BoxConstraints(maxWidth: MediaQuery.sizeOf(context).width / 2),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
2023-09-01 20:52:49 +00:00
icon,
color: Theme.of(context).colorScheme.onBackground,
),
const SizedBox(height: Dimens.grid8),
Text(
2023-09-01 20:52:49 +00:00
text,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(color: Theme.of(context).colorScheme.onBackground),
textAlign: TextAlign.center,
),
],
),
);
}
}