Skip to main content

Project Structure

This guide explains the project layout step by step. Each section includes a screenshot so you can see exactly what to look for in your code editor. Files you need to change are clearly marked.

Follow the steps in order. Each builds on the previous one.


Step 1: Project Overview

When you open the project, this is what you see — all folders and files in one place:

Project overview
🔍 Hover to zoom
Folder / FileWhat It Is
android/Android phone build settings
ios/iPhone build settings
assets/All images, icons, fonts, translations
lib/All the app code — main folder
pubspec.yamlApp config file
test/Automated tests

Step 2: Config File — pubspec.yaml

Open this file first. It controls the app version, dependencies, and which image folders are included.

pubspec.yaml overview
🔍 Hover to zoom
SectionLineWhat to Change
App NameLine 1Change automatically → Automated Rename
VersionLine 19Change 1.0.0+1 to your version
DescriptionLine 3Change app description

:::tip Quick Rename Use change_project_name package to rename everything automatically. See Automated Rename below. :::

pubspec.yaml launcher icons
🔍 Hover to zoom
SectionWhat to Change
flutter_launcher_icons:Replace assets/icons/logo.png with your logo
adaptive_icon_background:Change background color for Android adaptive icon
adaptive_icon_foreground:Change foreground image for Android adaptive icon
pubspec.yaml assets
🔍 Hover to zoom
SectionWhat to Change
flutter: assets:Add new image folders here
pubspec.yaml fonts and icons
🔍 Hover to zoom
SectionWhat to Change
fonts:Replace font files in assets/font/

Step 3: Assets — Images, Icons, Fonts, Translations

This folder holds everything that is not code — pictures, icons, fonts, and language files.

Assets folder
🔍 Hover to zoom
SubfolderWhat It ContainsAction
data/Product data JSON fileReplace with your products
font/App font files (Manrope)Replace with your fonts
icons/Category icons, nav icons, logosReplace with your icons
images/Onboarding images, logosReplace with your images
translations/Language files (9 languages)Edit text for your app

Icons Folder

Icons folder
🔍 Hover to zoom
SubfolderWhat It ContainsAction
logo.pngApp icon (splash, login, home screen)Replace with your logo
catagory/Product category icons (9 categories)Replace with your icons
home_screen image/Home screen bannersReplace with your banners
navi_icon/Bottom navigation bar iconsReplace with your icons
setting/Settings screen iconsReplace with your icons

Translations Folder

Translations folder
🔍 Hover to zoom
FileLanguageAction
en_US.jsonEnglish (default)Edit all English text
fr.jsonFrenchTranslate or delete
es.jsonSpanishTranslate or delete
de.jsonGermanTranslate or delete
Other filesMore languagesTranslate or delete

Step 4: App Code — lib/

This is the main folder. Every screen, button, and feature lives here.

lib folder
🔍 Hover to zoom
FolderWhat It ContainsAction
main.dartApp entry pointChange initial route if needed
constants/Colors, fonts, spacing, configChange brand colors here
models/Data structure definitionsLeave as is
data/Data loaders and repositoriesLeave as is
services/Background workers (cart, profile)Leave as is
components/Reusable UI elementsCustomize button/card styles
pages/All screens the user seesCustomize screen layouts
routes/Screen navigation mapAdd new screens here
navigator/Bottom navigation barChange tab icons/order
theme/App visual styleLeave as is

Step 5: main.dart — The Starting Point

This is the very first file Flutter runs.

main.dart
🔍 Hover to zoom
What It DoesLineAction
Initialize storageLine 10Leave as is
Load translationsLine 15Leave as is
Start at Splash screenLine 25Change if you want different start screen
// This line controls which screen appears first
initialRoute: Routes.splashPage,

The Splash screen automatically navigates to Onboarding (first run) or Home (returning users).


Step 6: constants/ — All Design Values

This folder is the single source of truth for the app's visual design. Change a value here and it updates everywhere.

Constants folder
🔍 Hover to zoom
FileWhat It ControlsAction
ui.dartAll colors (primary green, backgrounds, borders)Change brand colors
text.dartAll font sizes and text weightsAdjust if needed
gaps.dartAll spacing values (padding, margins)Adjust if needed
images.dartCentral list of every image pathUpdate if you rename images
app_config.dartApp name, AI settings, pricing rulesChange app name and config
mock_data.dartSample data for testingLeave as is

Colors in ui.dart

VariableHexUsed ForChange To
primaryColor#004B30Main brand green — buttons, headersYour brand color
mintGreen#D2F6D2Light green backgroundsYour light background
yellowColor#EAB308Accent yellow — icons, highlightsYour accent color
bgColor#FAFAFAScreen backgroundsYour background color

