Skip to content

Commit ca0282a

Browse files
committed
refactor: update to native assets with build hook
1 parent 666f688 commit ca0282a

24 files changed

+8258
-9296
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88

99
[lib]
1010
crate-type = ["lib", "staticlib", "cdylib"]
11-
name = "bdkffi"
11+
name = "bdk_ffi"
1212
path = "bdk-ffi/bdk-ffi/src/lib.rs"
1313

1414
[[bin]]
@@ -32,13 +32,13 @@ bdk_electrum = { version = "0.23.2", default-features = false, features = [
3232
bdk_kyoto = { version = "0.15.3" }
3333

3434
uniffi = { version = "=0.30.0", features = ["cli"] }
35-
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart.git" }
35+
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart" }
3636
camino = "1.2"
3737
thiserror = "1.0.65"
3838

3939
[build-dependencies]
4040
uniffi = { version = "=0.30.0", features = ["build"] }
41-
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart.git", features = [
41+
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart", features = [
4242
"build",
4343
] }
4444

bdk_demo/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

bdk_demo/ios/Podfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Uncomment this line to define a global platform for your project
2+
platform :ios, '13.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
33+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
34+
target 'RunnerTests' do
35+
inherit! :search_paths
36+
end
37+
end
38+
39+
post_install do |installer|
40+
installer.pods_project.targets.each do |target|
41+
flutter_additional_ios_build_settings(target)
42+
end
43+
end

bdk_demo/ios/Podfile.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
4+
DEPENDENCIES:
5+
- Flutter (from `Flutter`)
6+
7+
EXTERNAL SOURCES:
8+
Flutter:
9+
:path: Flutter
10+
11+
SPEC CHECKSUMS:
12+
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
13+
14+
PODFILE CHECKSUM: 251cb053df7158f337c0712f2ab29f4e0fa474ce
15+
16+
COCOAPODS: 1.16.2

bdk_demo/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13+
7267FE792F2335544B49B6DE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051F7C14E1849E9022C15AFE /* Pods_Runner.framework */; };
1314
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15+
7B1A64CF96A40FF2FEB7E8D4 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78429447DD8D064999F6131C /* Pods_RunnerTests.framework */; };
1416
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1517
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1618
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -40,13 +42,19 @@
4042
/* End PBXCopyFilesBuildPhase section */
4143

4244
/* Begin PBXFileReference section */
45+
051F7C14E1849E9022C15AFE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4346
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4447
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
48+
2ACF58D96E53774C8B32AB34 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
49+
2DA866BBBEC6FE23F2C830BA /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
4550
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
4651
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4752
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
53+
562CD21D00E2298B8A61DBE7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
54+
723E6F053C47926D84ED588C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4855
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4956
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
57+
78429447DD8D064999F6131C /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5058
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5159
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5260
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -55,13 +63,24 @@
5563
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5664
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5765
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
66+
B921216A1BBF3DCEC247541B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
67+
CDCE6A119A078C5DE8489B25 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
5868
/* End PBXFileReference section */
5969

6070
/* Begin PBXFrameworksBuildPhase section */
71+
1A09149109DF004A465444C9 /* Frameworks */ = {
72+
isa = PBXFrameworksBuildPhase;
73+
buildActionMask = 2147483647;
74+
files = (
75+
7B1A64CF96A40FF2FEB7E8D4 /* Pods_RunnerTests.framework in Frameworks */,
76+
);
77+
runOnlyForDeploymentPostprocessing = 0;
78+
};
6179
97C146EB1CF9000F007C117D /* Frameworks */ = {
6280
isa = PBXFrameworksBuildPhase;
6381
buildActionMask = 2147483647;
6482
files = (
83+
7267FE792F2335544B49B6DE /* Pods_Runner.framework in Frameworks */,
6584
);
6685
runOnlyForDeploymentPostprocessing = 0;
6786
};
@@ -76,6 +95,15 @@
7695
path = RunnerTests;
7796
sourceTree = "<group>";
7897
};
98+
66B8A2169B9DA38957E28F5B /* Frameworks */ = {
99+
isa = PBXGroup;
100+
children = (
101+
051F7C14E1849E9022C15AFE /* Pods_Runner.framework */,
102+
78429447DD8D064999F6131C /* Pods_RunnerTests.framework */,
103+
);
104+
name = Frameworks;
105+
sourceTree = "<group>";
106+
};
79107
9740EEB11CF90186004384FC /* Flutter */ = {
80108
isa = PBXGroup;
81109
children = (
@@ -94,6 +122,8 @@
94122
97C146F01CF9000F007C117D /* Runner */,
95123
97C146EF1CF9000F007C117D /* Products */,
96124
331C8082294A63A400263BE5 /* RunnerTests */,
125+
DF9AE2D7BA4D937A0D4E5B2A /* Pods */,
126+
66B8A2169B9DA38957E28F5B /* Frameworks */,
97127
);
98128
sourceTree = "<group>";
99129
};
@@ -121,15 +151,31 @@
121151
path = Runner;
122152
sourceTree = "<group>";
123153
};
154+
DF9AE2D7BA4D937A0D4E5B2A /* Pods */ = {
155+
isa = PBXGroup;
156+
children = (
157+
562CD21D00E2298B8A61DBE7 /* Pods-Runner.debug.xcconfig */,
158+
B921216A1BBF3DCEC247541B /* Pods-Runner.release.xcconfig */,
159+
723E6F053C47926D84ED588C /* Pods-Runner.profile.xcconfig */,
160+
CDCE6A119A078C5DE8489B25 /* Pods-RunnerTests.debug.xcconfig */,
161+
2DA866BBBEC6FE23F2C830BA /* Pods-RunnerTests.release.xcconfig */,
162+
2ACF58D96E53774C8B32AB34 /* Pods-RunnerTests.profile.xcconfig */,
163+
);
164+
name = Pods;
165+
path = Pods;
166+
sourceTree = "<group>";
167+
};
124168
/* End PBXGroup section */
125169

