shernova_ui 2.3.1
shernova_ui: ^2.3.1 copied to clipboard
Optional UI components for Shernova phone verification.
shernova_ui #
Optional UI components for Shernova phone verification.
Requires the core shernova_core package. You do not need this package if you build your own verification screens with the headless API (Shernova.verify, Shernova.watch).
When to use #
| Use shernova_ui | Use headless shernova_core only |
|---|---|
| Prototypes and quick integration | Production apps with custom branding |
| Default trust screens out of the box | Full control over UX and layout |
| Built-in Android auto-return (1.0.9+) | Minimal dependencies |
Install #
dart pub add shernova_core:^2.0.0 shernova_ui:^2.0.0
# or during CLI setup:
dart run shernova_cli setup --with-ui
Usage #
import 'package:shernova_core/shernova_core.dart';
import 'package:shernova_ui/shernova_ui.dart';
await Shernova.init(ShernovaConfig(
appId: 'YOUR_APP_ID',
publishableKey: 'pk_live_...',
apiBaseUrl: 'https://api.shernova.com',
packageName: 'com.example.app',
sha256: 'YOUR_APP_SHA256',
));
final session = await verifyPhone(
context: context,
phoneNumber: '+201012345678',
);
afterVerified hook #
Run backend registration while a progress overlay stays visible:
final session = await verifyPhone(
context: context,
phoneNumber: '+201012345678',
afterVerified: (session) async {
final receipt = await Shernova.getReceipt(session.sessionId);
await myBackend.completeSignup(receipt: receipt);
},
);
Related #
shernova_core— required core SDKshernova_cli— project setup