细节文档:平台适配、启动链与桌面图标。
Clone only needs the full URL the user provides. The GitPlatform enum is for
display and for turning "username/repo" into a URL; business code must never call
platform REST APIs. The old RepositoryAdapter / adapter factory / four platform
adapters were deleted in 2026-10. Adding a platform means adding an enum value and a
guessPlatform case — do not reintroduce an HTTP abstraction layer.
Authentication: tokens, if ever added, stay on device only — never hardcode them or log them. Only public repositories are supported (the user explicitly does not want private-repo support).
The native splash paints only the brand paper color (launch_background plus v31
windowSplashScreenBackground; windowSplashScreenAnimatedIcon points at a
transparent placeholder). It must not draw a logo. The only startup logo is
Flutter's BrandSplash (lib/src/ui/brand_splash.dart), shared by main()'s
bootstrap page and HomePage's first repo-list load so sizes/positions match and the
user sees a single splash.
Hard constraints:
main()must callrunAppimmediately. libgit2/CA initialization (Android and iOS) happens in_bootstrap()after the first frame; doing it beforerunAppshows a black surface for hundreds of ms to seconds.- All five
activity-aliasentries must useandroid:theme="@style/LaunchTheme"; otherwise a release build (launched from an alias) shows black in dark mode. NormalThememust also use@drawable/launch_backgroundaswindowBackground; Flutter switches to it inonCreate.- Never use
?android:colorBackgroundfor the splash background — it turns black in dark mode. - The home loading state must not use a
CircularProgressIndicator; it would overlap the splash tail and look like a green dot in the middle of the screen. UseBrandSplashinstead. - The launch/normal themes set the status bar and navigation bar to
@color/brand_paperwithwindowLightStatusBar=true. Without this, Android adds a gray scrim behind light status-bar icons, which looks like a flash during startup.
- Desktop icon is selectable in settings (five designs: open book, page-as-arrow,
pull-page arrow, converge-pages arrow, page-stack arrow; pine green on paper
white). Android implements this with five
activity-aliasentries (MainActivityBook/Page/Arrow/Converge/Tray); exactly one is enabled at a time and switching goes throughPackageManager.setComponentEnabledSettingover theapp_iconMethodChannel. Adaptive icon foregrounds aredrawable-xxxhdpi/ic_launcher_fg_*.png(the mark is normalized to 50% of 432px; XML inset must be 0% — ~66% fills the canvas with no padding, ~33% with a 16% inset occupies only about 1/9), with@color/brand_paperbackground and the same paper color for the splash. - iOS/Windows icon switching is not implemented (the iOS alternate-icon API needs
real-device verification; Windows has no such concept). On platforms without the
channel,
setAppIconpersists the preference and silently does nothing. - In-app logo: transparent
assets/icon/app_logo.pngis used in the home header and the settings "about" page (a full setapp_logo_<key>.pngcovers all five marks). Never use a white-background version in-app (it looks wrong in dark mode). Larger marks are generated losslessly from the SVG sources indesign/icons/(all three sets: appicon / adaptive foreground / transparent in-app logo, see its README) with the logo-design skill renderer. assets/icon/app_icon.pngandapp_icon_foreground.png(book, 1024px) are theflutter_launcher_iconssources for the iOS AppIcon set and Windowsicon.ico. Setandroid: falsein pubspec before running the tool and restore it afterwards: the tool overwrites the hand-maintainedmipmap-anydpi-v26/ic_launcher.xml(0% inset + foreground) and related default launcher resources. The five alias-specific mipmap/fg files have distinct names and are not touched.assets/icons/holds five opaque desktop icon PNGs (settings preview + launcher mipmap source). Never replace them with transparent versions — Android launcher icons must not be transparent.
INTERNETmust be declared inandroid/app/src/main/AndroidManifest.xml. The Flutter template only adds it to debug/profile; a release build then fails all HTTPS requests withGIT_ERROR_NET: No address associated with hostname.- The release launcher entry lives on
activity-aliaswidgets (five icon variants). Flutter tooling only recognizesMAIN/LAUNCHERon<activity>, soandroid/app/src/debug/AndroidManifest.xmlandandroid/app/src/profile/AndroidManifest.xmloverride the manifest: they attach the launcher intent-filter toMainActivityand remove the five aliases. Release builds do not read those directories, which means icon switching can only be verified on a release build. Do not touch those two manifests while working on icons.