Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate MonarchTheme on async getter #53

Open
KestasVenslauskas opened this issue Dec 7, 2022 · 2 comments
Open

Annotate MonarchTheme on async getter #53

KestasVenslauskas opened this issue Dec 7, 2022 · 2 comments
Labels
enhancement New feature or request preview Related to the Monarch Preview Window or monarch package

Comments

@KestasVenslauskas
Copy link

KestasVenslauskas commented Dec 7, 2022

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

@fertrig
Copy link
Collaborator

fertrig commented Dec 7, 2022

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
Copy link
Author

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

@fertrig fertrig added the preview Related to the Monarch Preview Window or monarch package label Dec 22, 2022
@fertrig fertrig changed the title Support theme async getter Annotate MonarchTheme on async getter Dec 22, 2022
@fertrig fertrig added the enhancement New feature or request label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preview Related to the Monarch Preview Window or monarch package
Projects
None yet
Development

No branches or pull requests

2 participants