mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Project lint checked and step added to config.yml
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class AppDio {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
import '../model/Currency.dart';
|
||||
import '../model/currency.dart';
|
||||
import 'app_dio.dart';
|
||||
|
||||
part 'backupCurrencyApi.g.dart';
|
||||
part 'backup_currency_api.g.dart';
|
||||
|
||||
@RestApi(baseUrl: "https://api.frankfurter.app/")
|
||||
abstract class BackupCurrencyApi {
|
||||
@@ -1,15 +1,16 @@
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:easy_cc_flutter/data/network/app_dio.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
import '../model/Currency.dart';
|
||||
import '../model/currency.dart';
|
||||
|
||||
part 'currencyApi.g.dart';
|
||||
part 'currency_api.g.dart';
|
||||
|
||||
@RestApi(baseUrl: "https://free.currencyconverterapi.com/api/v3/")
|
||||
abstract class CurrencyApi {
|
||||
factory CurrencyApi(Dio dio) = _CurrencyApi;
|
||||
factory CurrencyApi(Dio dio, {String baseUrl}) = _CurrencyApi;
|
||||
static const api = String.fromEnvironment('currencyApiKey');
|
||||
|
||||
static CurrencyApi create() {
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'CurrencyPair.dart';
|
||||
import 'currency_pair.dart';
|
||||
|
||||
const String CURRENCY_ONE = "conversion_one";
|
||||
const String CURRENCY_TWO = "conversion_two";
|
||||
const String currencyOne = "conversion_one";
|
||||
const String currencyTwo = "conversion_two";
|
||||
class PreferenceProvider {
|
||||
late final SharedPreferences _prefs;
|
||||
|
||||
@@ -12,13 +12,13 @@ class PreferenceProvider {
|
||||
}
|
||||
|
||||
Future<void> saveConversionPair(String s1, String s2) async {
|
||||
await _prefs.setString(CURRENCY_ONE, s1);
|
||||
await _prefs.setString(CURRENCY_TWO, s2);
|
||||
await _prefs.setString(currencyOne, s1);
|
||||
await _prefs.setString(currencyTwo, s2);
|
||||
}
|
||||
|
||||
CurrencyPair getConversionPair() {
|
||||
String? s1 = _prefs.getString(CURRENCY_ONE);
|
||||
String? s2 = _prefs.getString(CURRENCY_TWO);
|
||||
String? s1 = _prefs.getString(currencyOne);
|
||||
String? s2 = _prefs.getString(currencyTwo);
|
||||
|
||||
return CurrencyPair(s1, s2);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import '../model/Currency.dart';
|
||||
import '../prefs/CurrencyPair.dart';
|
||||
import '../model/currency.dart';
|
||||
import '../prefs/currency_pair.dart';
|
||||
|
||||
abstract class Repository {
|
||||
CurrencyPair getConversionPair();
|
||||
@@ -1,16 +1,16 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_cc_flutter/Utils/currencyUtils.dart';
|
||||
import 'package:easy_cc_flutter/data/model/Currency.dart';
|
||||
import 'package:easy_cc_flutter/data/prefs/CurrencyPair.dart';
|
||||
import 'package:easy_cc_flutter/data/prefs/PreferenceProvider.dart';
|
||||
import 'package:easy_cc_flutter/Utils/currency_utils.dart';
|
||||
import 'package:easy_cc_flutter/data/model/currency.dart';
|
||||
import 'package:easy_cc_flutter/data/prefs/currency_pair.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
import '../../main.dart';
|
||||
import '../network/backupCurrencyApi.dart';
|
||||
import '../network/currencyApi.dart';
|
||||
import '../network/safeApiCall.dart';
|
||||
import 'Repository.dart';
|
||||
import '../network/backup_currency_api.dart';
|
||||
import '../network/currency_api.dart';
|
||||
import '../network/safe_api_call.dart';
|
||||
import '../prefs/preference_provider.dart';
|
||||
import 'repository.dart';
|
||||
|
||||
class RepositoryImpl extends Repository with SafeApiCall {
|
||||
final PreferenceProvider _prefs = locator<PreferenceProvider>();
|
||||
Reference in New Issue
Block a user