-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Shokhjakhon Komiljonov edited this page Feb 15, 2024
·
6 revisions
To get started with fcnui
, follow these steps:
-
Install
fcnui
:- Install
fcnui
as a Dart global dependency by running the following command:
dart pub global activate fcnui
Note: You may need to restart the terminal or open a new one after installation.
- Install
-
Initialize your Flutter project:
- Navigate to your Flutter project directory.
- Run the following command to initialize fcnui:
fcnui init
This command creates a
fcnui.json
file, which is used to manage components, and prompts you to select the components library (default is/lib/components
). -
Add
fcnui_base
dependency:- Inside your Flutter project, add
fcnui_base
from pub.dev as a dependency. You can do this by running:
flutter pub add fcnui_base
- Inside your Flutter project, add
-
Wrap MaterialApp/CupertinoApp with ThemeProvider:
- Wrap your
MaterialApp
orCupertinoApp
withThemeProvider
and configure it accordingly:
ThemeProvider( builder: (context, vm) => MaterialApp( // Configure theme, dark theme, and theme mode as needed // theme: vm.theme, //Optional. Enables fcnui theme to affect whole application title: 'Your App Title', home: YourHomePage(), ), );
Optionally, you can use
fcnui
as your default theme. If not needed, simply wrap it. - Wrap your
-
Start adding components:
- Begin adding components to your project by running the following command:
fcnui add [component_name]
Replace
[component_name]
with the name of the component you want to add.
That's it! You're now ready to leverage the power of fcnui
in your projects. Happy coding!