The Wholesale Order App is a multilingual mobile and web application designed to streamline wholesale product ordering and inventory tracking. Built with Flutter, integrated with Firebase Firestore, and connected to an external API, the app empowers wholesale businesses to process orders quickly, manage customer data, and access real-time product availability.
It features a sleek, responsive UI with support for English and Myanmar languages, making it user-friendly for a diverse workforce. The system ensures that only in-stock items can be ordered, reducing errors and improving business efficiency.
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'cart_model.dart';
import 'product_list_page.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(
ChangeNotifierProvider(
create: (_) => CartModel(),
child: const MyApp(),
),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Cart App',
theme: ThemeData(primarySwatch: Colors.blue),
home: const ProductListPage(),
);
}
}
class ProductListPage extends StatefulWidget {
const ProductListPage({super.key});
@override
State<ProductListPage> createState() => _ProductListPageState();
}
class _ProductListPageState extends State<ProductListPage> {
// ...
Future<void> _fetchAllProducts() async {
// Fetch products from API, filter by stock, update state
}
void _filterProducts() {
// Filter products by search
}
void _addToCart(Map<String, dynamic> product) {
// Add product to cart
}
void _goToCart() {
// Navigate to cart page
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Product List')),
body: Column(
children: [
// Search bar, product grid, etc.
],
),
);
}
}
class CartPage extends StatelessWidget {
const CartPage({super.key});
void _confirmRemoveItem(BuildContext context, int index) {
// Confirm and remove item from cart
}
void _increaseQuantity(BuildContext context, int index) {
// Increase item quantity
}
void _decreaseQuantity(BuildContext context, int index) {
// Decrease item quantity or remove
}
void _saveOrderToFirestore(BuildContext context, String customerName) async {
// Save order to Firebase
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Cart")),
body: Column(
children: [
// Cart items, order button, etc.
],
),
);
}
}