Report Card
Loading preview
Starting the Flutter app
A showcase of Flutter's report card functionality
import 'package:flutter/material.dart';
const _grades = [
{'subject': 'Flutter Fundamentals', 'grade': 'A', 'score': 92},
{'subject': 'Dart Programming', 'grade': 'A-', 'score': 88},
{'subject': 'State Management', 'grade': 'B+', 'score': 87},
{'subject': 'Firebase', 'grade': 'A', 'score': 94},
];
class ReportCard extends StatelessWidget {
const ReportCard({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Report Card')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
children: [
Text(
'GPA: 3.8',
style: Theme.of(context).textTheme.headlineMedium,
),
Text('Spring 2025', style: Theme.of(context).textTheme.bodyMedium),
],
),
),
),
const SizedBox(height: 16),
..._grades.map((g) => Card(
margin: const EdgeInsets.only(bottom: 8),
child: ListTile(
title: Text(g['subject'] as String),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
g['grade'] as String,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(width: 8),
Text('${g['score']}%', style: Theme.of(context).textTheme.bodySmall),
],
),
),
)),
],
),
);
}
}
Add it to your project
Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.
First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.
How it works
A summary Card shows GPA: 3.8 and the term, followed by one ListTile per entry in _grades with its letter and percentage. Both summary values are literals, so the GPA is not calculated from the grades listed beneath it. Nothing on the page is interactive.
Adapting it
- Calculate the GPA from
_gradesusing your institution’s point scale. - Add constructor parameters to
ReportCardfor the student and term, replacingSpring 2025. - Decide whether
gradecomes from the server or is derived fromscore, so the two can never disagree.