scrella_sdk 1.0.5
scrella_sdk: ^1.0.5 copied to clipboard
Flutter SDK for Scrella
๐ฑ Scrella Flutter SDK #
A powerful Flutter SDK for integrating with Scrella API and for running interactive device health diagnostics directly inside your app.
scrella_sdk enables developers to perform hardware validation tests such as:
- ๐ท Front & Back Camera Health Check
- ๐ Touch Sensitivity Test (Dead zone & multi-touch detection)
- ๐ฅ๏ธ Screen Physical Health Test (Dual-device assisted inspection)
Designed speficically for Scrella partners in the fintech, insurance, insur-tech, device financing, buy-back platforms, enterprise compliance, and device refurbishment solutions.
โจ Features #
- โ Camera hardware validation (front & rear)
- โ Touch responsiveness & screen grid testing
- โ Physical screen inspection workflow
- โ Interactive guided diagnostic UI
- โ Cross-platform support (Android & iOS)
- โ Developer-friendly integration with Scrella API for Claims, User Registration, Authentication , Plan Activations etc.
๐ Installation #
1๏ธโฃ Add Dependency #
Add scrella_sdk to your pubspec.yaml:
dependencies:
scrella_sdk: ^latest_version
After adding `scrella_sdk` to your `pubspec.yaml`, run:
```bash
flutter pub get
๐ Getting Started #
Follow the steps below to initialize the API client and integrate the Scrella health check flow into your Flutter app.
1๏ธโฃ Initialize the API Client #
Before using any Scrella SDK features, you must initialize the API client with your partner API key.
It is recommended to load your API key securely using environment variables.
Example using flutter_dotenv #
Add dependency:
dependencies:
flutter_dotenv: ^latest_version
Create a .env file in your project root:
Add your API key to the .env file:
PARTNER_API_KEY=your_partner_api_key_here
Initialize in main.dart:
void main() {
WidgetsFlutterBinding.ensureInitialized();
await dotenv.load(fileName: ".env");
await ScrellaApiClient.initialize(partnerApiKey: dotenv.env["PARTNER_API_KEY"]!);
runApp(MyApp());
}
โ ๏ธ Important: #
Initialize before calling runApp()
Add .env to .gitignore
Never hardcode your API key
๐งช Integrating the Health Check Flow #
To launch the eligibility and device diagnostic process, wrap EligibilityScreen with ScrellaProvider.
import 'package:flutter/material.dart';
import 'package:scrella_sdk/scrella_sdk.dart';
import 'package:example/screens/dashboard.dart';
class EligibilityTestScreen extends StatelessWidget {
const EligibilityTestScreen({
super.key,
required this.imeiUrl,
});
final String imeiUrl;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: ScrellaProvider(
imeiUrl: imeiUrl,
colors: ScrellaColors.defaults(),
child: EligibilityScreen(
onEligibilityCompleted: (bool isEligible) {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => const DashboardScreen(),
),
(route) => false,
);
},
),
),
),
);
}
}
๐จ Customization #
Use default theme:
colors: ScrellaColors.defaults()
Customize theme:
colors: ScrellaColors.defaults().copyWith(
primary: Colors.blue,
secondary: Colors.green
)
๐ Documentation & Links #
For full SDK documentation, detailed API references, advanced configuration, and integration workflows, visit the official documentation below:
- ๐ Scrella Flutter SDK Documentation
https://scrella-prod.s3.eu-central-1.amazonaws.com/assets/sdk/scrella_flutter_sdk_docs.html
For additional support:
- ๐ Open an issue on GitHub
- ๐ฉ Contact the Scrella team for partner access