Skip to main content

sileo_toast 0.1.3 copy "sileo_toast: ^0.1.3" to clipboard
sileo_toast: ^0.1.3 copied to clipboard

Physics-based gooey toast for Flutter, a port of Sileo. Depends on the Flutter SDK only.

example/lib/main.dart

import 'package:material_ui/material_ui.dart';
import 'package:sileo_toast/sileo_toast.dart';

import 'package:sileo_toast_example/playground_page.dart';

void main() => runApp(const SileoExampleApp());

/// Light and dark follow the system.
class SileoExampleApp extends StatelessWidget {
  const SileoExampleApp({super.key});

  static const _seed = Color(0xFF3B5BDB);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'sileo_toast playground',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(colorSchemeSeed: _seed),
      darkTheme: ThemeData(colorSchemeSeed: _seed, brightness: Brightness.dark),
      // Above the Navigator, so toasts outlive route changes.
      builder: (context, child) {
        final theme = Theme.of(context);
        return SileoToaster(
          theme:
              theme.brightness == Brightness.dark
                  ? SileoThemeMode.dark
                  : SileoThemeMode.light,
          textStyle: theme.textTheme.bodyMedium,
          child: child!,
        );
      },
      home: const PlaygroundPage(),
    );
  }
}
7
likes
160
points
1.01k
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Physics-based gooey toast for Flutter, a port of Sileo. Depends on the Flutter SDK only.

Repository (GitHub)
View/report issues

Topics

#toast #animation #notification #snackbar #ui

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sileo_toast