layer-wizard/lib/main.dart
Philip Peterson e0cbf8ae20 Initial commit: Layer Wizard
A GUI installer wizard for permanent rpm-ostree package layers on
bootc/image-based systems. Walks through: welcome/current-version check,
package name entry with existence check, confirmation, then a streamed
rpm-ostree install via pkexec. On success, writes a pending-confirmation
marker and installs an autostart entry so the next login shows a
"did this update work?" screen with a one-click rollback (bootc rollback
--apply) if not.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-06 05:25:05 -08:00

45 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'confirmation_marker.dart';
import 'confirmation_page.dart';
import 'wizard_page.dart';
void main() {
runApp(const LayerWizardApp());
}
class LayerWizardApp extends StatelessWidget {
const LayerWizardApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Layer Wizard',
theme: ThemeData(colorSchemeSeed: Colors.teal, useMaterial3: true),
home: const _StartupRouter(),
);
}
}
/// Checks for a pending post-reboot confirmation before deciding which
/// screen to show first.
class _StartupRouter extends StatelessWidget {
const _StartupRouter();
@override
Widget build(BuildContext context) {
return FutureBuilder<PendingConfirmation?>(
future: ConfirmationMarker.read(),
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return const Scaffold(body: Center(child: CircularProgressIndicator()));
}
final pending = snapshot.data;
if (pending != null) {
return ConfirmationPage(pending: pending);
}
return const WizardHomePage();
},
);
}
}