h-1.flutter.4/lib/screens/sales_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

135 lines
No EOL
4.1 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 SalesScreen extends StatelessWidget {
const SalesScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('売上入力'),
actions: [
IconButton(
icon: const Icon(Icons.receipt_long),
onPressed: () => _showSaveDialog(context),
),
],
),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
// レジモードのメイン表示エリア
Card(
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// 合計金額表示
Text(
'合計¥0',
style: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
const SizedBox(height: 16),
// 税率/税額表示
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('税別¥0'),
Text('税込¥0', style: const TextStyle(fontWeight: FontWeight.bold)),
],
),
],
),
),
),
const SizedBox(height: 16),
// 商品入力エリア
TextField(
decoration: const InputDecoration(
labelText: '商品検索',
hintText: 'JAN コードまたは商品名を入力',
prefixIcon: Icon(Icons.search),
),
onChanged: (value) { /* TODO: 商品検索 */ },
),
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.orange.shade100,
child: Icon(Icons.store, color: Colors.orange),
),
title: Text('商品${index + 1}'),
subtitle: Text('数量0 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('売上保存しました')),
);
},
style: ElevatedButton.styleFrom(backgroundColor: Colors.green),
child: const Text('確定'),
),
],
),
);
}
void _showCustomerPicker(BuildContext context) {
// TODO: CustomerPickerModal を再利用して実装
}
}