todo-app/lib/ui/github_mirror_screen_widget.dart
Krzysztof kuhy Rudnicki 381afd1d77 Split the last three oversized lib/bin files
github_mirror_screen.dart  368 -> 232 + device_code_dialog.dart (109) and
                             a widget part
  wrapper_server.dart        336 -> 223 + wrapper_sync_routes.dart, the two
                             credential-provisioning routes
  bin/todo_desktop.dart      253 -> 199 + lib/desktop/browser_launcher.dart

The fixed port moved into browser_launcher.dart as kWrapperPort, with the
entry point aliasing it, so the "must not move" reason is stated once next
to the code that acts on it.

lib/ and bin/ are now entirely under the cap. The two remaining analyze
infos (bin/todo_desktop.dart cascade_invocations,
capture_screen_sync.dart unnecessary_unawaited) are pre-existing --
verified by analyzing e0eb8b9 in a worktree, which reports the same two.

Verified: 313 tests pass, coverage unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-14 16:29:35 +02:00

55 lines
2.0 KiB
Dart

/// The [GitHubMirrorScreen] widget's public surface.
///
/// A `part` rather than a separate library because `createState` returns a
/// private class, so the widget and its State cannot be split apart.
part of 'github_mirror_screen.dart';
/// The GitHub mirror screen: cutover-only sync transport, not a peer of
/// Firebase.
///
/// Kept app-local rather than folded into the shared `sync_settings_ui`
/// package because connecting here also triggers an actual note sync via
/// [runSync] -- unlike the shared package's Firebase/Backup sections, which
/// only save settings. See `lib/ui/settings_screen.dart` for the "Enable
/// advanced" toggle and the link to this screen and to the shared Sync
/// settings screen.
class GitHubMirrorScreen extends StatefulWidget {
/// Creates a [GitHubMirrorScreen] pre-filled with [initial] settings.
const GitHubMirrorScreen({
required this.initial,
required this.repository,
required this.appSettings,
this.analytics,
this.httpClient,
this.firebaseFactory,
this.stateStore,
super.key,
});
/// The sync settings loaded when this screen was opened.
final SyncSettings initial;
/// The store a post-connect sync reads from and writes to.
final NoteRepository repository;
/// App-wide preferences, reconciled after a post-connect sync.
final ValueNotifier<AppSettings> appSettings;
/// Interaction-only usage analytics. Null in tests that don't exercise it.
final AnalyticsService? analytics;
/// Optional HTTP client for the GitHub calls (test-connection and device
/// flow). Injected by tests; production uses each client's default.
final http.Client? httpClient;
/// Builds the Firebase backend for the post-connect sync. Injected so
/// tests can supply a fake.
final Future<FirebaseRestClient?> Function()? firebaseFactory;
/// Revision cache. Injected so tests need no application-support directory.
final SyncStateStore? stateStore;
@override
State<GitHubMirrorScreen> createState() => _GitHubMirrorScreenState();
}