74 lines
2.2 KiB
Dart
74 lines
2.2 KiB
Dart
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:baligh/screens/report_screen.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class BlighCard extends StatelessWidget {
|
|
const BlighCard({
|
|
super.key,
|
|
required this.icon,
|
|
required this.label,
|
|
required this.iconColor,
|
|
});
|
|
|
|
final IconData icon;
|
|
final String label;
|
|
final Color iconColor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ReportScreen(
|
|
headerText: label,
|
|
)));
|
|
},
|
|
child: Column(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
width: double.infinity,
|
|
clipBehavior: Clip.hardEdge,
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).cardColor,
|
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
|
),
|
|
child: Padding(
|
|
padding:
|
|
const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
Center(
|
|
child: SizedBox(
|
|
height: MediaQuery.sizeOf(context).width * 0.2,
|
|
child: Icon(
|
|
icon,
|
|
size: 45,
|
|
color: iconColor,
|
|
),
|
|
),
|
|
),
|
|
AutoSizeText(
|
|
label,
|
|
maxLines: 2,
|
|
minFontSize: 10,
|
|
maxFontSize: 18,
|
|
overflow: TextOverflow.ellipsis,
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|