mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 21:27:14 +01:00
Five apps had copied google_sign_in_backend.dart; home_inventory's copy was byte-identical to todo's. lyricanki was about to become the sixth, which is the mistake this package exists to prevent. So the plugin call moves here. Desktop is the new half. google_sign_in ships android, ios and web implementations only -- there is no google_sign_in_linux -- so lyricanki's real GTK build could never have used the plugin, and "one tap" would have meant "one tap on the phone, type a password on the PC". The OAuth loopback flow covers it: bind a socket, open the system browser, catch the redirect, exchange the code with PKCE. Both halves return a Google ID token of the same shape, so signInWithGoogle cannot tell them apart. googleSignInSupported takes the client id rather than reading a const. In todo the emptiness check was a second conjunct at the call site, and moving the fetcher here without it would have let a forgetful app ship a button that always reports "cancelled" -- todo's own file documents that failure. Taking the value as an argument makes the check impossible to drop. The decision (which flow, or none) is pure and covered; the two one-line delegations that reach a platform channel and a real browser are the only suppressions. 83 tests, 100% coverage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFSGeWxHPY5rHUGrPqhcmG
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: crdt_sync_flutter
|
|
description: >-
|
|
The Flutter half of crdt_sync: keystore-backed Firebase credentials, a
|
|
persisted per-install device id, and a one-call bootstrap. Removes the
|
|
~150 lines of firebase_backend.dart every consuming app was copying.
|
|
publish_to: 'none'
|
|
version: 0.2.0
|
|
|
|
environment:
|
|
sdk: ^3.12.2
|
|
|
|
dependencies:
|
|
crdt_sync:
|
|
git:
|
|
url: https://github.com/kuhyx/utils
|
|
ref: crdt_sync_dart-v0.11.0
|
|
path: crdt_sync_dart
|
|
crypto: ^3.0.6
|
|
flutter:
|
|
sdk: flutter
|
|
flutter_secure_storage: ^10.3.1
|
|
# A real dependency, not a dev one: lib/testing/ ships the keystore fake so
|
|
# consuming apps can test their own sync wiring without rebuilding it.
|
|
flutter_test:
|
|
sdk: flutter
|
|
# The one-tap Google plugin. Android/iOS/web only -- there is no Linux
|
|
# implementation -- so desktop reaches Google through the loopback flow in
|
|
# google_desktop_sign_in.dart instead. See google_platform.dart.
|
|
google_sign_in: ^7.2.0
|
|
http: ^1.6.0
|
|
shared_preferences: ^2.5.3
|
|
# Opens the system browser for the desktop loopback sign-in.
|
|
url_launcher: ^6.3.1
|
|
uuid: ^4.5.1
|
|
|
|
dev_dependencies:
|
|
very_good_analysis: ^10.2.0
|