Data Models
Data models are essential building blocks when you're working with structured data in your app. In Nowa, you can visually create and manage data models that represent real-world objects—like a task, a product, a user profile, or a log entry—and then use them across your app in variables, logic, and UI.
📌 Why You Need Data Models
Here are common scenarios where creating a model is necessary:
- To-do apps: Each task needs a structure like title, description, and status.
- E-commerce apps: A product has properties like name, price, and image.
- User management: A user might have a name, email, and role.
- Water tracker app: Each water log entry can have an amount and timestamp.
Creating models helps you avoid repeating data structures manually and makes your app more scalable and easier to maintain.
✨ How to Create a Data Model
-
Click on the ➕ next to the
libfolder in the Files panel. -
Choose "Create new object".
-
A popup will appear. Enter the model name (e.g.,
Task).At the bottom of the popup:
Path:shows where the Dart file will be created.Class:shows the Dart class name you’ll use in your logic and variables.
-
After confirming, the model will appear in the Files panel as a Dart file.
The file and class names are automatically adjusted:
- A model named
"task model"becomes:- Class name:
TaskModel(PascalCase) - File name:
task_model.dart(snake_case)
- Class name:
This follows Dart’s best practices.