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

PlatformLinux

Match your Flutter app to the user's KDE theme.

Match your Flutter app to the user's KDE or COSMIC theme for better Linux integration.

Features #

Creates a theme based on a handful of colors taken from the user's ~/.config/kdeglobals file.

If we're not on Linux or the file isn't there, DynamicYaru.getTheme() will simply return null.

For example, here are my Flutter apps Saber and NoMoreBackground responding to the ambient dark green theme:

Getting started #

Add dynamic_yaru to your app's dependencies:

flutter pub add dynamic_yaru

See the example for more detail, but now essentially all you need to do is:

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

  @override
  Widget build(BuildContext context) {
    DynamicYaru.refresh();
    final ThemeData? theme = DynamicYaru.getTheme();
    return MaterialApp(
      theme: theme,
      home: ...,
    );
  }
}

Besides this core functionality, the example also has code for caching the result and falling back to the regular Yaru theme builder in GNOME.


This package is intended to complement the yaru package but is not endorsed by or affiliated with Yaru/Ubuntu/Canonical.

0
likes
150
points
62
downloads

Documentation

API reference

Publisher

verified publisheradil.hanney.org

Weekly Downloads

Match your Flutter app to the user's KDE theme.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, ini, logging, yaru

More

Packages that depend on dynamic_yaru