Skip to content

About

Ball-by-ball cricket scorer for street, school and weekend matches. Flutter web PWA + Android, works offline, matches stay on your device.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gully Games

Street games from the gully and the maidan, plus ball-by-ball scoring for real cricket.
Free, open source, works offline, and nothing leaves your phone.

CI Deploy MIT license Flutter 3.44 Web and Android

Open the live app  ·  install it from your browser menu ("Add to Home screen") and it works with no signal

Scoring screen: Lane Lions 31/1 chasing 51, free hit, big run buttons Scorecard with batting, bowling, extras and fall of wickets Match setup with gully rules List of saved matches

Why

Scoring a gully match on paper goes wrong the moment someone asks "how many balls left?" or a ball is recorded twice. Big scoring apps want an account, a network connection and full cricket rules. This one is for the game you actually play: 5 overs a side, 6 players, last man stands, and a wide that may or may not be worth a run.

Features

The app opens on a hub: the games, and the cricket scorer. The scorer is the original heart of the project (it started life as Gully Cricket Scorer) and works exactly as before.

Match setup

  • Two teams, any number of overs, 2 to 30 players a side
  • Optional player names (one per line); blanks become "Player 1", "Player 2"…
  • Gully rules you can switch: last man stands, wide = 0 or 1 run, no-ball = 0 or 1 run, free hit after a no-ball
  • Choose who bats first

Ball-by-ball scoring

  • Big buttons for 0–6, wide, no-ball (plus runs off the bat), byes, leg byes
  • Wickets: bowled, caught, LBW, stumped, hit wicket, run out (either batter, with runs completed, off a fair ball, wide or no-ball) and retired
  • Strike changes on odd runs and at the end of each over; swap by hand if needed
  • Asks for the new bowler every over (not the previous over's bowler) and the next batter after every wicket
  • Free hits: only a run out counts, and the free hit carries over a wide
  • Undo any number of balls, all the way back to the toss
  • Innings break with the target, required run rate and "need 20 from 10"
  • Result: "won by 12 runs", "won by 3 wickets", or a tie, with an optional super over (the side that batted second bats first, 2 wickets)

Scorecard

  • Batting: R, B, 4s, 6s, SR and how out
  • Bowling: O, M, R, W, Econ
  • Extras, total, did not bat, fall of wickets, over-by-over summary
  • Share as WhatsApp-friendly text, or copy it
  • Share as an image: the whole scorecard as one tall PNG, ready for a group chat (browsers without file sharing download it instead)

Games

Nine quick action games, each with a best score kept on your device.

  • Akhada Duel (3D): one-on-one bouts in a mud wrestling pit. Punch, kick and block through tougher and tougher opponents.
  • Kabaddi Raid (3D): cross the line, draw a dive, tag the defender and get home before the clock runs out.
  • Gilli Danda (3D): flick the gilli up and hit it as it crosses the stick. Distance is your score.
  • Kite Fight (2D): cut rival kites' strings before they cut yours.
  • Carrom Strike (2D): pocket coins against the clock.
  • Gully Dash (2D): sprint down a three-lane gully dodging scooters, cows and potholes.
  • Gully Batting (3D): time your swing as the ball arrives. Perfect timing is a six, a miss on a straight one and you're bowled.
  • High Catch (3D): run the fielder under a skied ball before it lands.
  • Direct Hit (3D): drag to aim, let go to throw, and hit the stumps before the runner makes the crease.

Everywhere

  • Matches are saved after every ball, with a history list
  • Installable web app (PWA) that works offline, plus an Android build
  • Light and dark themes, large touch targets, screen-reader labels

Privacy

Everything stays on your device. There is no account, no server, no analytics and no ads. Matches are stored in your browser's local storage (or the app's private storage on Android). The only network requests the web app makes are for its own files and the Roboto font, so it can start offline later. Clearing the site's data deletes your matches.

How it works

The scoring engine is plain Dart with no Flutter imports, in lib/features/match/domain. A match is stored as its setup plus a list of events:

InningsStarted(striker: 0, nonStriker: 1, bowler: 0)
BallBowled.runs(4)
BallBowled(kind: BallKind.wide, runs: 1)
BallBowled(kind: BallKind.legal, dismissal: Dismissal(HowOut.caught))
BatterChosen(2)

Every number on screen (score, strike, figures, maidens, fall of wickets, whose turn it is to bowl, the result) is worked out by replaying those events. That makes undo a matter of dropping the last event, makes saved matches tiny, and makes the cricket rules easy to test: the engine has its own suite of unit tests covering extras, strike changes, maidens, free hits, last man stands, run outs at either end, early chase finishes, ties and super overs.

The mini games are built the same way: each game's rules and physics are a plain Dart class in lib/features/games/domain that is stepped once a frame and unit tested without a screen. The 3D games are drawn by a small renderer in engine3d (perspective camera, flat-shaded triangles, back-to-front sorting) on a plain Flutter canvas, so they need no game engine or extra packages and run the same on the web and Android.

The app around it follows the rules in flutter-agent-skills: Riverpod 3, go_router, feature-first folders, strict analysis and localised strings.

lib/
  core/                 router, sharing, clock, shared widgets
  features/
    match/
      domain/           pure-Dart engine: setup, events, derived state
      data/             shared_preferences storage
      presentation/     scoring screen, scorecard, controllers
    setup/              new match form
    games/
      domain/           pure-Dart rules and physics for each mini game
      data/             best scores in shared_preferences
      presentation/     game screens and a small 3D renderer (engine3d/)
    history/            saved matches
  l10n/                 strings (app_en.arb)

Run it

You need Flutter 3.44 or newer.

git clone https://github.com/ChandraChaan/gully-cricket-scorer.git
cd gully-cricket-scorer
flutter pub get
flutter run -d chrome

Checks that CI runs on every push:

dart format --output=none --set-exit-if-changed lib test
flutter analyze --fatal-infos
flutter test

Contributing

Bug reports and ideas are welcome in Issues and Discussions. If your street plays a rule this app doesn't handle (one-tip-one-hand, no running behind, six-and-out), open an issue describing it. For a change to the scoring rules, please add a test in test/features/match/match_state_test.dart.

License

MIT

About

Ball-by-ball cricket scorer for street, school and weekend matches. Flutter web PWA + Android, works offline, matches stay on your device.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages