StorePOS

Flutter retail store, ordering and POS app with automated stock, ledger and daily closing — setup and user guide

Version 1.0.0 · Dart SDK ^3.13 · Flutter 3.x

Four shopkeeping jobs run by themselves

This is not only a shop front. The bookkeeping that a shopkeeper normally does by hand is done in code:

Stated plainly so nobody is surprised: stock is not returned when an online order is cancelled (only deleting a counter bill restores it), the app sends no push notifications, and it takes no scheduled cloud backup.

1. What you received

PathWhat it is
lib/The complete Flutter source — no obfuscation, no compiled blobs.
lib/core/config/store_config.dartThe only file you must edit. Shop name, numbers, address, hours, delivery charge, sheet links.
firestore.rulesReady-made Firestore security rules for every collection the app uses.
apps_script/StorePOSInventorySync.gsThe stock write-back endpoint — paste it into Apps Script, fill four config values, and quantities follow your sales.
assets/data/sample_products.csv317-item sample catalogue showing the sheet format.
assets/images/products/Bundled product photography used by the sample catalogue.
test/466 automated tests. flutter test should end with “All tests passed!”.
android/ ios/ web/ …Platform folders, already renamed to storepos / com.storepos.app.

You will need your own Firebase project and, if you want cloud storage for orders, your own Google Sheet. Both have free tiers.

2. Run it in five minutes (no Firebase needed)

Preview mode exists so you can look at the whole product before wiring anything up. It opens the shop front and the owner panel with no login, no server and no internet, using the bundled sample catalogue and a handful of sample orders. Nothing is saved anywhere.

flutter pub get
flutter run --dart-define=preview-mode=true

In a browser instead:

flutter build web --release --no-web-resources-cdn --dart-define=preview-mode=true
In preview mode the two buttons that would write to a database — “Place order” and rating a delivery — answer with a short notice instead. That is by design, not a bug.

Running without the flag expects a real Firebase project; if you have not done section 6 yet, the app will fail at start-up. That is the intended behaviour of a production build.

3. Make it your shop's

3.1 The config file

Open lib/core/config/store_config.dart. Every field is commented in the file. The important ones:

FieldWhere it appears
storeName / storeNameLocalApp bar, splash, receipts, WhatsApp message text, admin summaries. The second one is the name in the customer's own script; leave it '' to hide.
storeKind / storeKindLocalThe small line under the name.
ownerPhone, ownerPhone2Call and WhatsApp buttons, store-info card, receipt footer.
paymentHolderThe name shown on the EasyPaisa / JazzCash line at checkout.
address, hours, storeLat, storeLngStore-info card. A pin of 0, 0 hides “Open in Maps”.
deliveryChargeCheckout total and the delivery strip under the header.
productsSheetCsvUrl, inventorySheetUrl, stockScriptUrlOptional Google Sheet links (section 4 and 7).

No shop name, phone number or address exists anywhere else in lib/ — change the file, rebuild, and receipts, messages and admin screens all follow.

3.2 Logo, icon and app name

  1. Replace assets/images/store_icon.png with your own square logo (512×512 looks sharp everywhere).
  2. For the launcher icon, drop a 1024×1024 PNG at assets/images/store_icon_master_1024.png and run dart run flutter_launcher_icons.
  3. Set the name under the icon: android:label in android/app/src/main/AndroidManifest.xml, and the name fields in web/manifest.json.
  4. Give your build its own identity: applicationId and namespace in android/app/build.gradle.kts, and the bundle identifier in Xcode for iOS.

4. Products: a Google Sheet, or the bundled file

4.1 With a sheet (recommended for a live shop)

Create one Google Sheet with five columns in this order and publish it as CSV (File → Share → Publish to the web → CSV). Put the resulting URL in productsSheetCsvUrl.

ColumnExampleNotes
ItemCooking Oil 1LExact name is used for photo matching. A pack size written in the name (1kg, 5L, 180ml, 20 کلو) is split off and shown separately.
Price600Plain number; Rs and thousands separators are tolerated.
Stock36 bottleFree text. The first number in it decides the low-stock flag: 3 or fewer shows “needs reorder”.
Statusin stockout of stock (or ختم) sells nothing and greys the card.
ImageemptyOptional direct image URL, used only when the app has no bundled photo for that item.

Row 1 is the header and is ignored. assets/data/sample_products.csv is a working example — open it and copy the shape. Its prices are placeholder numbers, not a price list.

The last catalogue you successfully loaded is cached on the phone, so the shop keeps displaying when the internet is down. Photos are inside the app and never depend on a third-party URL.

4.2 Without a sheet

Leave productsSheetCsvUrl empty and the app serves the bundled sample catalogue. That is fine for a demo; for a real shop either fill in a sheet or replace assets/data/sample_products.csv with your own list in the same five-column format.

4.3 Product photos

Bundled photos are matched to item names in lib/core/constants/product_photos.dart:

'Cooking Oil 1L': 'assets/images/products/10.jpg',

To add one: put the picture in assets/images/products/, add a line to that map with the exact Item name, and rebuild. The folder is already declared in pubspec.yaml. An item with no photo shows a clean neutral icon instead — never a wrong picture.

5. Categories

The sheet has no category column; the app derives one from the item name using keyword rules in lib/core/i18n/product_taxonomy.dart. Ten categories ship by default (grocery, tea & milk, drinks, biscuits & snacks, cleaning, personal care, electronics, stationery, cigarettes & pan, miscellaneous), each with its own icon and English / Urdu label.

To move an item into a different category, add its keyword to that category's word list. Order matters: personal care and electronics are checked before grocery, because words like “oil” and “cleaning” appear in both.

6. Firebase (accounts, orders, bills, ledgers)

Skip this section entirely if you only want the preview or a single-device shop. Everything below is free on the Firebase Blaze / Spark plans.

  1. Create a project at console.firebase.google.com.
  2. Add an Android app (and an iOS app if needed). Use the same application ID you set in section 3.2.
  3. Install the CLI once: dart pub global activate flutterfire_cli
  4. From the project folder run: flutterfire configure — it writes lib/firebase_options.dart and the platform config files.
  5. In the console enable Authentication → Sign-in method (email / password, phone, or Google — whichever you want customers to use).
  6. Create a Cloud Firestore database.
  7. Open Firestore Database → Rules, paste the contents of the included firestore.rules, and press Publish.
  8. Register one customer account in the app (any email you control). Then in the Firebase console open Authentication → Users, click that user and copy the UID.
  9. In Firestore, create a collection called admins and add a document whose document ID is that UID. Only then does the owner panel appear — there is no self-service way to become an admin.
The rules file is the only thing standing between your order data and the public internet. Publish it before you take real orders, and do not replace it with “allow read, write: if true” while testing.

Collections used: admins, orders, addresses, ratings, age_verifications, shop_bills, bill_payments. They are created automatically the first time the app writes to them.

android/app/google-services.json is a credential file. It is git-ignored in this project — keep it out of any public repository.

7. Writing stock back to the sheet (the automation switch)

Reading the catalogue from a sheet needs nothing from you. The automation that makes this app more than a shop front — quantities dropping as orders and counter bills come in — runs through one Google Apps Script web app standing in front of the sheet. The script is included: apps_script/StorePOSInventorySync.gs. Copy it into a new Apps Script project, fill the four values in its CONFIG block, deploy it as a web app, and paste the deployment URL into stockScriptUrl.

Deploy settings that are not optional: Execute as: Me and Who has access: Anyone. "Anyone" means the URL, not your customers' accounts — the app calls it as a plain POST.

The app sends a JSON body with Content-Type: text/plain (deliberate: it avoids the CORS preflight that Apps Script often fails) and expects a JSON reply of { "ok": true }. The included script answers all four:

ActionBody the app sendsWhen
updateItem{action, token, name, price, stock, status}Owner edits an item in the inventory screen.
addItem{action, token, name, price, stock}Owner adds a new item from the app.
restoreStock{action, items:[{name, quantity}]}A counter bill is deleted, so its quantities go back.
no action{items:[{name, quantity}]}A customer places an order, or a counter bill is saved or edited.

Item names are matched against the Item column, case and spacing ignored, and a unit tail such as "40 بوری" is preserved when the number changes.

