Skip to content

Project · Flutter and Dart

Project: a college canteen ordering app

Projectintermediate· about 10 hours· 7 steps

The brief

Build Campus Canteen, a Flutter app where students browse the menu, open an item, add it to a cart shared across screens, and place a pickup order through a validated form. Each part is proved by widget tests, and the finished app passes flutter analyze.

Why it matters

Menus, carts and checkout forms are the bread and butter of Flutter freelance and agency work: canteens, cloud kitchens, salons and local shops all ask for them. Clients also expect deep-linkable screens and tests, so a bug in the cart total is caught before a student pays the wrong amount.

Skills you practise

  • flutter pub add
  • ListView.builder, Card and ListTile
  • go_router with path parameters
  • Provider with ChangeNotifier
  • context.watch, select and read
  • Form, TextFormField and validators
  • SegmentedButton
  • widget tests with WidgetTester
  • flutter analyze

You need

  • Flutter 3.24 or newer (stable), with Android Studio or VS Code
  • An Android emulator or phone (or Chrome, with flutter run -d chrome)

What you will have at the end

The Campus Canteen Flutter app: a menu, item pages with deep-linkable routes, a Provider cart shared by every screen, a validated checkout, 10 passing tests and a clean flutter analyze.

How it is marked (rubric, 100 points)
Works end to endA student can browse, add, review the cart and place an order for the right total, on a device and in the tests.30
State and navigation done rightCart rules live in CartModel; watch/select in build and read in callbacks; ids in the route path; unknown ids handled.25
Forms and safetyValidators with clear messages, controllers disposed, no personal data in logs.20
Tested and cleanAll 10 tests pass together and flutter analyze reports no issues.25

0/7 steps done

Step 1 of 7

Create the app and add packages

The campus_canteen project exists with provider and go_router in its dependencies.

Create the project and add the two packages it needs: provider (state shared across screens, module 7) and go_router (routes with URLs, module 6). flutter pub add writes them into pubspec.yaml and downloads them, with the packages they depend on.

Then copy the starter files: lib/main.dart, lib/models.dart and the test files under test/. Delete the template's test/widget_test.dart, which tests the old counter app. The given tests are your specification: each step makes one more test file pass.

Run this on your machine, then paste the output below
$ flutter pub add provider go_router

Also check yourself

Your notes: lib/main.dart, lib/models.dart

Write down each command you ran. It goes into your project summary.