redesign for settings page
This commit is contained in:
28
frontend/pweb/lib/pages/roles/widgets/actions.dart
Normal file
28
frontend/pweb/lib/pages/roles/widgets/actions.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class RolesActions extends StatelessWidget {
|
||||
final bool canCreate;
|
||||
final VoidCallback onCreateRole;
|
||||
final String createLabel;
|
||||
|
||||
const RolesActions({
|
||||
super.key,
|
||||
required this.canCreate,
|
||||
required this.onCreateRole,
|
||||
required this.createLabel,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!canCreate) return const SizedBox.shrink();
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: onCreateRole,
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(createLabel),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user