pharmacy_mobile/lib/pages/list_stocks.dart
2025-01-30 15:57:37 +08:00

47 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart';
import 'package:pharmacy_mobile/widgets/title_widget.dart';
class ListStocksPage extends StatefulWidget {
const ListStocksPage({super.key});
@override
_ListStocksPageState createState() => _ListStocksPageState();
}
class _ListStocksPageState extends State<ListStocksPage> {
List<DataRow> _createRows() {
return [
DataRow(cells: [DataCell(Text('#100')), DataCell(Text('Flutter Basics')), DataCell(Text('David John'))]),
DataRow(cells: [DataCell(Text('#101')), DataCell(Text('Dart Internals')), DataCell(Text('Alex Wick'))])
];
}
List<DataColumn> _createColumns() {
return [DataColumn(label: Text('ID')), DataColumn(label: Text('Book')), DataColumn(label: Text('Author'))];
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: PageBackgroundWidget(
child: Column(children: [
const Gap(120),
const TitleWidget(firstTextSize: 16, secondTextSize: 32),
const Gap(32),
const TextWidget(text: 'List of Stocks'),
const Gap(16),
DataTable(
decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 1.0),
borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(255, 240, 240, 240),
),
columns: _createColumns(),
rows: _createRows(),
)
])));
}
}