h-1.flutter.4/lib/screens/sales_screen.dart

98 lines
3.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'),
),
),
),
],
),
),
],
),
);
}