Dropsource / monarch

Monarch is a tool for building Flutter widgets in isolation. It makes it easy to build, test and debug complex UIs.
https://monarchapp.io
MIT License
433 stars 22 forks source link

Annotate `MonarchTheme` on async getter #53

Open KestasVenslauskas opened 1 year ago

KestasVenslauskas commented 1 year ago

This feature would help some initialization when using additional tools to generate theme.

fertrig commented 1 year ago

Would something like this work for you?

import 'package:monarch_annotations/monarch_annotations.dart';

@AsyncMonarchTheme('Fancy Light Theme')
Future<ThemeData> get fancyLightTheme async {
  var theme = await someFutureThatReturnsThemeData();
  return theme;
}
KestasVenslauskas commented 1 year ago

@fertrig Yes, that would help, because sometimes we have to init theme with other tools that has to be initialised beforehand.