sileo 0.0.5 copy "sileo: ^0.0.5" to clipboard
sileo: ^0.0.5 copied to clipboard

An opinionated, physics-based toast component for Flutter

Sileo

An opinionated, physics-based toast notification for Flutter.

pub version MIT license

A Sileo toast morphing open from a pill into a gooey body

▶ Try the live web demo

Instead of stacking cards, Sileo shows a single liquid pill that springs in, morphs its width to fit its content, and grows a body out of itself, closer to a Dynamic Island than a toast stack. It's a Flutter port of the Sileo React library from Aaryan, with zero third-party dependencies.

Install #

flutter pub add sileo

Usage #

Mount one Toaster (via MaterialApp.builder), then call sileo.* from anywhere:

import 'package:sileo/sileo.dart';

MaterialApp(
  builder: (context, child) => Toaster(theme: SileoTheme.system, child: child),
  home: const HomePage(),
);

// ...anywhere:
sileo.success(const SileoOptions(title: 'Saved', description: 'Your changes are live.'));
sileo.error(const SileoOptions(title: 'Upload failed'));
sileo.warning(const SileoOptions(title: 'Low storage'));
sileo.info(const SileoOptions(title: 'Heads up'));
sileo.action(SileoOptions(
  title: 'Update available',
  button: SileoButton(title: 'Restart', onPressed: restart),
));

Drive a notification from a future — it shows loading, then morphs to the result:

sileo.future<User>(
  saveProfile(form),
  SileoFutureOptions(
    loading: const SileoOptions(title: 'Saving…'),
    success: (user) => SileoOptions(title: 'Saved', description: 'Welcome, ${user.name}.'),
    error:   (e)    => SileoOptions(title: 'Failed', description: '$e'),
  ),
);

Dismiss or clear:

final id = sileo.info(const SileoOptions(title: 'Working…', duration: Duration.zero)); // persists
sileo.dismiss(id);
sileo.clear();

By default every call drives one notification that morphs in place. Pass an explicit id to show several at once.

Customising #

  • Toaster: position, theme (light/dark/system), offset, default options.
  • SileoOptions: title, description, icon, fill, roundness, duration (omit for 6s, Duration.zero to persist), autopilot, button, styles.

See the API docs and example/ for a runnable demo of every feature.

License #

MIT.

3
likes
160
points
60
downloads
screenshot

Documentation

API reference

Publisher

verified publisherkhal.dev

Weekly Downloads

An opinionated, physics-based toast component for Flutter

Repository (GitHub)
View/report issues

Topics

#toast #notification #animation #snackbar #ui

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sileo