MCSI-1 refactor: extract 'server.jar'
This commit is contained in:
parent
ebd764ab58
commit
95bf2bc86e
3
lib/main/constants.dart
Normal file
3
lib/main/constants.dart
Normal file
@ -0,0 +1,3 @@
|
||||
abstract class Constants {
|
||||
static const serverFileName = 'server.jar';
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:minecraft_server_installer/main/constants.dart';
|
||||
import 'package:minecraft_server_installer/vanila/adapter/presentation/game_version_view_model.dart';
|
||||
import 'package:minecraft_server_installer/vanila/adapter/presentation/vanila_state.dart';
|
||||
import 'package:minecraft_server_installer/vanila/application/use_case/download_server_file_use_case.dart';
|
||||
import 'package:minecraft_server_installer/vanila/application/use_case/get_game_version_list_use_case.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class VanilaBloc extends Bloc<VanilaEvent, VanilaState> {
|
||||
final GetGameVersionListUseCase _getGameVersionListUseCase;
|
||||
@ -33,7 +35,7 @@ class VanilaBloc extends Bloc<VanilaEvent, VanilaState> {
|
||||
return;
|
||||
}
|
||||
|
||||
await _downloadServerFileUseCase(gameVersion.toEntity(), './server.jar');
|
||||
await _downloadServerFileUseCase(gameVersion.toEntity(), path.join('.', Constants.serverFileName));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ packages:
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
|
@ -37,6 +37,7 @@ dependencies:
|
||||
equatable: ^2.0.7
|
||||
flutter_bloc: ^9.1.1
|
||||
http: ^1.4.0
|
||||
path: ^1.9.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
x
Reference in New Issue
Block a user