Config in app_config.dart

VariableCurrent ValueChange To
appName'GreenCart'Your app name
appTagline'Smart Grocery Shopping'Your tagline
supportEmail'info@appstick.com.bd'Your support email
aiName'Hana AI'Your AI assistant name
freeShippingThreshold50.0Your free shipping minimum
shippingCharge2.0Your flat shipping fee
discountThreshold25.0Minimum order for discount
discountAmount4.0Fixed discount amount

Step 7: models/ — Data Blueprints

Models define what a piece of data looks like. They are blueprints, not the data itself.

Models folder
🔍 Hover to zoom
ModelWhat It DescribesAction
product_model.dartProduct — name, price, image, categoryAdd fields if needed
cart_item_model.dartCart item — product + quantityLeave as is
user_model.dartUser — name, email, phone, avatarAdd fields if needed
coupon_model.dartCoupon — code, discount, expiryLeave as is
notification_model.dartNotification — title, message, timeLeave as is
hana_ai_message.dartChat message — user input + bot responseLeave as is

You rarely need to edit these unless you want to add new data fields (like "rating" or "brand" to products).


Step 8: data/ — Loading Product Data

Data folder
🔍 Hover to zoom
SubfolderWhat It ContainsAction
loaders/Reads and parses JSON dataLeave as is
repositories/Provides data to screensLeave as is
seeds/Default data that ships with the appCustomize if needed

Data Flow

assets/data/products.json


lib/data/loaders/product_data_loader.dart


lib/data/repositories/product_repository_impl.dart


Screens use the data

Seed Data (Default Data)

FileWhat It ProvidesAction
default_addresses.dartPre-filled delivery addressesReplace with your addresses
default_coupons.dartAvailable coupon codesReplace with your coupons
default_notifications.dartWelcome notificationsReplace with your notifications
default_orders.dartSample order dataReplace with your orders
default_payment_cards.dartSaved payment methodsReplace with your payment methods

Step 9: services/ — Background Workers

Services handle things that happen behind the scenes.

Services folder
🔍 Hover to zoom
ServiceWhat It DoesAction
cart_service.dartAdds/removes items from cart, calculates totalsLeave as is
profile_service.dartSaves and loads user profile infoLeave as is
notification_service.dartHandles push notifications (Firebase)Configure Firebase if needed
local_storage_service.dartRemembers settings (language, login state)Leave as is
navigation_service.dartShortcuts for moving between screensLeave as is

You rarely need to edit these unless you are adding a new background feature.


Step 10: components/ — Reusable Building Blocks

These are pre-built pieces used across many screens. Instead of building the same button 20 times, it is built once here and reused everywhere.

Components folder
🔍 Hover to zoom
ComponentWhat It IsUsed OnAction
hana_button.dartMain green action buttonEvery screenChange button style
product_card.dartProduct card with image, priceHome, Category, SearchChange card design
hana_search_bar.dartSearch input fieldHome, All ProductsAdjust if needed
empty_state.dart"Nothing here yet" illustrationEmpty cart, wishlistReplace image if needed
form_input.dartText input fieldsLogin, Register, CheckoutAdjust if needed
quantity_stepper.dart+/- quantity controlsCart, Product DetailsAdjust if needed
stock_badge.dart"In Stock" / "Out of Stock" badgeProduct CardsAdjust colors if needed

Step 11: pages/ — Every Screen in the App

This is the largest folder. Every screen the user sees is here.

Pages folder
🔍 Hover to zoom
FolderWhat It ContainsAction
splash/Loading screen — logo + animationReplace logo
onboarding/Welcome slides (2 slides)Replace images
auth/Login, Register, Forgot Password screensCustomize text/colors
home/Main home screen — banners, categoriesReplace banners
category/Browse products by categoryLeave as is
product/Product list and detail pageLeave as is
all_products/Search and browse all productsLeave as is
cart/Shopping cart with quantity controlsLeave as is
wishlist/Saved and liked productsLeave as is
checkout/Address, delivery, payment, confirmationCustomize if needed
orders/Order history and live trackingLeave as is
hana_ai/AI chat assistantConfigure AI if needed
settings/Account, language, notifications, FAQCustomize if needed

How to Add a New Screen

Step 1: Create your screen in lib/pages/my_screen/my_screen_view.dart

Step 2: Add a route name in routes/routes.dart:

static const String myScreenView = '/my-screen';

Step 3: Connect it in routes/pages.dart:

_p(Routes.myScreenView, () => const MyScreenView()),

Step 4: Navigate to it from anywhere:

Get.toNamed(Routes.myScreenView);

Step 12: routes/ — Screen Navigation Map

Two files that connect screen names to actual screens:

