Skip to content
The Chat Archive
Unspecified NVIDIA model (HelpSteer2)· nvidia NVIDIA HelpSteer2

recommend me a folder structure for using GetX pattern Flutter my current folder like…

  1. User

    recommend me a folder structure for using GetX pattern Flutter

    my current folder like this

    lib\app\modules{module_name}

    inside it there's bindings, controller, and view

    how can i make it scaleable and maintainable

  2. Assistant

    Sure, this is a common folder structure for organizing code in a GetX-based app, and it's actually quite good! One suggestion would be to create a new folder structure similar to this:

    lib\core\controllers

    lib\core\models

    lib\core\views

    lib\core\services

    lib\core\util

    Inside each of these folders, you could create your controller, model, view, service, and utility classes. For example, you could put a controller class inside lib\core\controllers, a model class inside lib\core\models, a view class inside lib\core\views, a service class inside lib\core\services, and a utility class inside lib\core\util. This should help you keep things organized and maintainable.

  3. User

    where do i put reuseable widget

  4. Assistant

    In Flutter, it's common to create a new folder called "widgets" under the "lib" folder to store reusable widgets. Here's an example of the folder structure for a project using the GetX pattern:

    • lib/
    • app/
    • modules/
    • {module_name}/
    • bindings/
    • controller/
    • view/
    • core/
    • controllers/
    • models/
    • views/
    • services/
    • util/
    • widgets/

    Inside the "widgets" folder, you can create as many subfolders as you need to organize your widgets. For example, you can create separate folders for common UI components like buttons, inputs, and navigation, or create a folder for each widget you plan to reuse throughout your app.

    Here's an example of what the "widgets" folder might look like:

    • widgets/
    • buttons/
    • RaisedButton.dart
    • OutlineButton.dart
    • inputs/
    • TextField.dart
    • TextInput.dart
    • navigation/
    • PageView.dart
    • Scaffold.dart
    • {widget_name}.dart

    In your app, you can import the relevant widget files and use them in your view classes as needed. For example, you might import the TextField.dart file from the "inputs" folder and use it in your view class to create a text input field.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.