rivium_sync 0.1.0
rivium_sync: ^0.1.0 copied to clipboard
Realtime database plugin for Flutter - Firebase alternative with instant data synchronization across all connected devices
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:rivium_sync/rivium_sync.dart';
import 'screens/home_screen.dart';
import 'config.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize RiviumSync SDK
// Set debugMode: true only during development to see internal SDK logs
await RiviumSync.init(RiviumSyncConfig(
apiKey: AppConfig.apiKey,
offlineEnabled: true,
debugMode: true, // Set to true for debugging
));
runApp(const RiviumSyncExampleApp());
}
class RiviumSyncExampleApp extends StatelessWidget {
const RiviumSyncExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'RiviumSync Example',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF10B981), // Emerald green
brightness: Brightness.light,
),
useMaterial3: true,
appBarTheme: const AppBarTheme(
centerTitle: true,
elevation: 0,
),
cardTheme: CardThemeData(
elevation: 2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
darkTheme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF10B981),
brightness: Brightness.dark,
),
useMaterial3: true,
appBarTheme: const AppBarTheme(
centerTitle: true,
elevation: 0,
),
cardTheme: CardThemeData(
elevation: 2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
themeMode: ThemeMode.system,
home: const HomeScreen(),
);
}
}