Skip to main content

Flutter Integration

The Azeoo SDK is built with Flutter. Use the initialize → connect flow, then access nutrition and training via AzeooSDK.

Basic Integration

Step 1: Initialize the SDK

import 'package:azeoo_sdk/azeoo_sdk.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();

await AzeooSDK.initialize(
'your-api-key',
AzeooSDKInitOptions(
config: AzeooConfig(locale: 'en', analyticsEnabled: true, offlineEnabled: true),
),
);
runApp(MyApp());
}

Step 2: Connect a user

When the user is logged in:

await AzeooSDK.connect('user123', 'auth-token');

Step 3: Use SDK features

// Embed full SDK content
AzeooSDKContent()

// Or use module APIs
AzeooSDK.nutrition.showMainScreen();
AzeooSDK.training.showMainScreen();
AzeooSDK.nutrition.showScanner();

Complete example

import 'package:flutter/material.dart';
import 'package:azeoo_sdk/azeoo_sdk.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AzeooSDK.initialize(
'your-api-key',
AzeooSDKInitOptions(
config: AzeooConfig(locale: 'en', analyticsEnabled: true, offlineEnabled: true),
),
);
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomeScreen(),
);
}
}

class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Azeoo SDK Demo')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => AzeooSDK.nutrition.showMainScreen(),
child: Text('Show Nutrition'),
),
ElevatedButton(
onPressed: () => AzeooSDK.training.showMainScreen(),
child: Text('Show Training'),
),
ElevatedButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (_) => Scaffold(
body: AzeooSDKContent(),
),
),
),
child: Text('Show SDK Content'),
),
],
),
),
);
}
}

Remember to call AzeooSDK.connect(userId, token) after the user logs in (e.g. from your auth screen).

Next steps