mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 10:49:49 +08:00
feat: reorganize attachments provider and model structure
This commit is contained in:
@@ -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';
|
||||
|
||||
19
lib/dashbot/core/model/chat_attachment.dart
Normal file
19
lib/dashbot/core/model/chat_attachment.dart
Normal file
@@ -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,
|
||||
});
|
||||
}
|
||||
@@ -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<ChatAttachment> items;
|
||||
@@ -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<ChatState> {
|
||||
|
||||
Reference in New Issue
Block a user