add port to config

master
fuwa 5 years ago
parent 67ed39c4c3
commit cfa6b4fc24

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

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

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

Loading…
Cancel
Save