squiddy_flutter 0.9.0
squiddy_flutter: ^0.9.0 copied to clipboard
Remote configuration, offline cache and app gate from a Squiddy server for Flutter apps on Android, iOS and the web, through the Squiddy SDK itself.
example/example.md
Example #
Start the SDK once, when the app starts, and keep the instance; show the screen the gate asks for, and read the strings Squiddy localized:
import 'package:squiddy_flutter/squiddy_flutter.dart';
final squiddy = await Squiddy.initialize(const SquiddyOptions(
host: 'https://squiddy.example.com',
apiKey: String.fromEnvironment('SQUIDDY_API_KEY'), // flutter run --dart-define-from-file=…
appId: 'my-app',
appVersion: '2026.11.28', // YYYY.MM.DD
appMode: 'release',
));
StreamBuilder<AppGate>(
stream: squiddy.gate,
initialData: squiddy.gate.value,
builder: (context, snapshot) => switch (snapshot.requireData.kind) {
AppGateKind.none => const HomeScreen(),
AppGateKind.updateRequired => UpdateScreen(snapshot.requireData),
AppGateKind.maintenance => MaintenanceScreen(snapshot.requireData),
},
);
final title = squiddy.string('welcome_title', fallback: 'Welcome');
On Android and iOS, the push update hands the messages of firebase_messaging to the SDK:
if (!kIsWeb) {
await FirebaseMessaging.instance.subscribeToTopic(squiddy.pushTopic);
FirebaseMessaging.onMessage.listen(
(message) => squiddy.handlePush(message.data.map((key, value) => MapEntry(key, '$value'))),
);
}
On the web the app's web/index.html maps the SDK's npm package, at the plugin's version, in an import map:
<script type="importmap">
{ "imports": { "@squiddy-cloud/sdk": "./squiddy/squiddy.mjs" } }
</script>
A whole app, on Android, iOS and the web, with the state, the gate, a string, a language picker, the configuration and the push update, is the SDK's Flutter sample; the guide, https://docs.squiddy.cloud/sdk/flutter.html, has the installation, the initialization, the web and the push update step by step.
The app in this folder is the plugin's test app: the host of its integration tests, which run every case of the SDK's conformance kit through the plugin.