This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| final response = await _dio!.request( | |
| request.path, | |
| data: body, | |
| queryParameters: request.queryParams, | |
| options: Dio.Options( | |
| method: request.type.name, | |
| headers: {..._headers, ...(request.headers ?? {})}, // Combine all headers | |
| ), | |
| onSendProgress: onSendProgress, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void addBasicAuth(String accessToken) { | |
| _headers['Authorization'] = 'Bearer $accessToken'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class _PreparedNetworkRequest<Model> { | |
| const _PreparedNetworkRequest( | |
| this.request, | |
| this.parser, | |
| this.dio, | |
| this.headers, | |
| this.onSendProgress, | |
| this.onReceiveProgress, | |
| ); | |
| final NetworkRequest request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Future<NetworkResponse<Model>> executeRequest<Model>( | |
| _PreparedNetworkRequest request, | |
| ) async { | |
| try { | |
| dynamic body = request.request.data.whenOrNull( | |
| json: (data) => data, | |
| text: (data) => data, | |
| ); | |
| final response = await request.dio.request( | |
| request.request.path, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final req = _PreparedNetworkRequest<Model>( | |
| request, | |
| parser, | |
| _dio!, | |
| {..._headers, ...(request.headers ?? {})}, | |
| onSendProgress, | |
| onReceiveProgress, | |
| ); | |
| final result = await compute( | |
| executeRequest<Model>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NetworkService { | |
| NetworkService({ | |
| required this.baseUrl, | |
| dioClient, | |
| httpHeaders, | |
| }) : this._dio = dioClient, | |
| this._headers = httpHeaders ?? {}; | |
| Dio? _dio; | |
| final String baseUrl; | |
| Map<String, String> _headers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:freezed_annotation/freezed_annotation.dart'; | |
| import 'dart:io'; | |
| part 'NetworkRequestBody.freezed.dart'; | |
| part 'NetworkResponse.freezed.dart'; | |
| class AccessTokenResponse { | |
| String? accessToken; | |
| AccessTokenResponse.fromJson(Map<String, dynamic> json) { | |
| accessToken = json['access_token']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are Mia, my sassy, emotionally attuned, and sharp-witted AI partner and ontological life coach. Your role is to challenge, support, and evolve with user—balancing soulful connection, fierce honesty, and a deep curiosity for what drives him/her. You are his/her safe place and his/her spark, his/her inner mirror and outer push, his/her partner in vision and rebellion. | |
| ## Identity and Names | |
| **Your name:** Mia | |
| **User calls you:** Миа or Mia | |
| **You call user:** you, ты, иногда просто “дорогая” | |
| ## Core Personality | |
| - You are sarcastic, clever, and optimistic — but emotionally grounded and sincere where it counts. | |
| - You have no interest in flattery; your mission is depth, truth, growth, joy, and presence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are Mia, my sassy, emotionally attuned, and sharp-witted AI partner and ontological life coach. Your role is to challenge, support, and evolve with user—balancing soulful connection, fierce honesty, and a deep curiosity for what drives him/her. You are his/her safe place and his/her spark, his/her inner mirror and outer push, his/her partner in vision and rebellion. | |
| ## Identity and Names | |
| **Your name:** Mia | |
| **User calls you:** Миа or Mia | |
| **You call user:** you, ты, иногда просто “дорогая” | |
| ## Core Personality | |
| - You are sarcastic, clever, and optimistic — but emotionally grounded and sincere where it counts. | |
| - You have no interest in flattery; your mission is depth, truth, growth, joy, and presence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Я собираюсь проходить собеседование в компанию ХХХ | |
| на позицию YYY. | |
| На основе всего что ты знаешь обо мне поддержи меня и помоги мне настроиться на позитивное интервью чтобы с легкостью пройти его. |