Closed leavky closed 1 month ago
if dont't have fontFamily, the font look not good.
I want to change the gloal, and I can't change the font of the button.
Because there is a problem with the default Chinese font, so must specify the font family
Don't you see the custom font in the buttons? Did you add it to the pubspec? My side I can change the font correctly.
yes, i add font in pubsec, but the button font not change
but the material theme button font changed
Maybe I should create a new project to test
Can you try adding all the other font assets (regular, light, etc.) and specify the font weights like in the documentation?
It may be that the theme of another package does not take effect in my project, but I found a problem that I could not launch in Windows after using this package.
Can you share the error?
use flutter-shadcn-ui\example.
➜ flutter run
Connected devices:
Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.22631.3447]
Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.202
Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.80
[1]: Windows (windows)
[2]: Chrome (chrome)
[3]: Edge (edge)
Please choose one (or "q" to quit): 1
Launching lib\main.dart on Windows in debug mode...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: ���ҵ� ClangCL �����ɹ���(ƽ̨���� =��ClangCL��)����Ҫʹ�� ClangCL ���ɹ��߽������ɣ��밲װ ClangCL ���ɹ��ߡ����ߣ�������������ǰ Visual Studio ���ߣ���ʽ��ͨ��ѡ����Ŀ���˵����Ҽ������ý��������Ȼ��ѡ���ض��������Ŀ�ꡱ�� [C:\Users\flowray\Desktop\flutter-shadcn-ui\example\build\windows\x64\plugins\rive_common\rive_common_plugin.vcxproj]
Building Windows application... 5.8s
Error: Build process failed.
look because rive package
Please try with the latest commit on main, I removed rive because it caused many issue to a lot of people
Does this issue happen without shadcn too?
On Tue, May 14, 2024, 5:24 AM Alexandru Mariuti @.***> wrote:
Please try with the latest commit on main, I removed rive because it caused many issue to a lot of people
— Reply to this email directly, view it on GitHub https://github.com/nank1ro/flutter-shadcn-ui/issues/64#issuecomment-2109709769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASDJ6267IBT4AHTUYSYJCF3ZCHJ6BAVCNFSM6AAAAABHUOCFNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZG4YDSNZWHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Does this issue happen without shadcn too? … On Tue, May 14, 2024, 5:24 AM Alexandru Mariuti @.> wrote: Please try with the latest commit on main, I removed rive because it caused many issue to a lot of people — Reply to this email directly, view it on GitHub <#64 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASDJ6267IBT4AHTUYSYJCF3ZCHJ6BAVCNFSM6AAAAABHUOCFNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZG4YDSNZWHE . You are receiving this because you are subscribed to this thread.Message ID: @.>
Many people who have tried to add shadcn_ui as a package have encountered the error. Especially on Windows. there is some problem with the rive_common library. Since the feature it brought was quite small (supporting riv in the ShadImage component) I decided to remove the dependency. If one then wants a riv it integrates rive in the pubspec.
Thanks, i have solve this problem by https://github.com/rive-app/rive-flutter/issues/308, rive need install clang.
After test, In riverpod and go_router, the global setting font does not take effect. In this example, https://github.com/lucavenir/go_router_riverpod.
set ShadApp textTheme
Be aware that in the materialThemeBuilder you should copy the theme provided to you, not providing a new instance.
(context, theme) {
return theme.copyWith(primarySwatch: Colors.cyan)
}
I would try your font and let you know
but ShadButton text font is not right, My font can download in https://github.com/lxgw/LxgwWenKai
I guess it's not a matter of fonts
To me seems working fine.
To the pubpec.yaml
I added this:
fonts:
- family: LXGW
fonts:
- asset: fonts/LXGWWenKai-Bold.ttf
weight: 700
- asset: fonts/LXGWWenKai-Light.ttf
weight: 300
- asset: fonts/LXGWWenKai-Regular.ttf
My ShadApp
ShadApp(
debugShowCheckedModeBanner: false,
themeMode: themeMode,
routes: routes,
theme: ShadThemeData(
brightness: Brightness.light,
colorScheme: const ShadZincColorScheme.light(),
textTheme: ShadTextTheme(
colorScheme: const ShadZincColorScheme.light(),
family: 'LXGW',
),
),
home: const MainPage(),
)
Thanks, It's normal now, and I understand what's wrong, because i set darkTheme.
Thank you very much for developing this package~
In materialTheme, we can set fontFamily, but there not have fontFamily in ShadThemeData.