Skip to content

Enable adding new AI model #1667

Closed
Manar-Elhabbal7 wants to merge 3 commits intofoss42:mainfrom
Manar-Elhabbal7:add-model
Closed

Enable adding new AI model #1667
Manar-Elhabbal7 wants to merge 3 commits intofoss42:mainfrom
Manar-Elhabbal7:add-model

Conversation

@Manar-Elhabbal7
Copy link
Copy Markdown
Contributor

PR Description

I've implemented the logic to add new model

Key Changes

Implemented the Add Model feature by returning a proper Model object from dialog_add_ai_model.dart and removing the related TODO comments .

  1. Enhanced AIModelSelectorDialog by adding an add button for adding new models

  2. Refactored the dialog to use local state management instead of FutureBuilder enabling instant UI updates when models are added

I also enhanced the Code Quality & Performance:

  1. Added const keywords to static widgets for improved performance.
  2. Implemented mounted checks after async calls to prevent rashes.

Files Edited

  1. lib/screens/common_widgets/ai/dialog_add_ai_model.dart
  2. lib/screens/common_widgets/ai/ai_model_selector_dialog.dart
  3. lib/screens/common_widgets/ai/ai.dart

demo video

add-newModel.webm

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases._

  • Yes
  • No, I tested it manually

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@Manar-Elhabbal7 Manar-Elhabbal7 marked this pull request as draft April 20, 2026 23:05
@Manar-Elhabbal7 Manar-Elhabbal7 deleted the add-model branch April 20, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat : Enable adding new AI model

1 participant