Skip to content

Commit

Permalink
rename shortener service
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder committed Nov 23, 2021
1 parent 857ace4 commit 080a53f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/services/github_progress_service.dart
Expand Up @@ -10,15 +10,15 @@ import 'package:odin/model/github_json.dart';
import 'package:odin/services/locator.dart';
import 'package:odin/services/logger.dart';
import 'package:odin/services/random_service.dart';
import 'package:odin/services/shortner_service.dart';
import 'package:odin/services/shortener_service.dart';
// import 'package:http/http.dart' as http;
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';

typedef OnUploadProgressCallback = void Function(int sentBytes, int totalBytes);

class GithubService {
final ShortnerService _shortnerService = locator<ShortnerService>();
final ShortenerService _shortenerService = locator<ShortenerService>();
final RandomService _randomService = locator<RandomService>();
final _env = dotenv.env;

Expand Down
6 changes: 3 additions & 3 deletions lib/services/github_service.dart
Expand Up @@ -9,11 +9,11 @@ import 'package:odin/model/github_error.dart';
import 'package:odin/model/github_json.dart';
import 'package:odin/services/locator.dart';
import 'package:odin/services/random_service.dart';
import 'package:odin/services/shortner_service.dart';
import 'package:odin/services/shortener_service.dart';
import 'package:path/path.dart' as path;

class GithubService {
final ShortnerService _shortnerService = locator<ShortnerService>();
final ShortenerService _shortenerService = locator<ShortenerService>();
final RandomService _randomService = locator<RandomService>();
final _env = dotenv.env;

Expand All @@ -30,7 +30,7 @@ class GithubService {
body: GitHubJson.encode(createFile),
);

final _downloadLink = await _shortnerService.getShortUrl(
final _downloadLink = await _shortenerService.getShortUrl(
url: jsonDecode(response.body)["content"]["download_url"] ?? '');
return _downloadLink ?? '';
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/locator.dart
Expand Up @@ -3,7 +3,7 @@ import 'package:odin/services/file_service.dart';
import 'package:odin/services/github_service.dart';
import 'package:odin/services/preferences_service.dart';
import 'package:odin/services/random_service.dart';
import 'package:odin/services/shortner_service.dart';
import 'package:odin/services/shortener_service.dart';
import 'package:odin/services/toast_service.dart';
import 'package:odin/services/zip_service.dart';

Expand All @@ -15,7 +15,7 @@ Future<void> setupLocator() async {
Stopwatch stopwatch = Stopwatch()..start();
// locator.registerFactory<CurrentDataNotifier>(() => CurrentDataNotifier());
locator.registerLazySingleton<GithubService>(() => GithubService());
locator.registerLazySingleton<ShortnerService>(() => ShortnerService());
locator.registerLazySingleton<ShortenerService>(() => ShortenerService());
locator.registerLazySingleton<RandomService>(() => RandomService());
locator.registerLazySingleton<ZipService>(() => ZipService());
locator.registerLazySingleton<FileService>(() => FileService());
Expand Down
Expand Up @@ -3,7 +3,7 @@ import 'dart:io';
import 'package:dio/dio.dart';
import 'package:odin/services/logger.dart';

class ShortnerService {
class ShortenerService {
final _dio = Dio(BaseOptions(
baseUrl: 'https://api.shrtco.de/v2/',
));
Expand Down

0 comments on commit 080a53f

Please sign in to comment.