selfprivacy.org.app/lib/ui/pages/server_details/header.dart
NaiJi 2ac8e4366b Linting!
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
2022-06-06 01:40:34 +03:00

59 lines
1.7 KiB
Dart

part of 'server_details_screen.dart';
class _Header extends StatelessWidget {
const _Header({
required this.providerState,
required this.tabController,
});
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,
),
),
const SizedBox(width: 10),
BrandText.h2('providers.server.card_title'.tr()),
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 4,
horizontal: 2,
),
child: PopupMenuButton<_PopupMenuItemType>(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
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()),
),
),
],
),
),
],
);
}
enum _PopupMenuItemType { setting }