updateItem and addItem carry the signed-in owner's Firebase ID token; the included script verifies it server-side and, if you list uids in an Admins tab, checks the caller is one of them. The order-time calls have no token — a customer checking out is not an owner — so keep the deployment URL private. Stock updates are best-effort by design: if the script is unreachable the order still goes through and the app never blocks on it.

8. Running the shop

8.1 Orders

An order moves through Processing → Confirmed → Delivered, or is cancelled. The owner panel opens on the live list with counts per status, today's total and a search box that accepts an order number, a phone number or an email. Changing a status is one tap on the order card. “Receipts pending” collects the deliveries whose receipt has not been sent yet.

8.2 Receipts

Each order can be sent to the customer as a formatted text receipt through WhatsApp or SMS, with the item lines, delivery charge and total.

8.3 Counter bills (POS)

For walk-in sales: open Shop bill, tap items to add them, adjust quantities, apply a discount, mark the payment as cash, and create the bill. The customer can be sent an itemised bill by SMS.

8.4 Credit ledger (khata)

Give a regular customer a credit line, record what they owe, and log part payments against it. Each ledger has a statement link that opens a pre-written SMS on the owner's phone, so a reminder is one tap away.

8.5 Inventory, reports and ratings

The inventory screen lists every item with its stock note and flags low stock; “needs reorder” filters to what has to be bought in, and a supplier list can be generated from it. Reports show today, last 7 days, this month and all-time figures, a daily bar chart, and the best-selling items. Ratings shows the average and each order's stars.

9. Building for Android, iOS and web

# one APK covering all densities — good for testing on a phone
flutter build apk --release

# Play Store upload
flutter build appbundle --release

# iPhone (macOS with Xcode required)
flutter build ios --release

# website build, served from build/web
flutter build web --release

Release signing reads android/key.properties when that file exists and falls back to debug signing when it does not, so a release build works on day one before you have created a keystore. For a Play Store upload, create your own keystore and add:

storeFile=../keystore.jks
storePassword=...
keyPassword=...
keyAlias=...

Never commit a keystore or its passwords.

10. Customising further

To changeEdit
Every label in both languageslib/core/i18n/strings.dart — one getter per label, en ? … : ….
Colours, radius, gradientslib/core/theme/app_theme.dart (navy and gold by default).
Category names and keywordslib/core/i18n/product_taxonomy.dart, icons in lib/core/constants/category_icons.dart.
Search synonymslib/core/i18n/search_terms.dart — romanised spellings that should find a local item name.
Receipt / message wordinglib/services/receipt_formatter.dart and lib/services/store_contact.dart.
Add a languageCopy the pattern in strings.dart; the layout already flips to right-to-left for Urdu.

After any change, run flutter analyze and flutter test — the suite covers receipts, order status notices, ratings, ledgers and the catalogue parser.

11. Troubleshooting

symptomcause and fix
App closes at start-up with a Firebase errorYou ran it without --dart-define=preview-mode=true and have not done section 6 yet.
Shop is emptySheet URL is wrong or not published as CSV. File → Share → Publish to the web → CSV, then paste that URL. Row 1 must be the header.
Prices show as Rs 0The price cell contains text the parser could not read. Keep it a plain number.
Owner panel shows “could not be reached”Rules not published, or your uid is not in the admins collection.
Order placed but nothing appears in the panelFirestore is offline on the phone, or the order went to a different project — check lib/firebase_options.dart.
Stock does not change in the sheetExpected: write-back needs the Apps Script in section 7. Without it the sheet is read-only.
Photos missing for new itemsAdd the file to assets/images/products/ and one line to product_photos.dart with the exact item name.
“Low stock” appears wronglyThe stock column's first number is what counts. Write “12 box”, not “a few”.

12. Support and licence

What support covers

What it does not cover

How to ask

Use the comments tab on the item page, or the marketplace messaging system. Please include: your Flutter version (flutter --version), the exact error text, what you expected, and whether you are running in preview mode. A screenshot or a short screen recording resolves most reports without a second round of questions.

Typical first reply: within two working days.

Licence

One licence covers one end product for one shop. The Extended licence is required when the app is used in something you charge for, or when an agency delivers it to a client. You may modify the source freely for your own licensed product. Redistribution or resale of the source itself is not permitted. Full terms: codecanyon.net/licenses.