diff --git a/lib/dashbot/core/common/widgets/dashbot_action_buttons.dart b/lib/dashbot/core/common/widgets/dashbot_action_buttons.dart index 9c64d7de..12ddff56 100644 --- a/lib/dashbot/core/common/widgets/dashbot_action_buttons.dart +++ b/lib/dashbot/core/common/widgets/dashbot_action_buttons.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../features/chat/models/chat_models.dart'; import '../../../features/chat/viewmodel/chat_viewmodel.dart'; -import '../../../features/chat/providers/attachments_provider.dart'; +import '../../providers/attachments_provider.dart'; import 'package:file_selector/file_selector.dart'; import '../../services/openapi_import_service.dart'; import '../../../features/chat/view/widgets/openapi_operation_picker_dialog.dart'; diff --git a/lib/dashbot/core/model/chat_attachment.dart b/lib/dashbot/core/model/chat_attachment.dart new file mode 100644 index 00000000..4439f411 --- /dev/null +++ b/lib/dashbot/core/model/chat_attachment.dart @@ -0,0 +1,19 @@ +import 'package:flutter/services.dart'; + +class ChatAttachment { + final String id; + final String name; + final String mimeType; + final int sizeBytes; + final Uint8List data; + final DateTime createdAt; + + ChatAttachment({ + required this.id, + required this.name, + required this.mimeType, + required this.sizeBytes, + required this.data, + required this.createdAt, + }); +} diff --git a/lib/dashbot/features/chat/providers/attachments_provider.dart b/lib/dashbot/core/providers/attachments_provider.dart similarity index 74% rename from lib/dashbot/features/chat/providers/attachments_provider.dart rename to lib/dashbot/core/providers/attachments_provider.dart index 0ec276df..eeffc9e0 100644 --- a/lib/dashbot/features/chat/providers/attachments_provider.dart +++ b/lib/dashbot/core/providers/attachments_provider.dart @@ -1,25 +1,8 @@ -import 'dart:typed_data'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash/utils/file_utils.dart'; -class ChatAttachment { - final String id; - final String name; - final String mimeType; - final int sizeBytes; - final Uint8List data; - final DateTime createdAt; - - ChatAttachment({ - required this.id, - required this.name, - required this.mimeType, - required this.sizeBytes, - required this.data, - required this.createdAt, - }); -} +import '../model/chat_attachment.dart'; class AttachmentsState { final List items; diff --git a/lib/dashbot/features/chat/viewmodel/chat_viewmodel.dart b/lib/dashbot/features/chat/viewmodel/chat_viewmodel.dart index aa1a0656..e0cbb90b 100644 --- a/lib/dashbot/features/chat/viewmodel/chat_viewmodel.dart +++ b/lib/dashbot/features/chat/viewmodel/chat_viewmodel.dart @@ -5,6 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash/providers/providers.dart'; import 'package:apidash/models/models.dart'; import 'package:apidash/utils/file_utils.dart'; +import '../../../core/model/chat_attachment.dart'; import '../../../core/services/curl_import_service.dart'; import '../../../core/services/openapi_import_service.dart'; @@ -12,7 +13,6 @@ import '../../../core/utils/safe_parse_json_message.dart'; import '../../../core/constants/dashbot_prompts.dart' as dash; import '../models/chat_models.dart'; import '../repository/chat_remote_repository.dart'; -import '../providers/attachments_provider.dart'; import '../providers/service_providers.dart'; class ChatViewmodel extends StateNotifier {