Some checks are pending
Flutter CI / build (push) Waiting to run
Co-authored-by: aider (ollama_chat/7b) <aider@aider.chat>
35 lines
1.1 KiB
Dart
35 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'customer_provider.dart';
|
|
|
|
class CustomerListScreen extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final customerProvider = Provider.of<CustomerProvider>(context);
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text('顧客一覧'),
|
|
),
|
|
body: FutureBuilder<void>(
|
|
future: customerProvider.fetchCustomers(),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
return Center(child: CircularProgressIndicator());
|
|
} else {
|
|
return ListView.builder(
|
|
itemCount: customerProvider.customers.length,
|
|
itemBuilder: (context, index) {
|
|
final customer = customerProvider.customers[index];
|
|
return ListTile(
|
|
title: Text(customer.name),
|
|
subtitle: Text(customer.phone),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|