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