Skip to content

TBD Stock #9840

@thebricecorporation

Description

@thebricecorporation

import 'package:flutter/material.dart';

void main() {
runApp(const ClinicInventoryApp());
}

class ClinicInventoryApp extends StatelessWidget {
const ClinicInventoryApp({Key? key}) : super(key: key);

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'ระบบสต็อกคลินิก',
theme: ThemeData(
primarySwatch: Colors.pink, // ใช้โทนสีชมพู/แดงให้เหมาะกับคลินิกความงาม
),
home: const InventoryScreen(),
);
}
}

class InventoryScreen extends StatefulWidget {
const InventoryScreen({Key? key}) : super(key: key);

@OverRide
State createState() => _InventoryScreenState();
}

class _InventoryScreenState extends State {
// จำลองข้อมูลสต็อกสินค้าเบื้องต้น
final List<Map<String, dynamic>> products = [
{"name": "Botox (Allergan) 100U", "stock": 15, "branch": "ขอนแก่น"},
{"name": "Filler (Juvederm) 1cc", "stock": 8, "branch": "อุดรธานี"},
{"name": "ครีมกันแดดคลินิก 50ml", "stock": 42, "branch": "สว่างแดนดิน"},
];

@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('จัดการสต็อกสินค้า'),
),
body: ListView.builder(
itemCount: products.length,
itemBuilder: (context, index) {
final product = products[index];
return Card(
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: ListTile(
leading: const Icon(Icons.medical_services, color: Colors.pink),
title: Text(
product["name"],
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text('สาขา: ${product["branch"]}'),
trailing: Text(
'คงเหลือ: ${product["stock"]}',
style: const TextStyle(fontSize: 16, color: Colors.blueAccent),
),
),
);
},
),
floatingActionButton: FloatingActionButton(
onPressed: () {
// ในอนาคตเราจะใส่คำสั่งเพิ่มสินค้าใหม่ตรงนี้ครับ
print("กดปุ่มเพิ่มสินค้า");
},
child: const Icon(Icons.add),
),
);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions