Page MenuHomec4science

stats_grid.dart
No OneTemporary

File Metadata

Created
Fri, Jul 5, 05:15

stats_grid.dart

import 'package:flutter/material.dart';
class StatsGrid extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * 0.25,
child: Column(
children: <Widget>[
Flexible(
child: Row(
children: <Widget>[
_buildStatCard('Trials', '', Colors.orange),
_buildStatCard('ctivitty', '', Colors.red),
],
),
),
Flexible(
child: Row(
children: <Widget>[
_buildStatCard('MIstakes in intercept', '', Colors.green),
_buildStatCard('MIstakes in slope', '', Colors.lightBlue),
_buildStatCard('Progress', '', Colors.purple),
],
),
),
],
),
);
}
Expanded _buildStatCard(String title, String count, MaterialColor color) {
return Expanded(
child: Container(
margin: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(10.0),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
title,
style: const TextStyle(
color: Colors.white,
fontSize: 15.0,
fontWeight: FontWeight.w600,
),
),
Text(
count,
style: const TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
);
}
}

Event Timeline