Skip to content

kh_starter_app

The Decennium Sprint starter template — a small, runnable Flutter app with khflutterlib already wired up: theme applied, a welcome splash, and both of kh_ui's navigation shells (KhBottomNav and KhNavDrawer) built and ready to compare live.

This app is not part of khflutterlib's own build — it's deliberately left out of the repo's Melos/Pub workspace, and its pubspec.yaml pulls kh_core/kh_theme/kh_ui/kh_screens/kh_utils in via the exact same git dependency + tag your own app will use (see docs/hackathon-quickstart.md). Nothing about how it resolves dependencies is special-cased for living inside this monorepo.

Using this as your own app

  1. Copy this folder (templates/starter_app/) out to its own location, outside the khflutterlib clone.
  2. Rename it, and update pubspec.yaml's name: field to match (Dart package names: lowercase, underscores).
  3. This folder ships with android/, web/ and windows/ runner folders, so it runs on those out of the box. For iOS, macOS or Linux, generate the missing runners once, from inside this folder:
    flutter create --platforms=ios,macos,linux .
    
    That adds the platform folders without touching the existing pubspec.yaml or lib/. Drop platforms you don't need from the --platforms list.
  4. flutter pub get, then flutter run.
  5. Walk the flow once: welcome screen → pick a nav style → home shell. Pick whichever nav style fits your app, then delete the other branch in lib/home_shell.dart, delete lib/nav_style_choice_screen.dart, and point lib/welcome_screen.dart's onInitializationComplete straight at your chosen home screen.
  6. Replace lib/welcome_screen.dart's logo with your own team/app branding, and each screen's placeholder content in lib/home_shell.dart with your actual screens.

What's in here

  • lib/main.dart — MaterialApp wired to KhTheme.light()/.dark().
  • lib/welcome_screen.dart — a KhSplashScreen (from kh_screens) showing the welcome branding; swap in real bootstrap work via its initialize callback if your app needs one (session restore, a feature-flag fetch, etc. — see KhSplashScreen's own doc comment).
  • lib/nav_style_choice_screen.dart — the bottom-nav-vs-drawer picker; delete once you've chosen. Also shows kh_utils's KhLogger with a one-line log on selection — a starting point for KhValidators and KhFormatters too (see docs/hackathon-quickstart.md).
  • lib/home_shell.dart — the actual home screen, built once and rendered inside whichever shell you picked; three placeholder destinations (Home/Explore/Profile) using KhCard for content, so you're replacing real widget usage rather than starting from a blank Text('TODO').

Not included

Login, auth, networking, and state management aren't wired up here, and khflutterlib doesn't ship packages for them yet, so use whatever you like for those. kh_screens does have a KhLoginForm if your sprint app needs a login screen — it's not part of this starter's default flow, but it's a drop-in you can add.