mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
CAKE-356 | added isYatDevMode parameter to the yat_alert.dart; deleted yat_webview_page.dart and yat_view_model.dart; applied localization of Yat to the app
This commit is contained in:
@@ -157,12 +157,12 @@ abstract class SettingsViewModelBase with Store {
|
||||
],
|
||||
[
|
||||
RegularListItem(
|
||||
title: 'Manage Yats',
|
||||
title: S.current.manage_yats,
|
||||
handler: (BuildContext context) async {
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return YatAlert();
|
||||
return YatAlert(isYatDevMode: true);
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import 'package:cake_wallet/store/yat_store.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:cake_wallet/yat/yat_exception.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
||||
|
||||
part 'yat_view_model.g.dart';
|
||||
|
||||
class YatViewModel = YatViewModelBase with _$YatViewModel;
|
||||
|
||||
abstract class YatViewModelBase with Store {
|
||||
YatViewModelBase({@required this.yatStore});
|
||||
|
||||
final YatStore yatStore;
|
||||
|
||||
Future<void> fetchCartInfo() async {
|
||||
final url = 'https://a.y.at/cart';
|
||||
final _apiKey = secrets.yatApiToken;
|
||||
|
||||
final response = await get(
|
||||
url,
|
||||
headers: {
|
||||
'Accept':'*/*',
|
||||
'X-Api-Key': _apiKey
|
||||
}
|
||||
);
|
||||
|
||||
print('RESPONSE = ${response.body.toString()}');
|
||||
|
||||
/*if (response.statusCode != 200) {
|
||||
throw YatException(text: response.body.toString());
|
||||
}
|
||||
|
||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||
yatStore.yatAddress = responseJSON[''] as String;*/ // FIXME
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user