sileo_flutter is a native Flutter port of sileo-vue (which was itself an improved fork of Sileo for React). This package reproduces all visual aesthetics, gooey animations, grouping behaviors, promise flows, swipe gestures, and lifecycle hooks as pure Dart/Flutter widgets without platform channels. Works seamlessly on Android, iOS, Web, Windows, macOS, and Linux.
Complete usage guides, API tables, styling techniques, and advanced behaviors are documented in the docs directory:
- Getting Started: Installation, basic stack mounting, and emitting your first notifications.
-
API Reference: Complete specifications of
sileomethods,SileoOptions,SileoButton,Toasterparameters, and lifecycle context payloads. -
Styling and Theming: Custom coloring,
coloredtheme mappings, custom layouts, and corners roundness. - Advanced Features: Details on the GPU-accelerated gooey metaball union, swipe-to-dismiss drag calculations, and persistent hover mechanics.
-
Mount the
Toaster: Add theToasterwidget at the root of your application (usually inside a top-levelStackunderMaterialApp):import 'package:flutter/material.dart'; import 'package:sileo_flutter/sileo_flutter.dart'; class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Stack( children: [ const MyMainPage(), const Toaster(position: SileoPosition.topRight), ], ), ), ); } }
-
Trigger Notifications: Call
sileomethods from anywhere in your codebase without passing a context:import 'package:sileo_flutter/sileo_flutter.dart'; void onSave() { sileo.success(const SileoOptions( title: 'Saved successfully', description: 'Your user profile details were written to the cloud.', )); }
-
Resolve Futures Inline: Manage asynchronous operation feedback easily with
promise:await sileo.promise<Profile>( () => apiService.fetchProfile(), SileoPromiseOptions( loading: const SileoOptions(title: 'Loading profile...'), success: (profile) => SileoOptions(title: 'Welcome back, ${profile.name}!'), error: (error) => SileoOptions(title: 'Failed to load profile', description: '$error'), ), );
Check out the example/ directory for a fully-featured, interactive playground application. It allows you to trigger all notification states, tweak themes and colors, toggle grouping options, test promise loading, and inspect swipe dismissal parameters in real-time.