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:
parent
ea2791fac7
commit
f3ac4a502c
3 changed files with 94 additions and 0 deletions
19
lib/screens/room/categories.dart
Normal file
19
lib/screens/room/categories.dart
Normal 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');
|
||||
}
|
||||
}
|
19
lib/screens/room/products.dart
Normal file
19
lib/screens/room/products.dart
Normal 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');
|
||||
}
|
||||
}
|
56
lib/screens/room/shopping_list.dart
Normal file
56
lib/screens/room/shopping_list.dart
Normal 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,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue