π€ΉββοΈ Installation
Flume for Flutter is distributed through pub.dev. To add flume as a dependency, run the following command:
bash
flutter pub add flume
Adding Flume to your appβ
All you need is a Flume
widget;
app.dart
return Flume(
theme: FlumeTheme.fallback(),
child: Ambiance(
child: Placeholder(),
),
);
As you might have noticed, we're also using the Ambiance
widget. This provides a fallback ambiance provider used for generating dynamic color schemes. Most UI components need an Ambiance
widget in the tree.
Using Flume with Materialβ
Use the included Material adapter to get sensible defaults when utilizing Material widgets. This is not required but recommended.
app.dart
return Flume(
theme: FlumeTheme.fallback(),
builder: (context, theme) {
return Ambiance(
child: MaterialApp(
title: 'Example',
theme: theme,
),
);
},
);
info
We're actively working to get rid of the MaterialApp
glue. This approach will be deprecated in the future in favor of FlumeApp
.