-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Don't require a ShadApp #276
Comments
Did you set the theme mode to light? You can use |
@nank1ro I added the code snippet in the issue ticket. I set both obvious properties to "light" |
@nank1ro I adjusted the code to the following: return ShadApp.material(
title: 'Space Pod',
builder: (context, child) {
return MaterialApp(
home: child,
);
},
home: const MainScreen(),
debugShowCheckedModeBanner: false,
); That seems to unbreak my widget, but I'm still getting unexpected results from Shad widgets: Screen.Recording.2025-01-29.at.1.48.03.PM.mov |
PS - While my immediate problem is around correct configuration, I still think the root issue is that using just 1 widget requires making a modification that literally spans the entire app. |
There is surely a bug here because the two themes are not in sync. Material Theme behaviorBy default MaterialApp uses Opt-in (to dark mode)Add Opt-out (from dark mode)By default, because Shad Theme behaviorBy default ShadApp handles both the light and the dark mode, using the In fact the themes are not needed on Opt-in (to dark mode)By default, even if you don't specify a ShadThemeData(
colorScheme: const ShadSlateColorScheme.dark(),
brightness: Brightness.dark,
); Opt-out (from dark mode)To opt-out from dark mode the user has to specify Options
@matthew-carroll let me know which behavior do you prefer. |
Regarding the modifications needed to replace MaterialApp with ShadApp you can use: return ShadApp.custom(
themeMode: ThemeMode.light,
appBuilder: (context, theme) => MaterialApp(
theme: theme, // Default ThemeData created by ShadApp, you can rely on it or not
builder: (context, child) {
return ShadToaster(child: child!);
},
...
),
) In this way you have to change very few things and you can easily test ShadApp. |
Why do you need to use |
@MarkOSullivan94 Every implementation uses the low level The reason for this is because there is a lot of complexity hidden in an app implementation. If the user takes all this complexity on its own, if I add new components and put new widgets or new logic in The fact that you have But the typical usage I would expect from the user perspective is to stick to a single design system, and just use |
Made the dark theme behavior equal to material |
Steps to reproduce
I just added shadcn_ui to another one of my apps. I did so just to use a few widgets. But I can't use those widgets without changing my entire app widget.
I switched to ShadApp.material() but now, because my theming is light, a bunch of my text has turned white on a white background and I can't see it.
I tried to setting the ShadThemeData to a light brightness and a light color scheme, but the text is still white on white.
The fundamental issue here is that I couldn't just use a few widgets. I had to impact my entire application. This is frustrating even with a tiny app. I would be that this could be a deal killer for larger apps.
Specific Problem:
At the moment, I can't figure out how to truly get a light theme. I'm using the following code and still getting white text and light borders throughout my app:
Expected results
I can add a widget without changing my whole app.
Actual results
I have to impact my entire app to use a single widget.
shadcn_ui version
0.18.4
Platform
MacOS
Code sample
Code sample
[Paste your code here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[Paste your output here]
The text was updated successfully, but these errors were encountered: