Added stub screens

Used as a placeholder,
whilst other screens are currently worked on.

NOTE: there is no finished specification for
Products and Shopping List Items
This commit is contained in:
Jakob Meier 2023-03-22 21:16:00 +01:00
parent ea2791fac7
commit f3ac4a502c
No known key found for this signature in database
GPG key ID: 66BDC7E6A01A6152
3 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:outbag_app/backend/room.dart';
class RoomCategoriesPage extends StatefulWidget {
final RoomInfo? info;
final Room? room;
const RoomCategoriesPage(this.room, this.info, {super.key});
@override
State<StatefulWidget> createState() => _RoomCategoriesPageState();
}
class _RoomCategoriesPageState extends State<RoomCategoriesPage> {
@override
Widget build(BuildContext context) {
return const Text('Categories');
}
}

View file

@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:outbag_app/backend/room.dart';
class RoomProductsPage extends StatefulWidget {
final RoomInfo? info;
final Room? room;
const RoomProductsPage(this.room, this.info, {super.key});
@override
State<StatefulWidget> createState() => _RoomProductsPageState();
}
class _RoomProductsPageState extends State<RoomProductsPage> {
@override
Widget build(BuildContext context) {
return const Text('Products');
}
}

View file

@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
import 'package:outbag_app/backend/room.dart';
class ShoppingListPage extends StatefulWidget {
final RoomInfo? info;
final Room? room;
const ShoppingListPage(this.room, this.info, {super.key});
@override
State<StatefulWidget> createState() => _ShoppingListPageState();
}
class _ShoppingListPageState extends State<ShoppingListPage> {
List<ShoppingListItem> list = [];
void loadData() async {
//bool foundData = false;
// TODO: 1. load data from disk (if available)
// NOTE: errors do not matter,
// hopefully the network request will succeed
try {
//List<ShoppingListItem> list = await ShoppingListItem.getAllFromDisk();
//setState(() {
// this.list = list;
//})
//foundData = true;
} catch (_) {}
// TODO: 2. load data from web
// NOTE: might want to close room
// or show snackbar if no data is available
}
@override
void initState() {
super.initState();
loadData();
}
@override
Widget build(BuildContext context) {
return ListView.builder(
itemBuilder: (ctx, index) {
final item = list[index];
return ListTile();
},
itemCount: list.length,
);
}
}