mirror of
https://github.com/londonappbrewery/Flutter-Course-Resources/
synced 2024-11-15 05:44:55 +00:00
25 lines
568 B
Dart
25 lines
568 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class ReusableCard extends StatelessWidget {
|
||
|
ReusableCard({@required this.colour, this.cardChild, this.onPress});
|
||
|
|
||
|
final Color colour;
|
||
|
final Widget cardChild;
|
||
|
final Function onPress;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return GestureDetector(
|
||
|
onTap: onPress,
|
||
|
child: Container(
|
||
|
child: cardChild,
|
||
|
margin: EdgeInsets.all(15.0),
|
||
|
decoration: BoxDecoration(
|
||
|
color: colour,
|
||
|
borderRadius: BorderRadius.circular(10.0),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|