42 lines
1.0 KiB
Dart
42 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SubjectCard extends StatelessWidget {
|
|
final String subject;
|
|
final Color color;
|
|
final VoidCallback onTap;
|
|
const SubjectCard({
|
|
super.key,
|
|
required this.subject,
|
|
required this.color,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
child: Ink(
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [color, Color.lerp(color, Colors.black, 0.15)!],
|
|
),
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
subject,
|
|
style: const TextStyle(
|
|
color: Color.fromARGB(167, 255, 255, 255),
|
|
fontSize: 40.0,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|