ejenix_flutter 0.1.0
ejenix_flutter: ^0.1.0 copied to clipboard
Official Ejenix Flutter SDK: LiveOps remote config, feature flags, signed server-driven UI, asset verification, and code-push status wrappers.
example/lib/main.dart
// Adopting the Ejenix Flutter SDK: initialize once, then read remote config
// and feature flags with fallbacks, and render a server-driven title.
import 'package:ejenix_flutter/ejenix_flutter.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// The SDK key is the only thing this needs. App version, build number,
// platform and a stable per-install id come from the device, so they cannot
// be set to a value that no release was published under.
//
// To verify the payload's signature, pass `signatureVerifier`. Use
// EjenixEd25519Verifier where you sign payloads yourself — see "Payload
// verification" in the README before configuring one.
await Ejenix.initialize(sdkKey: 'sdk_live_example');
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Ejenix Example',
home: Scaffold(
appBar: AppBar(
// Server-driven, with a compile-time fallback.
title: const LiveText('home.title', fallback: 'Welcome'),
),
body: Center(
child: FeatureFlagBuilder(
flagKey: 'new_checkout',
defaultValue: false,
builder: (context, enabled) =>
Text(enabled ? 'New checkout is ON' : 'Legacy checkout'),
),
),
),
);
}
}