h-1.flutter.4/lib/screens/order_screen.dart
joe 8951016ad9 feat: 販売管理関連画面を追加
- 見積入力画面 (estimate_screen.dart)
- 請求書発行画面 (invoice_screen.dart)
- 発注入力画面 (order_screen.dart)
- 売上返品入力画面 (sales_return_screen.dart)
- 売上入力画面 (sales_screen.dart)

販売管理モジュールの実装完了です。
2026-03-06 21:06:40 +09:00

100 lines
No EOL
3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Version: 1.0.0
import 'package:flutter/material.dart';
/// 受注入力画面Material Design テンプレート)
class OrderScreen extends StatelessWidget {
const OrderScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('受注入力'),
actions: [
IconButton(
icon: const Icon(Icons.check),
onPressed: () => _showSaveDialog(context),
),
],
),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
// 得意先選択
TextField(
decoration: const InputDecoration(
labelText: '得意先',
hintText: '得意先マスタから選択',
prefixIcon: Icon(Icons.person_search),
),
readOnly: true,
onTap: () => _showCustomerPicker(context),
),
const SizedBox(height: 16),
// 商品追加リスト(簡易テンプレート)
Card(
margin: EdgeInsets.zero,
child: ExpansionTile(
title: const Text('受注商品'),
children: [
ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
itemCount: 0, // デモ用
itemBuilder: (context, index) => Card(
margin: const EdgeInsets.symmetric(vertical: 4),
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.teal.shade100,
child: Icon(Icons.shopping_cart, color: Colors.teal),
),
title: Text('商品${index + 1}'),
subtitle: Text('数量1 pcs / 単価¥0'),
),
),
),
],
),
),
],
),
);
}
void _showSaveDialog(BuildContext context) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('受注確定'),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('受注データを保存しますか?'),
],
),
),
actions: [
TextButton(
onPressed: () => Navigator.pop(ctx),
child: const Text('キャンセル'),
),
ElevatedButton(
onPressed: () {
Navigator.pop(ctx);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('受注保存しました')),
);
},
child: const Text('確定'),
),
],
),
);
}
void _showCustomerPicker(BuildContext context) {
// TODO: CustomerPickerModal を再利用して実装
}
}