Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Dec 2, 2023
1 parent dbc1f38 commit 0c6a7e5
Show file tree
Hide file tree
Showing 33 changed files with 106 additions and 95 deletions.
Binary file added build/app-arm64-v8a-release.apk
Binary file not shown.
Binary file added build/app-armeabi-v7a-release.apk
Binary file not shown.
Binary file added build/app-x86_64-release.apk
Binary file not shown.
Binary file added build/mrt_wallet.msix
Binary file not shown.
Binary file added build/web.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions mrt_native_support/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ group 'com.mrtnetwork.mrt_native_support'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.8.21'
ext.kotlin_version = '1.9.21'
repositories {
google()
mavenCentral()

}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.0'
}
Expand Down Expand Up @@ -44,7 +44,7 @@ android {
}

defaultConfig {
minSdkVersion 21
minSdkVersion 18
}
}
dependencies {
Expand Down
25 changes: 24 additions & 1 deletion mrt_native_support/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:mrt_native_support/models/models.dart';
Expand Down Expand Up @@ -30,6 +32,23 @@ class _MyWidgetState extends State<MyWidget> with WindowListener {
super.initState();
}

void write() async {
final plat = PlatformInterface.interface;
final path = await plat.path();
final naame = "${path.support}" +
r"\" +
DateTime.now().microsecond.toString() +
".txt";
print("name $naame");
final f = File(naame);

await f.create(recursive: true);
final v = List.generate(1000, (index) => "m").join();
await f.writeAsString(v);
print(f.path);
plat.launchUri(f.path);
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -39,7 +58,11 @@ class _MyWidgetState extends State<MyWidget> with WindowListener {
Expanded(
child: Center(
child: InkWell(
onTap: () async {},
onTap: () async {
final p = await PlatformInterface.interface.path();
write();
print(p);
},
child: const Icon(
Icons.abc,
size: 120,
Expand Down
4 changes: 2 additions & 2 deletions mrt_native_support/windows/mrt_native_support_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ namespace mrt_native_support {
CoTaskMemFree(cachePath);

// Calculate application-specific subdirectory within LocalAppData
std::wstring appSpecificCachePath = getAppSpecificSubdirectory(wideCachePath.c_str(), L"MyApp");
std::wstring appSpecificCachePath = getAppSpecificSubdirectory(wideCachePath.c_str(), L"MRTNETWORK");

// Convert wide string to BSTR
BSTR bstrAppSpecificCachePath = SysAllocString(appSpecificCachePath.c_str());
Expand All @@ -1036,7 +1036,7 @@ namespace mrt_native_support {
CoTaskMemFree(appSupportPath);

// Calculate application-specific subdirectory within RoamingAppData
std::wstring appSpecificSupportPath = getAppSpecificSubdirectory(wideAppSupportPath.c_str(), L"MyApp");
std::wstring appSpecificSupportPath = getAppSpecificSubdirectory(wideAppSupportPath.c_str(), L"MRTNETWORK");

// Convert wide string to BSTR
BSTR bstrAppSpecificSupportPath = SysAllocString(appSpecificSupportPath.c_str());
Expand Down
6 changes: 1 addition & 5 deletions mrt_wallet/lib/app/dev/logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class WalletLogging {
const green = '\x1b[32m';
final msg = '$green${prefix.toString()}$end => $err$message$end';
dev.log(msg,
time: DateTime.now(),

zone: Zone.root,
name: "wallet",
level: 0);
time: DateTime.now(), zone: Zone.root, name: "wallet", level: 0);
}
}
1 change: 0 additions & 1 deletion mrt_wallet/lib/app/euqatable/equatable.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

abstract mixin class Equatable {
List<dynamic> get variabels;

Expand Down
1 change: 0 additions & 1 deletion mrt_wallet/lib/app/state_managment/state_managment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ part 'core/disposable.dart';
part 'core/repository.dart';
part 'builder/live.dart';
part 'builder/safe_state.dart';

5 changes: 2 additions & 3 deletions mrt_wallet/lib/app/utility/method_caller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MethodCaller {

class MethodResult<T> {
MethodResult.error(this.exception, this.trace) : _result = null {
WalletLogging.print("ERROR: $error");
WalletLogging.print("request error: $error");
}
MethodResult.succsess(this._result)
: exception = null,
Expand All @@ -61,8 +61,7 @@ class MethodResult<T> {
exception is ApiProviderException) {
return exception!.toString();
}
WalletLogging.print(
"error ${exception.runtimeType} ${exception.toString()}");

return "somthing_wrong";
}

Expand Down
2 changes: 1 addition & 1 deletion mrt_wallet/lib/app/utility/secure_flag_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mixin SecureState<T extends StatefulWidget> on State<T> {
super.initState();
if (PlatformInterface.appPlatform == AppPlatform.android) {
PlatformInterface.interface.secureFlag(isSecure: true);
WalletLogging.print("yes enabled!");

_enabled = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _WalletLoginPageViewState extends State<WalletLoginPageView>
buttonKey.process();
final login = await provider.login(password);
buttonKey.fromMethodResult(login);
_error = login.error?.tr ;
_error = login.error?.tr;
setState(() {});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ class __BipAccountPublicKeyState extends State<_BipAccountPublicKey> {
widget: SelectableText(account.publicKey.toExtended),
)),
WidgetConstant.height20,
Text("comperessed_public_key".tr,
style: context.textTheme.titleLarge),
Text("comperessed_public_key".tr, style: context.textTheme.titleLarge),
WidgetConstant.height8,
ContainerWithBorder(
child: CopyTextWithBarcode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SwitchOrSelectAccountView extends StatelessWidget {
children: [
Expanded(
child: InkWell(
onTap: !forSelect
onTap: !forSelect
? null
: () {
if (context.mounted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class SelectProviderView extends StatelessWidget {
title: "what_is_service_provider".tr,
body: Text("what_is_api_provider".tr)),
PageTitleSubtitle(
title: "choose_provider".tr,
body: Text("select_provider_desc".tr)),
title: "choose_provider".tr, body: Text("select_provider_desc".tr)),
ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:mrt_wallet/app/extention/context.dart';
import 'package:mrt_wallet/future/widgets/custom_widgets.dart';
import 'package:mrt_wallet/models/wallet_models/wallet_models.dart';

class BitcoinAddressDetailsView extends StatelessWidget {
const BitcoinAddressDetailsView({required this.account, super.key});
final IBitcoinAddress account;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class BitcoinStateController extends StateController {
enableRBF: true,
outputs: _receivers.values.map((e) => e.address).toList(),
network: network.coinParam.transacationNetwork);
WalletLogging.print("end");

if (_networkFeeRate == null) {
_networkFeeRate = await _getFeeRate();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class _SetupBitcoinMultiSigAddressViewState

if (result.hasError || !result.result) {
buttomState.error();
_shareError = result.error?.tr ;
_shareError = result.error?.tr;
setState(() {});
} else {
buttomState.success();
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export 'bitcoin_pages/bitcoin.dart';
export 'bitcoin_pages/bitcoin.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class _EnterMnemonicViewState extends State<EnterMnemonicView> with SafeState {
WidgetConstant.height20,
PageTitleSubtitle(
title: "mn_password".tr,
body: Column(crossAxisAlignment: CrossAxisAlignment.start,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("enter_passphrase_desc".tr),
WidgetConstant.height8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class _VerifyMnemonicViewState extends State<VerifyMnemonicView>
@override
void initState() {
super.initState();
// isEqual();
// setState(() {});
WalletLogging.print(widget.mnemonic.toList());
}

@override
Expand Down
4 changes: 3 additions & 1 deletion mrt_wallet/lib/future/widgets/assets_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import 'package:flutter/material.dart';

class CircleAssetsImgaeView extends StatelessWidget {
const CircleAssetsImgaeView(this.assetPath,
{this.radius = 120, this.backgroundColor = Colors.transparent, super.key});
{this.radius = 120,
this.backgroundColor = Colors.transparent,
super.key});
final String assetPath;
final double radius;
final Color backgroundColor;
Expand Down
1 change: 1 addition & 0 deletions mrt_wallet/lib/future/widgets/dialog_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mrt_wallet/app/constant/constant.dart';
import 'package:mrt_wallet/app/extention/extention.dart';
import 'package:mrt_wallet/future/widgets/custom_widgets.dart';

class DialogView extends StatelessWidget {
const DialogView({required this.child, required this.title, super.key});
final Widget child;
Expand Down
2 changes: 0 additions & 2 deletions mrt_wallet/lib/future/widgets/list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ class AppCheckListTile extends StatelessWidget {
Widget build(BuildContext context) {
return CheckboxListTile(
onChanged: onChanged,

value: value,

title: title == null
? null
: DefaultTextStyle(
Expand Down
3 changes: 2 additions & 1 deletion mrt_wallet/lib/future/widgets/measure_size.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MeasureSize extends SingleChildRenderObjectWidget {
@override
void updateRenderObject(
// ignore: library_private_types_in_public_api
BuildContext context, covariant _MeasureSizeRenderObject renderObject) {
BuildContext context,
covariant _MeasureSizeRenderObject renderObject) {
renderObject.onChange = onChange;
}
}
1 change: 0 additions & 1 deletion mrt_wallet/lib/future/widgets/price.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:mrt_wallet/app/state_managment/state_managment.dart';
import 'package:mrt_wallet/future/widgets/custom_widgets.dart';
import 'package:mrt_wallet/models/wallet_models/wallet_models.dart';


class PriceTooltipWidget extends StatelessWidget {
const PriceTooltipWidget(
{Key? key,
Expand Down
3 changes: 2 additions & 1 deletion mrt_wallet/lib/future/widgets/qr_code/core/bit_buffer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class QrBitBuffer extends Object with ListMixin<bool> {
QrBitBuffer() : _buffer = <int>[];

@override
void operator []=(int index, bool value) => throw UnsupportedError('cannot change');
void operator []=(int index, bool value) =>
throw UnsupportedError('cannot change');

@override
bool operator [](int index) {
Expand Down
1 change: 0 additions & 1 deletion mrt_wallet/lib/provider/wallet/network/network_imp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ mixin WalletNetworkImpl
try {
account.removeAccount(r);
} on WalletException {
WalletLogging.print("got error !");
continue;
}
}
Expand Down
Loading

0 comments on commit 0c6a7e5

Please sign in to comment.