Routes folder
🔍 Hover to zoom
FileWhat It DoesAction
routes.dartLists all screen names (e.g. '/home', '/cart')Add new route names here
pages.dartConnects each name to the actual screen widgetConnect new routes here

Step 13: navigator/ — Bottom Navigation Bar

The 5-tab bar at the bottom of the screen:

Navigator folder
🔍 Hover to zoom
TabWhat It OpensAction
HomeHome screenChange icon if needed
CategoryBrowse by categoryChange icon if needed
AIAI chat assistantChange icon if needed
CartShopping cartChange icon if needed
ProfileAccount and settingsChange icon if needed

:::


Step 14: theme/ — App Visual Style

One file — app.dart — controls the overall look: button shapes, card styles, input field styles, and font.

Theme folder
🔍 Hover to zoom
FileWhat It ControlsAction
app.dartButton shapes, card styles, input fields, fontLeave as is (reads from constants/ui.dart)

To change the theme, edit constants/ui.dart first. This file just reads those values.


Step 15: Android & iOS Settings

Android

Android folder details
🔍 Hover to zoom
Android folder overview
🔍 Hover to zoom
FileLineWhat to Change
android/app/src/main/AndroidManifest.xmlLine 8Change android:label="hana_go" to your app name
android/app/build.gradle.ktsLine 19Change applicationId to your package ID

iOS

iOS folder
🔍 Hover to zoom
FileLineWhat to Change
ios/Runner/Info.plistLine 10Change CFBundleDisplayName to your app name
ios/Runner/Info.plistLine 18Change CFBundleName to your app name

Automated Rename

Rename the app in one command instead of editing files manually.

1. Install package:

dart pub add change_project_name --dev

2. Create rename.json:

{
"project_name": "greencart",
"app_name": "GreenCart",
"android_package_name": "com.appstick.greencart",
"ios_bundle_identifier": "com.appstick.greencart",
"custom_replacements": {
"GreenCart": "greencart"
}
}

3. Run:

dart run change_project_name

4. Verify:

flutter analyze
tip

This changes app name, package name, and all import statements automatically.


Complete List: Files You Need to Change

Here is every file you should customize, in the order you should do it:

Branding (Do First)

#FileWhat to Change
1assets/icons/logo.pngReplace with your logo
2assets/images/Logo.pngReplace with your logo
3assets/images/login_page.logo.pngReplace with your logo
4assets/images/onboarding1.pngReplace with your onboarding image
5assets/images/onboarding2.pngReplace with your onboarding image
6assets/profile_image.pngReplace with default profile picture

Colors & Config (Do Second)

#FileWhat to Change
7lib/constants/ui.dartChange primaryColor and other brand colors
8lib/constants/app_config.dartChange appName, supportEmail, aiName, pricing rules
9lib/constants/images.dartUpdate paths if you rename image files

Text & Translations (Do Third)

#FileWhat to Change
10assets/translations/en_US.jsonChange all English text
11Other translation filesTranslate to your languages

Product Data (Do Fourth)

#FileWhat to Change
12assets/data/products.jsonReplace with your product data

Platform Settings (Do Last)

#FileWhat to Change
13android/app/src/main/AndroidManifest.xmlApp name on Android
14android/app/build.gradle.ktsAndroid package ID
15ios/Runner/Info.plistApp name on iPhone
16pubspec.yamlApp version, asset folders
#FileWhat to Change
17lib/navigator/bottom_nav_bar.dartTab icons, labels, order
18lib/routes/routes.dartAdd/remove screen routes
19lib/routes/pages.dartConnect new routes to screens

Quick Reference

:::tip What to Change vs. What to Leave Alone

Change TheseLeave These Alone
assets/icons/logo.pnglib/main.dart
assets/images/*.pnglib/services/
assets/data/products.jsonlib/models/
assets/translations/*.jsonlib/data/loaders/
lib/constants/ui.dartlib/data/repositories/
lib/constants/app_config.dartlib/domain/
lib/navigator/bottom_nav_bar.dartlib/utils/
android/ and ios/ settingslib/theme/app.dart
pubspec.yaml (version, assets)lib/routes/
:::

The Build Order

Here is the exact order I built this project, and the order you should follow when customizing:

1. Set up Flutter environment (see Installation guide)
2. Run the app as-is to see it work
3. Replace logos and images (Step 3: Assets)
4. Change colors (Step 6: Constants → ui.dart)
5. Update app config (Step 6: Constants → app_config.dart)
6. Edit translations (Step 3: Assets → translations/)
7. Replace product data (Step 8: Data)
8. Update Android/iOS settings (Step 15)
9. Update pubspec.yaml version (Step 2)
10. Test on a real device

After each change, run flutter run to see the result immediately.