Build · 3h · ₹0
An offline-first Flutter mobile application for tracking 6-day workout splits, budget-aware macro planning, and body recomposition metrics with Riverpod state architecture.
What it does
The mechanics, data flow, and user interaction model behind Fitladder.
Provides a structured 6-day workout split (Push, Pull, Legs, Hypertrophy, Conditioning) with animated exercise demonstrations, per-set weight/rep logging, and rest interval timers. A budget-aware nutrition module calculates remaining daily macronutrient targets and deterministically matches foods from a verified Indian & international dietary database (whey, paneer, eggs, chicken, oats, rice, lentils) to suggest balanced meal combos that fit remaining caloric allocations. The app also features a body recomposition dashboard tracking body fat percentage vs. target weight on dynamic CustomPainter gauges, along with digital QR gym check-in passes.
Technical Highlights
- 100% Offline-First architecture: Riverpod reactive state management + JSON-serialized local persistence
- Structured 6-day workout program featuring animated exercise cards and per-set progressive overload logging
- Budget-aware macro matcher: deterministically computes meal combinations that fit exact remaining calorie/protein targets
- Dynamic body recomposition gauge built with custom Flutter Canvas & CustomPainter primitives
- Modular feature-first folder architecture (dashboard/, nutrition/, workout/, profile/) designed for scalable on-device LLM additions
Why it matters
The architectural judgment, practical engineering decisions, and core problems solved.
Gyms and basement fitness centers are notoriously prone to zero cellular reception. Fitness apps that rely on continuous cloud API requests fail at the exact moment a trainee needs to log a set or check an exercise cue. Fitladder embraces a 100% local-first mobile architecture using Flutter and Riverpod: entire workout logs, meal databases, and user profiles serialize to local SharedPreferences and SQLite, ensuring zero latency, zero subscription costs, and seamless offline functionality, with cloud sync cleanly decoupled as a planned roadmap phase.
Basement gym trainees logging sets without network interruptions
High-protein Indian dietary planning (vegetarian, eggetarian, non-vegetarian meal budgeting)
Personal trainers managing offline client workout cards and recomposition targets
Reference implementation for architecting clean, offline-first mobile apps in Flutter
System architecture
End-to-end execution pipeline running across Flutter 3.x, Dart, Riverpod, SharedPreferences, CustomPainter.
Reactive dependency injection and immutable state providers across workout and diet domains
Manages 6-day PPL/Hypertrophy cycle, animated SVG assets, and set/rep logging tables
Deterministic solver matching remaining protein/carb/fat budget against food library
Client-side local disk serialization guaranteeing instant offline reads and writes
Renders circular body-fat recomposition gauges, progress arcs, and QR membership passes
The path
Step-by-step implementation guide. Verbatim code snippets, configurations, and prompts.
Architecting Riverpod State Providers for Offline Persistence
Define StateNotifier providers for user profile, daily logs, and nutrition, saving updates automatically to local JSON storage.
Verbatim Code / Config
class WorkoutNotifier extends StateNotifier<WorkoutState> {
WorkoutNotifier(this.prefs) : super(WorkoutState.initial()) { loadFromStorage(); }
final SharedPreferences prefs;
void logSet(String exerciseId, int reps, double weight) {
state = state.addSet(exerciseId, reps, weight);
prefs.setString('workout_history', jsonEncode(state.toJson()));
}
}Building the 6-Day Structured Workout Split UI
Construct modular exercise cards with animated GIF/Lottie demonstrations, warm-up calculators, and rest timers.
Verbatim Code / Config
Widget buildExerciseCard(Exercise ex) {
return Card(
child: Column(
children: [
Image.asset(ex.animAsset, height: 180),
Text(ex.name, style: Theme.of(context).textTheme.titleMedium),
SetLoggingTable(exerciseId: ex.id)
]
)
);
}Implementing the Deterministic Macro Budget Solver
Write a constraint-matching algorithm that queries the local food catalog to suggest meals satisfying remaining calorie and protein requirements.
Verbatim Code / Config
List<FoodItem> suggestMeals(MacroBudget remaining) {
return foodCatalog.where((food) =>
food.calories <= remaining.calories &&
food.protein >= remaining.protein * 0.4
).toList();
}Drawing the Body Recomposition Canvas Gauge
Create a CustomPainter that paints radial gradient arcs visualizing current body fat percentage against target recomposition goals.
Verbatim Code / Config
class RecompGaugePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()..style = PaintingStyle.stroke..strokeWidth = 14;
canvas.drawArc(Rect.fromLTWH(0, 0, size.width, size.height), -pi, pi * progress, false, paint);
}
}Where it broke
The failure mode, root-cause breakdown, and resolution discovered during development.
The Tell
“App state reset to default values whenever the user closed the app during an active workout session.”
Why it failed
Set logs were held only in transient Riverpod memory variables without immediate disk persistence, causing app kill events to wipe out active session progress.
The Fix
Implemented auto-saving transactional middleware in Riverpod that flushes workout state to SharedPreferences on every single set recorded, recovering incomplete sessions seamlessly on relaunch.
What it cost
₹0 to build and run permanently within verified free tiers.
| Service / Tool | Cost | Free Tier Limits |
|---|---|---|
| Flutter SDK 3.x & Dart | ₹0 | Open-source BSD-3-Clause mobile application framework |
| Riverpod & SharedPreferences | ₹0 | Open-source state management and local mobile storage |
| Local Dietary & Exercise Data | ₹0 | Bundled local JSON assets with zero cloud API dependencies |
| Vector Assets & Canvas UI | ₹0 | Open-source icons and native Flutter CustomPainter rendering |
Make it yours
Three concrete variations you can build and ship using this exact foundation.
- 01
Powerlifting 5/3/1 Percentage Calculator: Computes training max percentages and generates warm-up set progressions.
- 02
Keto & Low-Carb Macro Tracker: Tailors the budget solver to strictly constrain net carbohydrates under 25g daily.
- 03
Climbing & Hangboard Interval Coach: Manages 7s hang / 3s rest grip protocols with audio cues and grip difficulty logs.
Where next
Ready to ship Fitladder?
Review the architecture, clone the prompt and implementation steps, and deploy your live URL for ₹0.