You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PatientApp-KKUMC/lib/pages/pharmacies/widgets/home/GridViewCard.dart

84 lines
2.6 KiB
Dart

import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class GridViewCard extends StatelessWidget {
final String text;
final String cardImage;
final Function handler;
GridViewCard(this.text, this.cardImage, this.handler);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
child: Row(
children: [
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.all(6),
child: Column(
children: [
Texts(
text,
color: Colors.white,
bold: true,
fontSize: SizeConfig.textMultiplier! * 1.3,
),
],
),
),
),
Row(
children: [
BorderedButton(
TranslationBase.of(context).viewAll,
handler: handler,
tPadding: 0,
textColor: Color(0xFF5ab145),
bPadding: 0,
),
Expanded(child: Container()),
],
),
],
),
),
Expanded(
child: Align(
alignment: Alignment.centerRight,
child: Image.asset(
cardImage,
fit: BoxFit.cover,
),
),
),
],
),
),
);
}
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}
}