Frontend first draft
This commit is contained in:
59
frontend/pweb/lib/widgets/sidebar/sidebar.dart
Normal file
59
frontend/pweb/lib/widgets/sidebar/sidebar.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/widgets/sidebar/destinations.dart';
|
||||
import 'package:pweb/widgets/sidebar/side_menu.dart';
|
||||
import 'package:pweb/widgets/sidebar/user.dart';
|
||||
|
||||
|
||||
class PayoutSidebar extends StatelessWidget {
|
||||
const PayoutSidebar({
|
||||
super.key,
|
||||
required this.selected,
|
||||
required this.onSelected,
|
||||
this.onLogout,
|
||||
this.userName,
|
||||
this.avatarUrl,
|
||||
});
|
||||
|
||||
final PayoutDestination selected;
|
||||
final ValueChanged<PayoutDestination> onSelected;
|
||||
final VoidCallback? onLogout;
|
||||
|
||||
final String? userName;
|
||||
final String? avatarUrl;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final items = [
|
||||
PayoutDestination.dashboard,
|
||||
PayoutDestination.recipients,
|
||||
PayoutDestination.methods,
|
||||
PayoutDestination.reports,
|
||||
];
|
||||
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
UserProfileCard(
|
||||
theme: theme,
|
||||
avatarUrl: avatarUrl,
|
||||
userName: userName,
|
||||
selected: selected,
|
||||
onSelected: onSelected
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
SideMenuColumn(
|
||||
theme: theme,
|
||||
avatarUrl: avatarUrl,
|
||||
userName: userName,
|
||||
items: items,
|
||||
selected: selected,
|
||||
onSelected: onSelected,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user