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:
OleksandrSobol
2021-09-16 12:43:43 +03:00
parent 455efeb91f
commit cdddc12c81
24 changed files with 146 additions and 262 deletions
@@ -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);
});
},
),
-39
View File
@@ -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
}
}