1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import 'package:fitness_dashboard_ui/data/health_details.dart';
- import 'package:fitness_dashboard_ui/util/responsive.dart';
- import 'package:fitness_dashboard_ui/widgets/custom_card_widget.dart';
- import 'package:flutter/material.dart';
- class ActivityDetailsCard extends StatelessWidget {
- const ActivityDetailsCard({super.key});
- @override
- Widget build(BuildContext context) {
- final healthDetails = HealthDetails();
- return GridView.builder(
- itemCount: healthDetails.healthData.length,
- shrinkWrap: true,
- physics: const ScrollPhysics(),
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: Responsive.isMobile(context) ? 2 : 4,
- crossAxisSpacing: Responsive.isMobile(context) ? 12 : 15,
- mainAxisSpacing: 12.0,
- ),
- itemBuilder: (context, index) => CustomCard(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Image.asset(
- healthDetails.healthData[index].icon,
- width: 30,
- height: 30,
- ),
- Padding(
- padding: const EdgeInsets.only(top: 15, bottom: 4),
- child: Text(
- healthDetails.healthData[index].value,
- style: const TextStyle(
- fontSize: 18,
- color: Colors.white,
- fontWeight: FontWeight.w600,
- ),
- ),
- ),
- Text(
- healthDetails.healthData[index].title,
- style: const TextStyle(
- fontSize: 13,
- color: Colors.grey,
- fontWeight: FontWeight.normal,
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
|