selfprivacy.org.app/lib/ui/pages/server_details/header.dart

59 lines
1.7 KiB
Dart
Raw Normal View History

part of 'server_details_screen.dart';
2021-04-10 03:04:23 +00:00
class _Header extends StatelessWidget {
const _Header({
required this.providerState,
required this.tabController,
});
2021-04-10 03:04:23 +00:00
final StateType providerState;
final TabController tabController;
@override
Widget build(final BuildContext context) => Row(
children: [
IconStatusMask(
status: providerState,
child: const Icon(
BrandIcons.server,
size: 40,
color: Colors.white,
),
2021-04-10 03:04:23 +00:00
),
const SizedBox(width: 10),
BrandText.h2('providers.server.card_title'.tr()),
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 4,
horizontal: 2,
2021-04-10 03:04:23 +00:00
),
child: PopupMenuButton<_PopupMenuItemType>(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
2021-04-10 03:04:23 +00:00
),
onSelected: (final _PopupMenuItemType result) {
switch (result) {
case _PopupMenuItemType.setting:
tabController.animateTo(1);
break;
}
},
icon: const Icon(Icons.more_vert),
itemBuilder: (final BuildContext context) => [
PopupMenuItem<_PopupMenuItemType>(
value: _PopupMenuItemType.setting,
child: Container(
padding: const EdgeInsets.only(left: 5),
child: Text('basis.settings'.tr()),
),
),
],
),
2021-04-10 03:04:23 +00:00
),
],
);
2021-04-10 03:04:23 +00:00
}
enum _PopupMenuItemType { setting }