63 lines
1.4 KiB
Dart
63 lines
1.4 KiB
Dart
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,
|
|
this.items,
|
|
});
|
|
|
|
final PayoutDestination selected;
|
|
final ValueChanged<PayoutDestination> onSelected;
|
|
final VoidCallback? onLogout;
|
|
|
|
final String? userName;
|
|
final String? avatarUrl;
|
|
final List<PayoutDestination>? items;
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final menuItems = items ??
|
|
<PayoutDestination>[
|
|
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: menuItems,
|
|
selected: selected,
|
|
onSelected: onSelected,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|