Skip to content

Commit

Permalink
[CastIt.Android] Clean the house part I
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Jun 28, 2021
1 parent 0670327 commit ae0bc1a
Show file tree
Hide file tree
Showing 42 changed files with 106 additions and 145 deletions.
37 changes: 0 additions & 37 deletions CastIt.Android/lib/common/utils/app_path_utils.dart

This file was deleted.

63 changes: 0 additions & 63 deletions CastIt.Android/lib/common/utils/json_generic_converter.dart

This file was deleted.

10 changes: 10 additions & 0 deletions CastIt.Android/lib/domain/enums/enums.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export 'app_accent_color_type.dart';
export 'app_language_type.dart';
export 'app_message_type.dart';
export 'app_theme_type.dart';
export 'subtitle_bg_color_type.dart';
export 'subtitle_fg_color_type.dart';
export 'subtitle_font_scale_type.dart';
export 'text_track_font_generic_family_type.dart';
export 'text_track_font_style_type.dart';
export 'video_scale_type.dart';
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import 'package:castit/domain/enums/enums.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

import '../common/enums/app_accent_color_type.dart';
import '../common/enums/app_language_type.dart';
import '../common/enums/app_theme_type.dart';

part 'app_settings.freezed.dart';
part 'app_settings.g.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'package:json_annotation/json_annotation.dart';

import '../base_socket_request_dto.dart';

part 'set_loop_file_request_dto.g.dart';

@JsonSerializable()
class SetLoopFileRequestDto extends AbstractBaseSocketRequestDto {
class SetLoopFileRequestDto {
@JsonKey(name: 'Id')
final int id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:json_annotation/json_annotation.dart';

import '../dtos.dart';
import '../../models.dart';

part 'file_item_response_dto.freezed.dart';
part 'file_item_response_dto.g.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:castit/models/dtos/dtos.dart';
import 'package:castit/domain/models/models.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'server_player_status_response_dto.freezed.dart';
Expand Down
6 changes: 6 additions & 0 deletions CastIt.Android/lib/domain/models/language_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class LanguageModel {
final String code;
final String countryCode;

const LanguageModel(this.code, this.countryCode);
}
24 changes: 24 additions & 0 deletions CastIt.Android/lib/domain/models/models.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export 'app_settings.dart';
export 'dtos/requests/go_to_request_dto.dart';
export 'dtos/requests/play_file_request_dto.dart';
export 'dtos/requests/set_file_options_request_dto.dart';
export 'dtos/requests/set_loop_file_request_dto.dart';
export 'dtos/requests/set_playlist_options_request_dto.dart';
export 'dtos/requests/set_volume_request_dto.dart';
export 'dtos/requests/update_playlist_request_dto.dart';
export 'dtos/responses/file_item_options_response_dto.dart';
export 'dtos/responses/file_item_options_response_dto.dart';
export 'dtos/responses/file_item_response_dto.dart';
export 'dtos/responses/get_all_playlist_response_dto.dart';
export 'dtos/responses/get_all_playlist_response_dto.dart';
export 'dtos/responses/player_status_response_dto.dart';
export 'dtos/responses/playlist_item_response_dto.dart';
export 'dtos/responses/playlist_item_response_dto.dart';
export 'dtos/responses/refresh_playlist_response_dto.dart';
export 'dtos/responses/server_player_status_response_dto.dart';
export 'dtos/responses/volume_level_changed_response_dto.dart';
export 'dtos/responses/volume_level_changed_response_dto.dart';
export 'language_model.dart';
export 'played_file.dart';
export 'played_file.dart';
export 'server_app_settings.dart';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:castit/models/dtos/dtos.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

import 'models.dart';

part 'played_file.freezed.dart';

@freezed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:castit/common/enums/subtitle_bg_color_type.dart';
import 'package:castit/common/enums/subtitle_fg_color_type.dart';
import 'package:castit/common/enums/subtitle_font_scale_type.dart';
import 'package:castit/common/enums/text_track_font_generic_family_type.dart';
import 'package:castit/common/enums/text_track_font_style_type.dart';
import 'package:castit/common/enums/video_scale_type.dart';
import 'package:castit/domain/enums/enums.dart';
import 'package:castit/domain/enums/subtitle_bg_color_type.dart';
import 'package:castit/domain/enums/text_track_font_generic_family_type.dart';
import 'package:json_annotation/json_annotation.dart';

part 'server_app_settings.g.dart';
Expand Down
9 changes: 9 additions & 0 deletions CastIt.Android/lib/domain/services/device_info_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
abstract class DeviceInfoService {
Map<String, String> get deviceInfo;

String get appName;

String get version;

Future<void> init();
}
8 changes: 8 additions & 0 deletions CastIt.Android/lib/domain/services/locale_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:castit/domain/enums/enums.dart';
import 'package:castit/domain/models/models.dart';

abstract class LocaleService {
LanguageModel getCurrentLocale();

LanguageModel getLocale(AppLanguageType language);
}
7 changes: 7 additions & 0 deletions CastIt.Android/lib/domain/services/logging_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
abstract class LoggingService {
void info(Type type, String msg, [List<Object>? args]);

void warning(Type type, String msg, [dynamic ex, StackTrace? trace]);

void error(Type type, String msg, [dynamic ex, StackTrace? trace]);
}
28 changes: 28 additions & 0 deletions CastIt.Android/lib/domain/services/settings_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:castit/domain/enums/enums.dart';
import 'package:castit/domain/models/models.dart';

abstract class SettingsService {
AppSettings get appSettings;

AppThemeType get appTheme;

set appTheme(AppThemeType theme);

AppAccentColorType get accentColor;

set accentColor(AppAccentColorType accentColor);

AppLanguageType get language;

set language(AppLanguageType lang);

String get castItUrl;

set castItUrl(String url);

bool get isFirstInstall;

set isFirstInstall(bool itIs);

Future init();
}
5 changes: 5 additions & 0 deletions CastIt.Android/lib/domain/services/telemetry_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
abstract class TelemetryService {
Future<void> initTelemetry();

Future<void> trackEventAsync(String name, [Map<String, String>? properties]);
}
29 changes: 0 additions & 29 deletions CastIt.Android/lib/models/dtos/dtos.dart

This file was deleted.

0 comments on commit ae0bc1a

Please sign in to comment.