diff --git a/lib/anchor_types/nft_parameters.dart b/lib/anchor_types/nft_parameters.dart new file mode 100644 index 0000000..3e33119 --- /dev/null +++ b/lib/anchor_types/nft_parameters.dart @@ -0,0 +1,19 @@ +import 'package:borsh_annotation/borsh_annotation.dart'; + +part 'nft_parameters.g.dart'; + +@BorshSerializable() +class NftArguments with _$NftArguments { + factory NftArguments( + { + @BString() required String id, + @BString() required String name, + @BString() required String symbol, + @BString() required String uri + }) = _NftArguments; + + const NftArguments._(); + + factory NftArguments.fromBorsh(Uint8List data) => + _$NftArgumentsFromBorsh(data); +} diff --git a/lib/anchor_types/nft_parameters.g.dart b/lib/anchor_types/nft_parameters.g.dart new file mode 100644 index 0000000..c78ccfe --- /dev/null +++ b/lib/anchor_types/nft_parameters.g.dart @@ -0,0 +1,64 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'nft_parameters.dart'; + +// ************************************************************************** +// BorshSerializableGenerator +// ************************************************************************** + +mixin _$NftArguments { + String get id => throw UnimplementedError(); + String get name => throw UnimplementedError(); + String get symbol => throw UnimplementedError(); + String get uri => throw UnimplementedError(); + + Uint8List toBorsh() { + final writer = BinaryWriter(); + + const BString().write(writer, id); + const BString().write(writer, name); + const BString().write(writer, symbol); + const BString().write(writer, uri); + + return writer.toArray(); + } +} + +class _NftArguments extends NftArguments { + _NftArguments({ + required this.id, + required this.name, + required this.symbol, + required this.uri, + }) : super._(); + + final String id; + final String name; + final String symbol; + final String uri; +} + +class BNftArguments implements BType { + const BNftArguments(); + + @override + void write(BinaryWriter writer, NftArguments value) { + writer.writeStruct(value.toBorsh()); + } + + @override + NftArguments read(BinaryReader reader) { + return NftArguments( + id: const BString().read(reader), + name: const BString().read(reader), + symbol: const BString().read(reader), + uri: const BString().read(reader), + ); + } +} + +NftArguments _$NftArgumentsFromBorsh(Uint8List data) { + final reader = BinaryReader(data.buffer.asByteData()); + + return const BNftArguments().read(reader); +} diff --git a/lib/pages/my-dinogrow/my_dinogrow.dart b/lib/pages/my-dinogrow/my_dinogrow.dart index 61e7f68..36f2b5e 100644 --- a/lib/pages/my-dinogrow/my_dinogrow.dart +++ b/lib/pages/my-dinogrow/my_dinogrow.dart @@ -1,9 +1,18 @@ +import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:go_router/go_router.dart'; import 'package:flutter/material.dart'; +import 'package:solana/solana.dart'; import '../../ui/widgets/widgets.dart'; +import 'dart:math'; +import 'package:solana/solana.dart' as solana; +import 'package:solana/anchor.dart' as solana_anchor; +import 'package:solana/encoder.dart' as solana_encoder; +import 'package:solana_common/utils/buffer.dart' as solana_buffer; +import '../../anchor_types/nft_parameters.dart' as anchor_types; + class MydinogrowScreen extends StatefulWidget { const MydinogrowScreen({super.key}); @@ -26,7 +35,7 @@ class _MydinogrowScreenState extends State { const SizedBox(height: 30), IntroButtonWidget( text: 'Claim your Dino', - onPressed: _onClaim, + onPressed: createNft, ), const SizedBox(height: 30), Container( @@ -140,4 +149,127 @@ class _MydinogrowScreenState extends State { color: filters[index], ); } + + createNft() async { + await dotenv.load(fileName: ".env"); + + SolanaClient? client; + client = SolanaClient( + rpcUrl: Uri.parse(dotenv.env['QUICKNODE_RPC_URL'].toString()), + websocketUrl: Uri.parse(dotenv.env['QUICKNODE_RPC_WSS'].toString()), + ); + const storage = FlutterSecureStorage(); + + final mainWalletKey = await storage.read(key: 'mnemonic'); + + final mainWalletSolana = await solana.Ed25519HDKeyPair.fromMnemonic( + mainWalletKey!, + ); + + const programId = '9V9ttZw7WTYW78Dx3hi2hV7V76PxAs5ZwbCkGi7qq8FW'; + + final programIdPublicKey = solana.Ed25519HDPublicKey.fromBase58(programId); + + int idrnd = Random().nextInt(999); + String id = "Dino$idrnd"; + print(id); + + final nftMintPda = await solana.Ed25519HDPublicKey.findProgramAddress( + programId: programIdPublicKey, + seeds: [ + solana_buffer.Buffer.fromString("mint"), + solana_buffer.Buffer.fromString(id), + ]); + print(nftMintPda.toBase58()); + + final ataProgramId = solana.Ed25519HDPublicKey.fromBase58( + solana.AssociatedTokenAccountProgram.programId); + + final systemProgramId = + solana.Ed25519HDPublicKey.fromBase58(solana.SystemProgram.programId); + final tokenProgramId = + solana.Ed25519HDPublicKey.fromBase58(solana.TokenProgram.programId); + + final rentProgramId = solana.Ed25519HDPublicKey.fromBase58( + "SysvarRent111111111111111111111111111111111"); + + const metaplexProgramId = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'; + final metaplexProgramIdPublicKey = + solana.Ed25519HDPublicKey.fromBase58(metaplexProgramId); + + final aTokenAccount = await solana.Ed25519HDPublicKey.findProgramAddress( + seeds: [ + mainWalletSolana.publicKey.bytes, + tokenProgramId.bytes, + nftMintPda.bytes, + ], + programId: ataProgramId, + ); + print(aTokenAccount.toBase58()); + + final masterEditionAccountPda = + await solana.Ed25519HDPublicKey.findProgramAddress( + seeds: [ + solana_buffer.Buffer.fromString("metadata"), + metaplexProgramIdPublicKey.bytes, + nftMintPda.bytes, + solana_buffer.Buffer.fromString("edition"), + ], + programId: metaplexProgramIdPublicKey, + ); + final nftMetadataPda = await solana.Ed25519HDPublicKey.findProgramAddress( + seeds: [ + solana_buffer.Buffer.fromString("metadata"), + metaplexProgramIdPublicKey.bytes, + nftMintPda.bytes, + ], + programId: metaplexProgramIdPublicKey, + ); + + final instructions = [ + await solana_anchor.AnchorInstruction.forMethod( + programId: programIdPublicKey, + method: 'create_dino_nft', + arguments: solana_encoder.ByteArray(anchor_types.NftArguments( + id: id, + name: "DINOGROW #005", + symbol: "DNG", + uri: + "https://quicknode.myfilebase.com/ipfs/QmPeUExCwWmpqB47EKErgf3E5JWrQPv3kCpfqpzWVHHux8/", + ).toBorsh().toList()), + accounts: [ + solana_encoder.AccountMeta.writeable( + pubKey: nftMintPda, isSigner: false), + solana_encoder.AccountMeta.writeable( + pubKey: aTokenAccount, isSigner: false), + solana_encoder.AccountMeta.readonly( + pubKey: ataProgramId, isSigner: false), + solana_encoder.AccountMeta.writeable( + pubKey: mainWalletSolana.publicKey, isSigner: true), + solana_encoder.AccountMeta.writeable( + pubKey: mainWalletSolana.publicKey, isSigner: true), + solana_encoder.AccountMeta.readonly( + pubKey: rentProgramId, isSigner: false), + solana_encoder.AccountMeta.readonly( + pubKey: systemProgramId, isSigner: false), + solana_encoder.AccountMeta.readonly( + pubKey: tokenProgramId, isSigner: false), + solana_encoder.AccountMeta.readonly( + pubKey: metaplexProgramIdPublicKey, isSigner: false), + solana_encoder.AccountMeta.writeable( + pubKey: masterEditionAccountPda, isSigner: false), + solana_encoder.AccountMeta.writeable( + pubKey: nftMetadataPda, isSigner: false), + ], + namespace: 'global', + ), + ]; + final message = solana.Message(instructions: instructions); + final signature = await client.sendAndConfirmTransaction( + message: message, + signers: [mainWalletSolana], + commitment: solana.Commitment.confirmed, + ); + print('Tx successful with hash: $signature'); + } } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e58cc93..e14e235 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,12 @@ import FlutterMacOS import Foundation +import connectivity_plus import flutter_secure_storage_macos import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 03a6aa8..4aff71c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,30 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: @@ -9,6 +33,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.11.0" + base_codecs: + dependency: transitive + description: + name: base_codecs + sha256: "41701a12ede9912663decd708279924ece5018566daa7d1f484d5f4f10894f91" + url: "https://pub.dev" + source: hosted + version: "1.0.1" bip39: dependency: "direct main" description: @@ -25,14 +57,86 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + borsh: + dependency: "direct main" + description: + name: borsh + sha256: bed3867b7bf517e543ce266cb9e3f6afcc43d437a7edcd129168d6b8452a49fd + url: "https://pub.dev" + source: hosted + version: "0.3.1+3" borsh_annotation: - dependency: transitive + dependency: "direct main" description: name: borsh_annotation sha256: "8c2cc353cb99a12b6c4f9c69e3640d2e18f5127628391658b9fceb96d4fec4d6" url: "https://pub.dev" source: hosted version: "0.3.1+4" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.dev" + source: hosted + version: "7.2.11" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 + url: "https://pub.dev" + source: hosted + version: "8.6.3" characters: dependency: transitive description: @@ -41,6 +145,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" clock: dependency: transitive description: @@ -49,6 +161,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" + url: "https://pub.dev" + source: hosted + version: "4.7.0" collection: dependency: transitive description: @@ -57,6 +177,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.1" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: b74247fad72c171381dbe700ca17da24deac637ab6d43c343b42867acb95c991 + url: "https://pub.dev" + source: hosted + version: "3.0.6" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + url: "https://pub.dev" + source: hosted + version: "1.2.4" convert: dependency: transitive description: @@ -89,6 +225,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + dbus: + dependency: transitive + description: + name: dbus + sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + url: "https://pub.dev" + source: hosted + version: "0.7.8" decimal: dependency: transitive description: @@ -113,6 +265,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flame: dependency: "direct main" description: @@ -232,6 +408,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.1" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" go_router: dependency: "direct main" description: @@ -240,6 +432,14 @@ packages: url: "https://pub.dev" source: hosted version: "10.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" hex: dependency: transitive description: @@ -256,6 +456,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.13.6" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" http_parser: dependency: transitive description: @@ -264,6 +472,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" js: dependency: transitive description: @@ -320,6 +536,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" ordered_set: dependency: transitive description: @@ -328,6 +560,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -336,6 +576,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" pinenacl: dependency: transitive description: @@ -360,6 +608,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.7.3" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" rational: dependency: transitive description: @@ -368,6 +640,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -381,6 +669,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.29.1" + solana_common: + dependency: transitive + description: + name: solana_common + sha256: "5cee19ee527a76c97de4b6462b779729fd5acfb9085fe1eb090fcd575c1f284c" + url: "https://pub.dev" + source: hosted + version: "0.0.5" + solana_web3: + dependency: "direct main" + description: + name: solana_web3 + sha256: cb9f5fab0d5b67d66ec942fa1737cdf8fc947a12258cc75bbf32d622d89b5e82 + url: "https://pub.dev" + source: hosted + version: "0.0.8" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" source_span: dependency: transitive description: @@ -405,6 +725,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -413,6 +741,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" + source: hosted + version: "3.1.0" term_glyph: dependency: transitive description: @@ -429,6 +765,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" typed_data: dependency: transitive description: @@ -509,6 +853,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" web_socket_channel: dependency: transitive description: @@ -517,6 +869,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.0" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: dart: ">=3.0.2 <4.0.0" flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4157b9b..e3c084c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,11 +18,15 @@ dependencies: flame_forge2d: ^0.14.1+1 flutter_joystick: ^0.0.3 url_launcher: ^6.1.14 + borsh: ^0.3.1+2 + borsh_annotation: ^0.3.1+3 + solana_web3: ^0.0.8 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 + build_runner: ^2.0.0 flutter: uses-material-design: true diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 2048c45..80422a9 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,10 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index de626cc..214b998 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus flutter_secure_storage_windows url_launcher_windows )