fluo 0.1.0 copy "fluo: ^0.1.0" to clipboard
fluo: ^0.1.0 copied to clipboard

Flutter SDK for Fluo, an elegant and easy to set up user onboarding flow.

example/lib/main.dart

import 'package:example/connect_screen.dart';
import 'package:example/home_screen.dart';
import 'package:example/theme.dart';
import 'package:fluo/fluo.dart';
import 'package:fluo/l10n/fluo_localizations.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  static const String fluoApiKey = 'your-api-key';

  @override
  Widget build(BuildContext context) {
    return FutureProvider(
      initialData: null,
      create: (_) => Fluo.init(fluoApiKey),
      child: Consumer<Fluo?>(
        builder: (context, fluo, child) {
          if (fluo == null) {
            return const CircularProgressIndicator();
          }

          return MaterialApp(
            localizationsDelegates: FluoLocalizations.localizationsDelegates,
            supportedLocales: FluoLocalizations.supportedLocales,
            debugShowCheckedModeBanner: false,
            theme: ExampleAppTheme.defaultTheme(context),
            home: FutureBuilder(
              future: fluo.getAccessToken(forceRefresh: true),
              builder: (context, snapshot) {
                // Uncomment here to clear the session
                // fluo.clearSession();
                final accessToken = snapshot.data;
                if (accessToken == null) {
                  return const ConnectScreen();
                }
                return const HomeScreen();
              },
            ),
          );
        },
      ),
    );
  }
}

void main() {
  runApp(const ExampleApp());
}
1
likes
0
points
59
downloads

Publisher

verified publisherfluo.dev

Weekly Downloads

Flutter SDK for Fluo, an elegant and easy to set up user onboarding flow.

Homepage

License

unknown (license)

Dependencies

flutter, flutter_localizations, flutter_secure_storage, freezed_annotation, http, intl, json_annotation, pinput, provider, styled_text, webview_flutter

More

Packages that depend on fluo