39 lines
813 B
Dart
39 lines
813 B
Dart
|
part of 'home_page.dart';
|
||
|
|
||
|
class _CardData{
|
||
|
final String text;
|
||
|
final String descriptionText;
|
||
|
final IconData icon;
|
||
|
final String? imageUrl;
|
||
|
|
||
|
_CardData(
|
||
|
this.text, {
|
||
|
required this.descriptionText,
|
||
|
this.icon= Icons.ac_unit_outlined,
|
||
|
this.imageUrl,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
class _Card extends StatefulWidget {
|
||
|
final String text;
|
||
|
final String descriptionText;
|
||
|
final IconData icon;
|
||
|
final String? imageUrl;
|
||
|
|
||
|
const _Card(
|
||
|
this.text, {
|
||
|
this.icon = Icons.ac_unit_outlined,
|
||
|
required this.descriptionText,
|
||
|
this.imageUrl,
|
||
|
});
|
||
|
|
||
|
factory _Card.fromData(_CardData data) => _Card(
|
||
|
data.text,
|
||
|
descriptionText: data.descriptionText,
|
||
|
icon: data.icon,
|
||
|
imageUrl: data.imageUrl,
|
||
|
);
|
||
|
|
||
|
@override
|
||
|
State<_Card> createState() => _CardState();
|
||
|
}
|