add port to config

pull/1/head
fuwa 5 years ago
parent 67ed39c4c3
commit cfa6b4fc24

@ -31,5 +31,6 @@ const config = CryptoConfig
70,
Colors.green,
Colors.black,
34568,
['--prune-blockchain'],
);

@ -28,6 +28,7 @@ class CryptoConfig {
final int splashDelay;
final Color textColor;
final Color backgroundColor;
final int port;
final List<String> extraArgs;
const CryptoConfig
(
@ -37,6 +38,7 @@ class CryptoConfig {
this.splashDelay,
this.textColor,
this.backgroundColor,
this.port,
this.extraArgs,
);
}

@ -25,15 +25,10 @@ import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart';
Future<http.Response> rpc(String method) async {
var url = '';
if (kReleaseMode) {
url = 'http://127.0.0.1:34568/json_rpc';
} else {
url = 'http://192.168.10.101:34568/json_rpc';
}
import '../config.dart';
url = 'http://127.0.0.1:34568/json_rpc';
Future<http.Response> rpc(String method) async {
final url = 'http://127.0.0.1:${config.port}/json_rpc';
final body = json.encode
(