FaucetHub/lib/Backend/helpers.dart
2023-05-19 23:23:42 +05:30

48 lines
1.0 KiB
Dart

import 'package:crypto_font_icons/crypto_font_icons.dart';
import 'package:faucethub/Backend/DebugHelper.dart';
import 'package:faucethub/Backend/hoarder.dart';
import 'package:flutter/material.dart';
class Helpers{
static IconData GetIconForCrypto(String val){
switch(val){
case "BTC":
return CryptoFontIcons.BTC;
break;
case "ETH":
return CryptoFontIcons.ETH;
break;
case "XRP":
return CryptoFontIcons.XRP;
break;
case "DOGE":
return CryptoFontIcons.DOGE;
break;
case "LTC":
return CryptoFontIcons.LTC;
break;
}
return CryptoFontIcons.BTC;
}
static String GetIconForGame(String name){
Hoarder.GamesJson.forEach((element) {
if(element['name'] == name){
return element['thumbnail'];
}
});
return "";
}
static dynamic GetGameFromCode(String code){
for (var value in Hoarder.GamesJson) {
Debug.Log(value);
if(code == value['code']){
return value;
}
}
}
}