126170
/* Begin PBXNativeTarget section */
127171
331C8080294A63A400263BE5 /* RunnerTests */ = {
128172
isa = PBXNativeTarget;
129173
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
130174
buildPhases = (
175+
E2CB103D2651042A0805D1BA /* [CP] Check Pods Manifest.lock */,
131176
331C807D294A63A400263BE5 /* Sources */,
132177
331C807F294A63A400263BE5 /* Resources */,
178+
1A09149109DF004A465444C9 /* Frameworks */,
133179
);
134180
buildRules = (
135181
);
@@ -145,6 +191,7 @@
145191
isa = PBXNativeTarget;
146192
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
147193
buildPhases = (
194+
8E049878B4F3F7BF19589B67 /* [CP] Check Pods Manifest.lock */,
148195
9740EEB61CF901F6004384FC /* Run Script */,
149196
97C146EA1CF9000F007C117D /* Sources */,
150197
97C146EB1CF9000F007C117D /* Frameworks */,
@@ -238,6 +285,28 @@
238285
shellPath = /bin/sh;
239286
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
240287
};
288+
8E049878B4F3F7BF19589B67 /* [CP] Check Pods Manifest.lock */ = {
289+
isa = PBXShellScriptBuildPhase;
290+
buildActionMask = 2147483647;
291+
files = (
292+
);
293+
inputFileListPaths = (
294+
);
295+
inputPaths = (
296+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
297+
"${PODS_ROOT}/Manifest.lock",
298+
);
299+
name = "[CP] Check Pods Manifest.lock";
300+
outputFileListPaths = (
301+
);
302+
outputPaths = (
303+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
304+
);
305+
runOnlyForDeploymentPostprocessing = 0;
306+
shellPath = /bin/sh;
307+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
308+
showEnvVarsInLog = 0;
309+
};
241310
9740EEB61CF901F6004384FC /* Run Script */ = {
242311
isa = PBXShellScriptBuildPhase;
243312
alwaysOutOfDate = 1;
@@ -253,6 +322,28 @@
253322
shellPath = /bin/sh;
254323
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
255324
};
325+
E2CB103D2651042A0805D1BA /* [CP] Check Pods Manifest.lock */ = {
326+
isa = PBXShellScriptBuildPhase;
327+
buildActionMask = 2147483647;
328+
files = (
329+
);
330+
inputFileListPaths = (
331+
);
332+
inputPaths = (
333+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
334+
"${PODS_ROOT}/Manifest.lock",
335+
);
336+
name = "[CP] Check Pods Manifest.lock";
337+
outputFileListPaths = (
338+
);
339+
outputPaths = (
340+
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
341+
);
342+
runOnlyForDeploymentPostprocessing = 0;
343+
shellPath = /bin/sh;
344+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
345+
showEnvVarsInLog = 0;
346+
};
256347
/* End PBXShellScriptBuildPhase section */
257348

258349
/* Begin PBXSourcesBuildPhase section */
@@ -346,7 +437,7 @@
346437
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347438
GCC_WARN_UNUSED_FUNCTION = YES;
348439
GCC_WARN_UNUSED_VARIABLE = YES;
349-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
440+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
350441
MTL_ENABLE_DEBUG_INFO = NO;
351442
SDKROOT = iphoneos;
352443
SUPPORTED_PLATFORMS = iphoneos;
@@ -379,6 +470,7 @@
379470
};
380471
331C8088294A63A400263BE5 /* Debug */ = {
381472
isa = XCBuildConfiguration;
473+
baseConfigurationReference = CDCE6A119A078C5DE8489B25 /* Pods-RunnerTests.debug.xcconfig */;
382474
buildSettings = {
383475
BUNDLE_LOADER = "$(TEST_HOST)";
384476
CODE_SIGN_STYLE = Automatic;
@@ -396,6 +488,7 @@
396488
};
397489
331C8089294A63A400263BE5 /* Release */ = {
398490
isa = XCBuildConfiguration;
491+
baseConfigurationReference = 2DA866BBBEC6FE23F2C830BA /* Pods-RunnerTests.release.xcconfig */;
399492
buildSettings = {
400493
BUNDLE_LOADER = "$(TEST_HOST)";
401494
CODE_SIGN_STYLE = Automatic;
@@ -411,6 +504,7 @@
411504
};
412505
331C808A294A63A400263BE5 /* Profile */ = {
413506
isa = XCBuildConfiguration;
507+
baseConfigurationReference = 2ACF58D96E53774C8B32AB34 /* Pods-RunnerTests.profile.xcconfig */;
414508
buildSettings = {
415509
BUNDLE_LOADER = "$(TEST_HOST)";
416510
CODE_SIGN_STYLE = Automatic;
@@ -473,7 +567,7 @@
473567
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
474568
GCC_WARN_UNUSED_FUNCTION = YES;
475569
GCC_WARN_UNUSED_VARIABLE = YES;
476-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
570+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
477571
MTL_ENABLE_DEBUG_INFO = YES;
478572
ONLY_ACTIVE_ARCH = YES;
479573
SDKROOT = iphoneos;
@@ -524,7 +618,7 @@
524618
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
525619
GCC_WARN_UNUSED_FUNCTION = YES;
526620
GCC_WARN_UNUSED_VARIABLE = YES;
527-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
621+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
528622
MTL_ENABLE_DEBUG_INFO = NO;
529623
SDKROOT = iphoneos;
530624
SUPPORTED_PLATFORMS = iphoneos;

bdk_demo/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bdk_demo/lib/main.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:bdk_dart/bdk.dart';
12
import 'package:flutter/material.dart';
23

34
void main() {
@@ -34,6 +35,9 @@ class _MyHomePageState extends State<MyHomePage> {
3435

3536
void _showSignetNetwork() {
3637
setState(() {
38+
final mnemonic = Mnemonic(WordCount.words12);
39+
print('Generated mnemonic: ${mnemonic.toString()}');
40+
// Initialize BDK to ensure bindings are loaded
3741
// This simulates what the real Dart bindings would return
3842
// when properly linked to the Rust library
3943
_networkName = 'Signet';
@@ -58,10 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {
5862
color: _success ? Colors.green : Colors.grey,
5963
),
6064
const SizedBox(height: 20),
61-
const Text(
62-
'BDK Network Type:',
63-
style: TextStyle(fontSize: 20),
64-
),
65+
const Text('BDK Network Type:', style: TextStyle(fontSize: 20)),
6566
Text(
6667
_networkName,
6768
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
@@ -105,4 +106,4 @@ class _MyHomePageState extends State<MyHomePage> {
105106
),
106107
);
107108
}
108-
}
109+
}

bdk_demo/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: bdk_demo
22
description: "A new Flutter project."
33
# The following line prevents the package from being accidentally published to
44
# pub.dev using `flutter pub publish`. This is preferred for private packages.
5-
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
5+
publish_to: "none" # Remove this line if you wish to publish to pub.dev
66

77
# The following defines the version and build number for your application.
88
# A version number is three numbers separated by dots, like 1.2.43
@@ -30,6 +30,8 @@ environment:
3030
dependencies:
3131
flutter:
3232
sdk: flutter
33+
bdk_dart:
34+
path: ../
3335

3436
# The following adds the Cupertino Icons font to your application.
3537
# Use with the CupertinoIcons class for iOS style icons.
@@ -51,7 +53,6 @@ dev_dependencies:
5153

5254
# The following section is specific to Flutter packages.
5355
flutter:
54-
5556
# The following line ensures that the Material Icons font is
5657
# included with your application, so that you can use the icons in
5758
# the material Icons class.

0 commit comments

Comments
 (0)