Files
TubeCards/lib/modules/deck/deck_page.dart
friebetill 80f218097d Initial commit
Add Space version 2.0.1
2022-03-28 14:56:00 +02:00

40 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'component/deck/deck_component.dart';
/// The screen that gives the user an overview of a specific deck.
class DeckPage extends StatelessWidget {
/// Creates the deck page which provides the user with information about the
/// deck with the given [deck].
DeckPage(this.args) : super(key: args.key);
/// The name of the route to the [DeckPage] screen.
static const String routeName = '/deck';
final DeckArguments args;
@override
Widget build(BuildContext context) => DeckComponent(args);
}
/// Bundles the arguments of [DeckPage] into one object.
///
/// This allows us to use multiple parameters on Named Routes.
/// See more about this here https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments.
class DeckArguments {
/// Returns an instance of [DeckArguments].
DeckArguments({
required this.deckId,
required this.hasCardUpsertPermission,
this.key,
});
/// The ID of the deck whose information is displayed on the screen.
final String deckId;
final bool hasCardUpsertPermission;
/// Controls how one widget replaces another widget in the tree.
final Key? key;
}