Initial scaffold for the F∆I Platform Tier-2 generic GUI client. Flutter Desktop (macOS, Linux, Windows). Three MVP pages with mock data, sharing one navigation shell: - Modules — installed modules with capabilities, declared permissions and required services. - Audit — event-stream view with type filter and tone-coded rows (started / completed / failed). - Approvals — pending system.approval@^0 reviews with prompt, payload preview, and approve/reject buttons. Live gRPC connection arrives in the next iteration via fai_dart_sdk (sibling repo, currently a typed stub). Future Forgejo path: fai/studio. Local layout matches existing fai_platform/ convention. Background: see docs/architecture/client.md in the platform repo. The tier-2 client was previously called "Stage" — renamed to "Studio" on 2026-05-05 to avoid confusion with "staging environment". flutter analyze: clean. flutter test: 2/2. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
133 lines
4.2 KiB
Dart
133 lines
4.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../data/mock.dart';
|
|
|
|
class ModulesPage extends StatelessWidget {
|
|
const ModulesPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Installed Modules'),
|
|
centerTitle: false,
|
|
),
|
|
body: ListView.separated(
|
|
padding: const EdgeInsets.all(24),
|
|
itemCount: mockModules.length,
|
|
separatorBuilder: (_, _) => const SizedBox(height: 12),
|
|
itemBuilder: (context, i) {
|
|
final m = mockModules[i];
|
|
return Card(
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
side: BorderSide(color: theme.colorScheme.outlineVariant),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Text(
|
|
m.name,
|
|
style: theme.textTheme.titleMedium?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
const SizedBox(width: 8),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 8,
|
|
vertical: 2,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: theme.colorScheme.secondaryContainer,
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Text(
|
|
'v${m.version}',
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
color: theme.colorScheme.onSecondaryContainer,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 8),
|
|
_Row(label: 'Capabilities', items: m.capabilities),
|
|
if (m.permissions.isNotEmpty) ...[
|
|
const SizedBox(height: 6),
|
|
_Row(label: 'Permissions', items: m.permissions),
|
|
],
|
|
if (m.requiresServices.isNotEmpty) ...[
|
|
const SizedBox(height: 6),
|
|
_Row(
|
|
label: 'Requires services',
|
|
items: m.requiresServices,
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _Row extends StatelessWidget {
|
|
final String label;
|
|
final List<String> items;
|
|
|
|
const _Row({required this.label, required this.items});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
return Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SizedBox(
|
|
width: 140,
|
|
child: Text(
|
|
label,
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
color: theme.colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Wrap(
|
|
spacing: 6,
|
|
runSpacing: 6,
|
|
children: items
|
|
.map(
|
|
(s) => Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 8,
|
|
vertical: 3,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: theme.colorScheme.surfaceContainerHighest,
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Text(
|
|
s,
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
fontFamily: 'monospace',
|
|
),
|
|
),
|
|
),
|
|
)
|
|
.toList(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|