From b69aa2ae0264983a0ba405a3a27b541ccdd08e28 Mon Sep 17 00:00:00 2001 From: Joses Gabriel Date: Fri, 31 Jan 2025 17:11:40 +0800 Subject: [PATCH 1/4] feat: migrate to reown from web3m --- .fvm/fvm_config.json | 2 +- .fvmrc | 2 +- .vscode/settings.json | 2 +- android/build.gradle | 3 +- ios/Podfile.lock | 9 +- ios/Runner.xcodeproj/project.pbxproj | 9 +- ios/Runner/Info.plist | 8 +- lib/configs/themes.dart | 4 +- .../application/service/cubit/web3_cubit.dart | 67 ++- .../application/service/cubit/web3_state.dart | 6 +- .../screens/authentication_screen.dart | 95 ++- .../home/interfaces/screens/home_screen.dart | 547 +++++++++--------- lib/main.dart | 11 +- pubspec.lock | 285 +++++---- pubspec.yaml | 6 +- 15 files changed, 580 insertions(+), 476 deletions(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 1153128..e20d18a 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,3 +1,3 @@ { - "flutterSdkVersion": "3.19.6" + "flutterSdkVersion": "3.27.0" } \ No newline at end of file diff --git a/.fvmrc b/.fvmrc index 03c3fb3..5b5166d 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.19.6" + "flutter": "3.27.0" } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8a68bfd..d067855 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "dart.flutterSdkPath": ".fvm/versions/3.19.6" + "dart.flutterSdkPath": ".fvm/versions/3.27.0" } \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index e83fb5d..94aaebc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,11 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '2.0.21' repositories { google() mavenCentral() } dependencies { + classpath 'com.android.tools.build:gradle:8.7.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3e80a20..17593f1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -7,6 +7,9 @@ PODS: - CoinbaseWalletSDK/Client (1.0.4) - CoinbaseWalletSDK/CrossPlatform (1.0.4): - CoinbaseWalletSDK/Client + - connectivity_plus (0.0.1): + - Flutter + - FlutterMacOS - Flutter (1.0.0) - flutter_native_splash (0.0.1): - Flutter @@ -84,6 +87,7 @@ PODS: DEPENDENCIES: - appcheck (from `.symlinks/plugins/appcheck/ios`) - coinbase_wallet_sdk (from `.symlinks/plugins/coinbase_wallet_sdk/ios`) + - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) - Flutter (from `Flutter`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) @@ -116,6 +120,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/appcheck/ios" coinbase_wallet_sdk: :path: ".symlinks/plugins/coinbase_wallet_sdk/ios" + connectivity_plus: + :path: ".symlinks/plugins/connectivity_plus/darwin" Flutter: :path: Flutter flutter_native_splash: @@ -141,6 +147,7 @@ SPEC CHECKSUMS: appcheck: e1ab9d4e03736f03e0401554a134d1ed502d7629 coinbase_wallet_sdk: 7ccd4e1a7940deba6ba9bd81beece999a2268c15 CoinbaseWalletSDK: ea1f37512bbc69ebe07416e3b29bf840f5cc3152 + connectivity_plus: 18382e7311ba19efcaee94442b23b32507b20695 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778 flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 @@ -166,4 +173,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 8bd0f05..ed330eb 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -485,7 +485,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = BNA4KC4Q9J; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -494,6 +494,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = com.nuxify.sophon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -665,7 +666,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = BNA4KC4Q9J; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -674,6 +675,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = com.nuxify.sophon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -689,7 +691,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = BNA4KC4Q9J; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -698,6 +700,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = com.nuxify.sophon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f8583aa..75f8ab1 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) + 2.3.0 CFBundleSignature ???? CFBundleVersion - $(FLUTTER_BUILD_NUMBER) + 1 LSApplicationQueriesSchemes metamask @@ -36,6 +36,8 @@ LSRequiresIPhoneOS + NSCameraUsageDescription + Camera access is needed to scan QR codes. UIApplicationSupportsIndirectInputEvents UILaunchStoryboardName @@ -57,7 +59,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSCameraUsageDescription - Camera access is needed to scan QR codes. diff --git a/lib/configs/themes.dart b/lib/configs/themes.dart index 2a01c38..16059c2 100644 --- a/lib/configs/themes.dart +++ b/lib/configs/themes.dart @@ -15,5 +15,5 @@ ThemeData _buildDefaultTheme() { ); } -Color shimmerBase = kPink.withOpacity(0.2); -Color shimmerGlow = kPink.withOpacity(0.5); +Color shimmerBase = kPink.withValues(alpha: 0.2); +Color shimmerGlow = kPink.withValues(alpha: 0.5); diff --git a/lib/core/application/service/cubit/web3_cubit.dart b/lib/core/application/service/cubit/web3_cubit.dart index c263abc..6eb7639 100644 --- a/lib/core/application/service/cubit/web3_cubit.dart +++ b/lib/core/application/service/cubit/web3_cubit.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_dotenv/flutter_dotenv.dart'; +import 'package:reown_appkit/reown_appkit.dart'; import 'package:sophon/configs/web3_config.dart'; import 'package:sophon/internal/web3_contract.dart'; -import 'package:web3modal_flutter/web3modal_flutter.dart'; part 'web3_state.dart'; @@ -16,14 +16,13 @@ enum HomeScreenActionButton { class Web3Cubit extends Cubit { Web3Cubit() : super(const Web3State()); - late W3MService w3mService; + late ReownAppKitModal w3mService; bool get isLoggedInViaEmail => w3mService.session?.connectedWalletName == 'Email Wallet'; Future get blockchainExplorer async { - final String blockExplorer = - w3mService.selectedChain?.blockExplorer?.url ?? ''; + final String blockExplorer = w3mService.selectedChain?.explorerUrl ?? ''; final String address = (await deployedGreeterContract).address.toString(); return '$blockExplorer/address/$address'; @@ -31,12 +30,13 @@ class Web3Cubit extends Cubit { Future fetchGreeting() async { try { - await w3mService.selectChain(W3MChainPresets.chains['11155111']); - final List contractData = await w3mService.requestReadContract( + topic: null, + chainId: w3mService.selectedChain!.chainId, deployedContract: await deployedGreeterContract, functionName: greetFunction, ); + emit(FetchGreetingSuccess(message: contractData[0].toString())); } catch (e) { emit( @@ -48,23 +48,23 @@ class Web3Cubit extends Cubit { } } - void _addExtraChains() { - for (final MapEntry entry - in W3MChainPresets.extraChains.entries) { - W3MChainPresets.chains.putIfAbsent(entry.key, () => entry.value); - } - for (final MapEntry entry - in W3MChainPresets.testChains.entries) { - W3MChainPresets.chains.putIfAbsent(entry.key, () => entry.value); - } - } - - Future instantiate() async { + // void _addExtraChains() { + // for (final MapEntry entry + // in ReownAppKitModalNetworks.) { + // ReownAppKitModalNetworks.chains.putIfAbsent(entry.key, () => entry.value); + // } + // for (final MapEntry entry + // in ReownAppKitModalNetworks.testChains.entries) { + // ReownAppKitModalNetworks.chains.putIfAbsent(entry.key, () => entry.value); + // } + // } + + Future instantiate(BuildContext context) async { try { const String url = 'https://github.com/Nuxify/Sophon'; - w3mService = W3MService( - enableEmail: true, - projectId: '2684f2b98f5ae4051dce454b5862b9ff', + w3mService = ReownAppKitModal( + context: context, + projectId: 'ca39991258c8cb8f99a5ff8eae88b6c5', metadata: const PairingMetadata( name: 'Sophon', description: @@ -73,11 +73,12 @@ class Web3Cubit extends Cubit { icons: [ 'https://files-nuximart.sgp1.cdn.digitaloceanspaces.com/nuxify-website/blog/images/Nuxify-logo.png', ], - redirect: Redirect( - universal: url, - native: url, - ), + redirect: Redirect(universal: url, native: url), ), + excludedWalletIds: { + 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', + 'a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393', + }, includedWalletIds: { 'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // metamask '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // trust @@ -88,8 +89,17 @@ class Web3Cubit extends Cubit { '84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04', // blockchain.com }, ); - _addExtraChains(); await w3mService.init(); + await w3mService.selectChain( + ReownAppKitModalNetworkInfo( + chainId: '11155111', + name: 'Sepolia', + currency: 'ETH', + rpcUrl: 'https://1rpc.io/sepolia', + explorerUrl: 'https://sepolia.etherscan.io/', + ), + ); + fetchHomeScreenActionButton(); if (!w3mService.isConnected) { listenToWalletConnection(); @@ -128,12 +138,11 @@ class Web3Cubit extends Cubit { w3mService.launchConnectedWallet(); await w3mService.requestWriteContract( - chainId: 'eip155:${dotenv.get('ETHEREUM_CHAIN_ID')}', + chainId: w3mService.selectedChain!.chainId, topic: w3mService.session?.topic ?? '', deployedContract: await deployedGreeterContract, functionName: setGreetingFunction, parameters: [text], - method: setGreetingFunction, transaction: Transaction( from: EthereumAddress.fromHex(sender), ), diff --git a/lib/core/application/service/cubit/web3_state.dart b/lib/core/application/service/cubit/web3_state.dart index 85c09bf..cdf99e6 100644 --- a/lib/core/application/service/cubit/web3_state.dart +++ b/lib/core/application/service/cubit/web3_state.dart @@ -40,7 +40,7 @@ class UpdateGreetingFailed extends Web3State { class InitializeWeb3MSuccess extends Web3State { const InitializeWeb3MSuccess({required this.service}); - final W3MService service; + final ReownAppKitModal service; } class InitializeWeb3MFailed extends Web3State {} @@ -64,7 +64,9 @@ class WalletConnectionFailed extends Web3State { } class FetchHomeScreenActionButtonSuccess extends Web3State { - const FetchHomeScreenActionButtonSuccess({required this.action}); + const FetchHomeScreenActionButtonSuccess({ + required this.action, + }); final HomeScreenActionButton action; } diff --git a/lib/core/module/auth/interfaces/screens/authentication_screen.dart b/lib/core/module/auth/interfaces/screens/authentication_screen.dart index d21384b..fdeca6d 100644 --- a/lib/core/module/auth/interfaces/screens/authentication_screen.dart +++ b/lib/core/module/auth/interfaces/screens/authentication_screen.dart @@ -1,9 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:sophon/core/application/service/cubit/web3_cubit.dart'; import 'package:sophon/core/module/home/interfaces/screens/home_screen.dart'; import 'package:sophon/gen/assets.gen.dart'; -import 'package:sophon/internal/utils.dart'; class AuthenticationScreen extends StatefulWidget { const AuthenticationScreen({super.key}); @@ -16,65 +13,57 @@ class _AuthenticationScreenState extends State { @override void initState() { super.initState(); - context.read().instantiate(); + Future.delayed(const Duration(seconds: 2), () { + if (mounted) { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (_) => const HomeScreen(), + ), + ); + } + }); } @override Widget build(BuildContext context) { final double width = MediaQuery.of(context).size.width; - return BlocListener( - listenWhen: (Web3State previous, Web3State current) => - current is InitializeWeb3MSuccess || - current is WalletConnectionFailed, - listener: (BuildContext context, Web3State state) { - if (state is InitializeWeb3MSuccess) { - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (_) => HomeScreen(w3mService: state.service), - ), - ); - } else if (state is WalletConnectionFailed) { - showSnackbar(context, isSuccessful: false, message: state.message); - } - }, - child: Scaffold( - backgroundColor: Colors.black, - body: SafeArea( - child: Padding( - padding: const EdgeInsets.only( - top: 20, - left: 25, - right: 25, - bottom: 30, - ), - child: Column( - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Assets.images.space.image(width: width * 0.8), - const Text( - 'Sophon', - style: TextStyle(fontSize: 20, color: Colors.white), - ), - ], - ), - ), - const Padding( - padding: EdgeInsets.only(bottom: 20), - child: Text( - 'Interact with a Smart Contract by connecting your wallet', - style: TextStyle( - fontSize: 28, - color: Colors.white, + return Scaffold( + backgroundColor: Colors.black, + body: SafeArea( + child: Padding( + padding: const EdgeInsets.only( + top: 20, + left: 25, + right: 25, + bottom: 30, + ), + child: Column( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Assets.images.space.image(width: width * 0.8), + const Text( + 'Sophon', + style: TextStyle(fontSize: 20, color: Colors.white), ), + ], + ), + ), + const Padding( + padding: EdgeInsets.only(bottom: 20), + child: Text( + 'Interact with a Smart Contract by connecting your wallet', + style: TextStyle( + fontSize: 28, + color: Colors.white, ), ), - ], - ), + ), + ], ), ), ), diff --git a/lib/core/module/home/interfaces/screens/home_screen.dart b/lib/core/module/home/interfaces/screens/home_screen.dart index 9b1f2cd..4eadeb6 100644 --- a/lib/core/module/home/interfaces/screens/home_screen.dart +++ b/lib/core/module/home/interfaces/screens/home_screen.dart @@ -1,21 +1,21 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:nuxify_widgetbook/input/filled_textfield.dart'; import 'package:nuxify_widgetbook/views/alert_dialog.dart'; +import 'package:reown_appkit/reown_appkit.dart'; import 'package:shimmer/shimmer.dart'; import 'package:sophon/configs/themes.dart'; import 'package:sophon/core/application/service/cubit/web3_cubit.dart'; import 'package:sophon/core/module/auth/interfaces/screens/authentication_screen.dart'; import 'package:sophon/gen/fonts.gen.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:web3modal_flutter/web3modal_flutter.dart'; class HomeScreen extends StatefulWidget { - const HomeScreen({required this.w3mService, super.key}); - final W3MService w3mService; + const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); @@ -23,8 +23,11 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { final TextEditingController greetingTextController = TextEditingController(); + late Timer timer; + ReownAppKitModal? w3mService; + void startContractReadInterval() { timer = Timer.periodic(const Duration(seconds: 5), (_) { context.read().fetchGreeting(); @@ -34,10 +37,9 @@ class _HomeScreenState extends State { @override void initState() { super.initState(); - context.read().fetchGreeting(); - context.read().fetchHomeScreenActionButton(); - - startContractReadInterval(); + SchedulerBinding.instance.addPostFrameCallback( + (_) => context.read().instantiate(context), + ); } @override @@ -51,304 +53,331 @@ class _HomeScreenState extends State { final double width = MediaQuery.of(context).size.width; final double height = MediaQuery.of(context).size.height; - return Scaffold( - backgroundColor: Colors.black, - appBar: AppBar( - backgroundColor: kPink, - elevation: 0, - title: const Text('Sophon'), - centerTitle: true, - automaticallyImplyLeading: false, - ), - body: SafeArea( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: width, - margin: const EdgeInsets.only( - top: 20, - left: 25, - right: 25, - bottom: 30, - ), - padding: EdgeInsets.symmetric( - vertical: height * 0.03, - horizontal: width * 0.05, - ), - decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.circular(10), - border: Border.all(color: kPink.withOpacity(0.5)), - ), - child: BlocBuilder( - buildWhen: (Web3State previous, Web3State current) => - current is FetchGreetingSuccess || - current is FetchGreetingFailed || - current is FetchGreetingLoading, - builder: (BuildContext context, Web3State state) { - if (state is FetchGreetingSuccess) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RichText( - text: TextSpan( - children: [ - const TextSpan( - text: 'Greeter Smart Contract at:\n\n', + return BlocListener( + listenWhen: (Web3State previous, Web3State current) => + current is InitializeWeb3MSuccess || + current is FetchHomeScreenActionButtonSuccess, + listener: (BuildContext context, Web3State state) { + if (state is InitializeWeb3MSuccess) { + setState(() => w3mService = state.service); + + context.read().fetchHomeScreenActionButton(); + } else if (state is FetchHomeScreenActionButtonSuccess && + state.action == HomeScreenActionButton.writeToContract) { + setState(() {}); + context.read().fetchGreeting(); + startContractReadInterval(); + } + }, + child: Scaffold( + backgroundColor: Colors.black, + appBar: AppBar( + backgroundColor: kPink, + elevation: 0, + title: const Text('Sophon'), + centerTitle: true, + automaticallyImplyLeading: false, + ), + body: SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Visibility( + visible: w3mService != null && w3mService!.isConnected, + child: Container( + width: width, + margin: const EdgeInsets.only( + top: 20, + left: 25, + right: 25, + bottom: 30, + ), + padding: EdgeInsets.symmetric( + vertical: height * 0.03, + horizontal: width * 0.05, + ), + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(10), + border: Border.all(color: kPink.withValues(alpha: 0.5)), + ), + child: BlocBuilder( + buildWhen: (Web3State previous, Web3State current) => + current is FetchGreetingSuccess || + current is FetchGreetingFailed || + current is FetchGreetingLoading, + builder: (BuildContext context, Web3State state) { + if (state is FetchGreetingSuccess) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RichText( + text: TextSpan( + children: [ + const TextSpan( + text: 'Greeter Smart Contract at:\n\n', + ), + TextSpan( + text: + dotenv.get('GREETER_CONTRACT_ADDRESS'), + style: const TextStyle( + color: kPink, + decoration: TextDecoration.underline, + ), + ), + const TextSpan(text: '\n\nCurrently says:\n'), + ], + style: const TextStyle( + fontFamily: FontFamily.openSans, + fontSize: 14, + ), ), - TextSpan( - text: dotenv.get('GREETER_CONTRACT_ADDRESS'), + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text( + '"${state.message}"', style: const TextStyle( - color: kPink, - decoration: TextDecoration.underline, + fontStyle: FontStyle.italic, + fontSize: 16, ), ), - const TextSpan(text: '\n\nCurrently says:\n'), - ], - style: const TextStyle( - fontFamily: FontFamily.openSans, - fontSize: 14, ), + ], + ); + } + return Shimmer.fromColors( + baseColor: shimmerBase, + highlightColor: shimmerGlow, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(11), + color: Colors.white, ), + width: MediaQuery.of(context).size.width, + height: 45, ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Text( - '"${state.message}"', - style: const TextStyle( - fontStyle: FontStyle.italic, - fontSize: 16, + ); + }, + ), + ), + ), + Container( + color: Colors.white10, + padding: + const EdgeInsets.symmetric(horizontal: 10, vertical: 8), + child: Column( + children: [ + Container( + width: width, + padding: const EdgeInsets.symmetric(vertical: 4), + child: FilledButton.icon( + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all(kPink), + shape: WidgetStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(11), ), ), ), - ], - ); - } - return Shimmer.fromColors( - baseColor: shimmerBase, - highlightColor: shimmerGlow, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11), - color: Colors.white, - ), - width: MediaQuery.of(context).size.width, - height: 45, - ), - ); - }, - ), - ), - Container( - color: Colors.white10, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), - child: Column( - children: [ - Container( - width: width, - padding: const EdgeInsets.symmetric(vertical: 4), - child: FilledButton.icon( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(kPink), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(11), - ), + onPressed: () async { + final String blockchainExplorer = await context + .read() + .blockchainExplorer; + await launchUrl(Uri.parse(blockchainExplorer)); + }, + label: const Icon( + Icons.launch_rounded, + color: Colors.white, + size: 17, + ), + icon: const Text( + 'Launch Block Explorer', + style: TextStyle(color: Colors.white), ), - ), - onPressed: () async { - final String blockchainExplorer = - await context.read().blockchainExplorer; - await launchUrl(Uri.parse(blockchainExplorer)); - }, - label: const Icon( - Icons.launch_rounded, - color: Colors.white, - size: 17, - ), - icon: const Text( - 'Launch Block Explorer', - style: TextStyle(color: Colors.white), ), ), - ), - BlocBuilder( - buildWhen: (Web3State previous, Web3State current) => - current is FetchHomeScreenActionButtonSuccess, - builder: (BuildContext context, Web3State state) { - if (state is FetchHomeScreenActionButtonSuccess && - state.action == - HomeScreenActionButton.upgradeWallet) { - return SizedBox( - width: double.infinity, - child: FilledButton( - onPressed: () => launchUrl( - Uri.parse( - 'https://secure.walletconnect.com/dashboard', - ), - ), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(kPink), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(11), + BlocBuilder( + buildWhen: (Web3State previous, Web3State current) => + current is FetchHomeScreenActionButtonSuccess, + builder: (BuildContext context, Web3State state) { + if (state is FetchHomeScreenActionButtonSuccess && + state.action == + HomeScreenActionButton.upgradeWallet) { + return SizedBox( + width: double.infinity, + child: FilledButton( + onPressed: () => launchUrl( + Uri.parse( + 'https://secure.walletconnect.com/dashboard', ), ), - ), - child: const Padding( - padding: EdgeInsets.symmetric(vertical: 12), - child: Text( - 'Upgrade Wallet', - style: TextStyle( - color: Colors.white, - ), - ), - ), - ), - ); - } else if (state is FetchHomeScreenActionButtonSuccess && - state.action == - HomeScreenActionButton.connectWallet) { - return W3MConnectWalletButton( - context: context, - service: widget.w3mService, - custom: SizedBox( - width: width, - child: FilledButton.icon( - onPressed: () => - widget.w3mService.openModal(context), style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(kPink), - shape: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all(kPink), + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(11), ), ), ), - icon: const Text( - 'Connect Wallet', - style: TextStyle(color: Colors.white), - ), - label: const Icon( - Icons.chevron_right, - color: Colors.white, + child: const Padding( + padding: EdgeInsets.symmetric(vertical: 12), + child: Text( + 'Upgrade Wallet', + style: TextStyle( + color: Colors.white, + ), + ), ), ), - ), - ); - } else if (state is FetchHomeScreenActionButtonSuccess && - state.action == - HomeScreenActionButton.writeToContract) { - return Column( - children: [ - Container( + ); + } else if (state + is FetchHomeScreenActionButtonSuccess && + state.action == + HomeScreenActionButton.connectWallet) { + return AppKitModalConnectButton( + context: context, + appKit: w3mService!, + custom: SizedBox( width: width, - padding: const EdgeInsets.only(bottom: 8, top: 4), child: FilledButton.icon( + onPressed: () => w3mService!.openModalView(), style: ButtonStyle( backgroundColor: - MaterialStateProperty.all(kPink), - shape: MaterialStateProperty.all( + WidgetStateProperty.all(kPink), + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(11), ), ), ), - onPressed: () { - showDialog( - context: context, - builder: (_) => AppAlertDialog( - title: 'Disconnect Wallet', - bodyText: - 'Are you sure you want to disconnect your wallet?', - actionButton: FilledButton( - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(kPink), - ), - onPressed: () { - context - .read() - .endSession(); - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (_) => - const AuthenticationScreen(), - ), - ); - }, - child: const Text( - 'Confirm', - style: TextStyle(color: Colors.white), - ), - ), - ), - ); - }, - label: const Icon( - Icons.close, - color: Colors.white, - size: 17, - ), icon: const Text( - 'Disconnect Wallet', + 'Connect Wallet', style: TextStyle(color: Colors.white), ), + label: const Icon( + Icons.chevron_right, + color: Colors.white, + ), ), ), - Row( - children: [ - Expanded( - child: FilledTextField( - borderRadius: 8, - hintText: 'Update the contract...', - hintStyle: const TextStyle( - color: Colors.white30, - fontSize: 13, - ), - controller: greetingTextController, - fillColor: Colors.white.withOpacity(0.05), - isDense: true, - ), - ), - IconButton.filled( - color: kPink, - focusColor: kPink, - highlightColor: kPink, - hoverColor: kPink, - splashColor: kPink, - disabledColor: kPink, + ); + } else if (state + is FetchHomeScreenActionButtonSuccess && + state.action == + HomeScreenActionButton.writeToContract) { + return Column( + children: [ + Container( + width: width, + padding: + const EdgeInsets.only(bottom: 8, top: 4), + child: FilledButton.icon( style: ButtonStyle( backgroundColor: - MaterialStateProperty.all(kPink), + WidgetStateProperty.all(kPink), + shape: WidgetStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(11), + ), + ), ), onPressed: () { - context.read().updateGreeting( - text: greetingTextController.text, - ); - greetingTextController.text = ''; + showDialog( + context: context, + builder: (_) => AppAlertDialog( + title: 'Disconnect Wallet', + bodyText: + 'Are you sure you want to disconnect your wallet?', + actionButton: FilledButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(kPink), + ), + onPressed: () { + context + .read() + .endSession(); + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (_) => + const AuthenticationScreen(), + ), + ); + }, + child: const Text( + 'Confirm', + style: + TextStyle(color: Colors.white), + ), + ), + ), + ); }, - icon: const Icon( - Icons.send_rounded, + label: const Icon( + Icons.close, color: Colors.white, + size: 17, + ), + icon: const Text( + 'Disconnect Wallet', + style: TextStyle(color: Colors.white), ), ), - ], - ), - ], - ); - } - return const SizedBox(child: LinearProgressIndicator()); - }, - ), - ], + ), + Row( + children: [ + Expanded( + child: FilledTextField( + borderRadius: 8, + hintText: 'Update the contract...', + hintStyle: const TextStyle( + color: Colors.white30, + fontSize: 13, + ), + controller: greetingTextController, + fillColor: + Colors.white.withValues(alpha: 0.05), + isDense: true, + ), + ), + IconButton.filled( + color: kPink, + focusColor: kPink, + highlightColor: kPink, + hoverColor: kPink, + splashColor: kPink, + disabledColor: kPink, + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(kPink), + ), + onPressed: () { + context.read().updateGreeting( + text: greetingTextController.text, + ); + greetingTextController.text = ''; + }, + icon: const Icon( + Icons.send_rounded, + color: Colors.white, + ), + ), + ], + ), + ], + ); + } + return const SizedBox(child: LinearProgressIndicator()); + }, + ), + ], + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/main.dart b/lib/main.dart index 83c0cf5..84bea73 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; +import 'package:reown_appkit/reown_appkit.dart'; import 'package:sophon/configs/themes.dart'; import 'package:sophon/core/application/service/cubit/secure_storage_cubit.dart'; import 'package:sophon/core/application/service/cubit/web3_cubit.dart'; import 'package:sophon/core/infrastructures/repository/secure_storage_repository.dart'; import 'package:sophon/core/module/auth/application/service/cubit/auth_cubit.dart'; import 'package:sophon/core/module/auth/interfaces/screens/authentication_screen.dart'; -import 'package:web3modal_flutter/web3modal_flutter.dart'; Future main() async { /// Load env file @@ -37,7 +37,7 @@ class MyApp extends StatelessWidget { ), ), ], - child: Web3ModalTheme( + child: ReownAppKitModalTheme( isDarkMode: true, child: MaterialApp( title: 'Sophon', @@ -50,14 +50,9 @@ class MyApp extends StatelessWidget { } } -class MyHomePage extends StatefulWidget { +class MyHomePage extends StatelessWidget { const MyHomePage({super.key}); - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { @override Widget build(BuildContext context) { return const AuthenticationScreen(); diff --git a/pubspec.lock b/pubspec.lock index 1fb92d5..6fdb1a9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,15 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "76.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" adaptive_number: dependency: transitive description: @@ -21,10 +26,10 @@ packages: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.11.0" ansicolor: dependency: transitive description: @@ -37,10 +42,10 @@ packages: dependency: transitive description: name: appcheck - sha256: "0fcbe15b6bba67027c6f94bd177b9b319e019b51e0b49e9cd80486448c4a1909" + sha256: "531ae96307c7362ceeeb92ab6ec229cca937ce1bda63f2a7d0319f91958df09e" url: "https://pub.dev" source: hosted - version: "1.5.2" + version: "1.5.3" archive: dependency: transitive description: @@ -125,10 +130,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.3" build_resolvers: dependency: transitive description: @@ -141,18 +146,18 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" + sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" url: "https://pub.dev" source: hosted - version: "2.4.9" + version: "2.4.14" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "8.0.0" built_collection: dependency: transitive description: @@ -173,26 +178,26 @@ packages: dependency: transitive description: name: cached_network_image - sha256: "4a5d8d2c728b0f3d0245f69f921d7be90cae4c2fd5288f773088672c0893f819" + sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" url: "https://pub.dev" source: hosted - version: "3.4.0" + version: "3.4.1" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - sha256: ff0c949e323d2a1b52be73acce5b4a7b04063e61414c8ca542dbba47281630a7 + sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.1.1" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: "6322dde7a5ad92202e64df659241104a43db20ed594c41ca18de1014598d7996" + sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" characters: dependency: transitive description: @@ -237,18 +242,18 @@ packages: dependency: transitive description: name: coinbase_wallet_sdk - sha256: "4a309b22d1d8647ab4381ac075921dba211ac642f58b2ca06c0c1fb8f58973da" + sha256: c51f3c54c728a6bdaec346de2ce4a3b6498f099a030772b7df22b058a1bad884 url: "https://pub.dev" source: hosted - version: "1.0.9" + version: "1.0.10" collection: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" color: dependency: transitive description: @@ -257,14 +262,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: "8a68739d3ee113e51ad35583fdf9ab82c55d09d693d3c39da1aebab87c938412" + url: "https://pub.dev" + source: hosted + version: "6.1.2" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.dev" + source: hosted + version: "2.0.1" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" coverage: dependency: transitive description: @@ -309,18 +330,18 @@ packages: dependency: transitive description: name: custom_sliding_segmented_control - sha256: "53c3e931c3ae1f696085d1ec70ac8e934da836595a9b7d9b88fdd0fcbf2a5574" + sha256: bc747b1500284bff36fc8c61774c9a3ca35c1dca4d570141c8a2569b4f984bf3 url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.8.5" dart_style: dependency: transitive description: name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.3.8" dartx: dependency: transitive description: @@ -329,6 +350,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" diff_match_patch: dependency: transitive description: @@ -365,10 +394,10 @@ packages: dependency: transitive description: name: event - sha256: eb4814de94cbf6a10da9c4f652bc654087d7066e33566b5036822e6c0b24befb + sha256: "5809a742e6274146a23d9cba63c24caf2f4c87a9a781fdf16ef07f052becaf72" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.1.0" fake_async: dependency: transitive description: @@ -418,10 +447,10 @@ packages: dependency: transitive description: name: flutter_cache_manager - sha256: a77f77806a790eb9ba0118a5a3a936e81c4fea2b61533033b2b0c3d50bbde5ea + sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" url: "https://pub.dev" source: hosted - version: "3.4.0" + version: "3.4.1" flutter_dotenv: dependency: "direct main" description: @@ -522,10 +551,10 @@ packages: dependency: transitive description: name: flutter_svg - sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b url: "https://pub.dev" source: hosted - version: "2.0.10+1" + version: "2.0.17" flutter_test: dependency: "direct dev" description: flutter @@ -552,6 +581,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" glob: dependency: transitive description: @@ -668,26 +705,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" lint: dependency: "direct dev" description: @@ -700,10 +737,10 @@ packages: dependency: transitive description: name: logger - sha256: "697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32" + sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.5.0" logging: dependency: transitive description: @@ -712,6 +749,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.dev" + source: hosted + version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -724,18 +769,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.15.0" mime: dependency: transitive description: @@ -748,10 +793,10 @@ packages: dependency: transitive description: name: mobile_scanner - sha256: b8c0e9afcfd52534f85ec666f3d52156f560b5e6c25b1e3d4fe2087763607926 + sha256: d234581c090526676fd8fab4ada92f35c6746e3fb4f05a399665d75a399fb760 url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "5.2.3" mocktail: dependency: "direct dev" description: @@ -768,6 +813,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" node_preamble: dependency: transitive description: @@ -805,18 +858,18 @@ packages: dependency: transitive description: name: package_info_plus - sha256: "2c582551839386fa7ddbc7770658be7c0f87f388a4bff72066478f597c34d17f" + sha256: b15fad91c4d3d1f2b48c053dd41cb82da007c27407dc9ab5f9aa59881d0e39d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "8.1.4" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" path: dependency: transitive description: @@ -961,6 +1014,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.3" + reown_appkit: + dependency: "direct main" + description: + name: reown_appkit + sha256: "4760e8ca6ed9a75dea60659806cb8f0ca088c812324e2e7960a99026e95f07a6" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + reown_core: + dependency: transitive + description: + name: reown_core + sha256: "11d2e74c9c007ea1e89b036c5e3a22512328aaaffc268d864e6c6bf5ac5c975c" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + reown_sign: + dependency: transitive + description: + name: reown_sign + sha256: a2e2a21d0e9013831c95d0b8e2a307fff075af00eb680105826c504f28c82d6a + url: "https://pub.dev" + source: hosted + version: "1.1.1" rxdart: dependency: transitive description: @@ -981,26 +1058,26 @@ packages: dependency: transitive description: name: shared_preferences - sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + sha256: "688ee90fbfb6989c980254a56cb26ebe9bb30a3a2dff439a78894211f73de67a" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.5.1" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2" + sha256: "650584dcc0a39856f369782874e562efd002a9c94aec032412c9eb81419cce1f" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.4.4" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "776786cff96324851b656777648f36ac772d88bc4c669acff97b7fce5de3c849" + sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.5.3" shared_preferences_linux: dependency: transitive description: @@ -1061,10 +1138,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" shimmer: dependency: "direct main" description: @@ -1077,7 +1154,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1146,10 +1223,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -1170,10 +1247,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" synchronized: dependency: transitive description: @@ -1194,26 +1271,26 @@ packages: dependency: transitive description: name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.24.9" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.6.5" time: dependency: transitive description: @@ -1250,10 +1327,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.3.1" url_launcher_android: dependency: transitive description: @@ -1314,18 +1391,18 @@ packages: dependency: transitive description: name: uuid - sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "4.4.2" + version: "4.5.1" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + sha256: "7ed22c21d7fdcc88dd6ba7860384af438cd220b251ad65dfc142ab722fabef61" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.16" vector_graphics_codec: dependency: transitive description: @@ -1338,10 +1415,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.16" vector_math: dependency: transitive description: @@ -1354,10 +1431,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.3.0" wallet: dependency: transitive description: @@ -1366,14 +1443,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.13" - walletconnect_flutter_v2: - dependency: transitive - description: - name: walletconnect_flutter_v2 - sha256: "4a77de8d33f5d1f6b6ae07d4d2f7bf591ddb6c4cd671bf7493100798d92fa4d3" - url: "https://pub.dev" - source: hosted - version: "2.3.0" watcher: dependency: transitive description: @@ -1386,10 +1455,10 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "1.1.0" web3dart: dependency: "direct main" description: @@ -1398,22 +1467,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.7.3" - web3modal_flutter: - dependency: "direct main" + web_socket: + dependency: transitive description: - name: web3modal_flutter - sha256: "4d24d458ebbf19ef49ac2b094882e8e6327d3c667cb48b168769277fc3d4f20e" + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "3.0.2" webkit_inspection_protocol: dependency: transitive description: @@ -1426,18 +1495,18 @@ packages: dependency: transitive description: name: webview_flutter - sha256: "6869c8786d179f929144b4a1f86e09ac0eddfe475984951ea6c634774c16b522" + sha256: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec" url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.10.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "0d21cfc3bfdd2e30ab2ebeced66512b91134b39e72e97b43db2d47dda1c4e53a" + sha256: "5568f17a9c25c0fdd0737900fa1c2d1fee2d780bc212d9aec10c2d1f48ef0f59" url: "https://pub.dev" source: hosted - version: "3.16.3" + version: "4.3.1" webview_flutter_platform_interface: dependency: transitive description: @@ -1450,18 +1519,18 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb" + sha256: "8e0593559bfecd35eb1757d6907ed6b995a41ef82607d6113df897c2805ce6be" url: "https://pub.dev" source: hosted - version: "3.14.0" + version: "3.18.0" win32: dependency: transitive description: name: win32 - sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.5.4" x25519: dependency: transitive description: @@ -1495,5 +1564,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.19.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index f7cf310..4666be8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 2.4.0 environment: - sdk: '>=3.2.3 <4.0.0' + sdk: '>=3.4.0 <4.0.0' dependencies: flutter: @@ -18,14 +18,14 @@ dependencies: git: url: git@github.com:Nuxify/widgetbook.git ref: v1.0.0 + reown_appkit: ^1.3.0 shimmer: ^3.0.0 url_launcher: ^6.3.0 web3dart: ^2.7.1 - web3modal_flutter: 3.3.0 dev_dependencies: bloc_test: ^9.1.0 - build_runner: ^2.4.9 + build_runner: ^2.4.14 flutter_gen_runner: ^5.4.0 flutter_launcher_icons: ^0.13.1 flutter_native_splash: ^2.4.0 From 196ac364e74162372bca8d3c86dcfda40d351c05 Mon Sep 17 00:00:00 2001 From: Joses Gabriel Date: Tue, 4 Feb 2025 13:50:34 +0800 Subject: [PATCH 2/4] feat(core): improved loading indicator UI --- .../home/interfaces/screens/home_screen.dart | 7 +- pubspec.lock | 350 ++++++++++-------- pubspec.yaml | 7 +- 3 files changed, 195 insertions(+), 169 deletions(-) diff --git a/lib/core/module/home/interfaces/screens/home_screen.dart b/lib/core/module/home/interfaces/screens/home_screen.dart index 4eadeb6..1296a7d 100644 --- a/lib/core/module/home/interfaces/screens/home_screen.dart +++ b/lib/core/module/home/interfaces/screens/home_screen.dart @@ -4,8 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:nuxify_widgetbook/input/filled_textfield.dart'; -import 'package:nuxify_widgetbook/views/alert_dialog.dart'; +import 'package:nuxify_widgetbook_core/indicators/widget_loader.dart'; +import 'package:nuxify_widgetbook_core/input/filled_textfield.dart'; +import 'package:nuxify_widgetbook_core/views/alert_dialog.dart'; import 'package:reown_appkit/reown_appkit.dart'; import 'package:shimmer/shimmer.dart'; import 'package:sophon/configs/themes.dart'; @@ -370,7 +371,7 @@ class _HomeScreenState extends State { ], ); } - return const SizedBox(child: LinearProgressIndicator()); + return const CardLoader(height: 36); }, ), ], diff --git a/pubspec.lock b/pubspec.lock index 6fdb1a9..07b35a4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -34,10 +34,10 @@ packages: dependency: transitive description: name: ansicolor - sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" + sha256: "50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" appcheck: dependency: transitive description: @@ -50,18 +50,18 @@ packages: dependency: transitive description: name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + sha256: "6199c74e3db4fbfbd04f66d739e72fe11c8a8957d5f219f1f4482dbde6420b5a" url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "4.0.2" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" async: dependency: transitive description: @@ -114,18 +114,18 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: @@ -138,10 +138,10 @@ packages: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" build_runner: dependency: "direct dev" description: @@ -170,10 +170,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" url: "https://pub.dev" source: hosted - version: "8.9.2" + version: "8.9.3" cached_network_image: dependency: transitive description: @@ -218,10 +218,10 @@ packages: dependency: transitive description: name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.4.1" + version: "0.4.2" clock: dependency: transitive description: @@ -234,10 +234,10 @@ packages: dependency: transitive description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" coinbase_wallet_sdk: dependency: transitive description: @@ -290,18 +290,18 @@ packages: dependency: transitive description: name: coverage - sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" + sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.11.1" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.6" cryptography: dependency: transitive description: @@ -314,10 +314,10 @@ packages: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.2" cupertino_icons: dependency: transitive description: @@ -410,26 +410,26 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -455,10 +455,10 @@ packages: dependency: "direct main" description: name: flutter_dotenv - sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.2.1" flutter_fadein: dependency: "direct main" description: @@ -471,18 +471,18 @@ packages: dependency: transitive description: name: flutter_gen_core - sha256: d8e828ad015a8511624491b78ad8e3f86edb7993528b1613aefbb4ad95947795 + sha256: "46ecf0e317413dd065547887c43f93f55e9653e83eb98dc13dd07d40dd225325" url: "https://pub.dev" source: hosted - version: "5.6.0" + version: "5.8.0" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - sha256: "931b03f77c164df0a4815aac0efc619a6ac8ec4cada55025119fca4894dada90" + sha256: "77f0a02fc30d9fcf2549fe874eb3fde091435724904bcbb1af60aa40cbfab1f4" url: "https://pub.dev" source: hosted - version: "5.6.0" + version: "5.8.0" flutter_launcher_icons: dependency: "direct dev" description: @@ -495,34 +495,34 @@ packages: dependency: "direct dev" description: name: flutter_native_splash - sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0 + sha256: "7062602e0dbd29141fb8eb19220b5871ca650be5197ab9c1f193a28b17537bc7" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.4" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - sha256: "165164745e6afb5c0e3e3fcc72a012fb9e58496fb26ffb92cf22e16a821e85d0" + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" url: "https://pub.dev" source: hosted - version: "9.2.2" + version: "9.2.4" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "4d91bfc23047422cbcd73ac684bc169859ee766482517c22172c86596bf1464b" + sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "1693ab11121a5f925bbea0be725abfcfbbcf36c1e29e571f84a0c0f436147a81" + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -577,10 +577,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "4.0.0" get_it: dependency: transitive description: @@ -593,18 +593,18 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" graphs: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" hashcodes: dependency: transitive description: @@ -617,58 +617,58 @@ packages: dependency: transitive description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.5" http: dependency: "direct main" description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.3.0" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" image: dependency: transitive description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: "8346ad4b5173924b5ddddab782fc7d8a6300178c8b1dc427775405a01701c4a6" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.5.2" image_size_getter: dependency: transitive description: name: image_size_getter - sha256: f98c4246144e9b968899d2dfde69091e22a539bb64bc9b0bea51505fbb490e57 + sha256: "9a299e3af2ebbcfd1baf21456c3c884037ff524316c97d8e56035ea8fdf35653" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.4.0" io: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" js: dependency: transitive description: @@ -689,18 +689,18 @@ packages: dependency: transitive description: name: json_rpc_2 - sha256: "5e469bffa23899edacb7b22787780068d650b106a21c76db3c49218ab7ca447e" + sha256: "246b321532f0e8e2ba474b4d757eaa558ae4fdd0688fdbc1e1ca9705f9b8ca0e" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: ea1432d167339ea9b5bb153f0571d0039607a873d6e04e0117af043f14a1fd4b + sha256: b0a98230538fe5d0b60a22fb6bf1b6cb03471b53e3324ff6069c591679dd59c9 url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "6.9.3" leak_tracker: dependency: transitive description: @@ -745,10 +745,10 @@ packages: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" macros: dependency: transitive description: @@ -785,18 +785,10 @@ packages: dependency: transitive description: name: mime - sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.5" - mobile_scanner: - dependency: transitive - description: - name: mobile_scanner - sha256: d234581c090526676fd8fab4ada92f35c6746e3fb4f05a399665d75a399fb760 - url: "https://pub.dev" - source: hosted - version: "5.2.3" + version: "2.0.0" mocktail: dependency: "direct dev" description: @@ -829,15 +821,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" - nuxify_widgetbook: + nuxify_widgetbook_core: dependency: "direct main" description: - path: "." - ref: "v1.0.0" - resolved-ref: "220ee8f17d04730400637115b5aa0617c443d6e3" - url: "git@github.com:Nuxify/widgetbook.git" + path: core + ref: "v1.7.0" + resolved-ref: "8267f522d9a66f339b4eeeb62a47d23fe65e7141" + url: "https://github.com/Nuxify/widgetbook.git" source: git - version: "0.1.0" + version: "1.5.0" octo_image: dependency: transitive description: @@ -850,26 +842,26 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" package_info_plus: dependency: transitive description: name: package_info_plus - sha256: b15fad91c4d3d1f2b48c053dd41cb82da007c27407dc9ab5f9aa59881d0e39d4 + sha256: c447a3c3e7be4addf129b8f9ab6a4bd5d166b78918223e223b61fddf4d07e254 url: "https://pub.dev" source: hosted - version: "8.1.4" + version: "8.2.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b + sha256: "205ec83335c2ab9107bbba3f8997f9356d72ca3c715d2f038fc773d0366b4c76" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.0" path: dependency: transitive description: @@ -882,34 +874,34 @@ packages: dependency: transitive description: name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" path_provider: dependency: transitive description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.2.15" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" path_provider_linux: dependency: transitive description: @@ -946,10 +938,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -974,6 +966,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + url: "https://pub.dev" + source: hosted + version: "6.0.1" provider: dependency: transitive description: @@ -986,26 +986,26 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" qr: dependency: transitive description: name: qr - sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" + sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" qr_flutter_wc: dependency: transitive description: @@ -1074,10 +1074,10 @@ packages: dependency: transitive description: name: shared_preferences_foundation - sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d" + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.4" shared_preferences_linux: dependency: transitive description: @@ -1098,10 +1098,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: "59dc807b94d29d52ddbb1b3c0d3b9d0a67fc535a64e62a5542c8db0513fcb6c2" + sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" shared_preferences_windows: dependency: transitive description: @@ -1114,10 +1114,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -1130,10 +1130,10 @@ packages: dependency: transitive description: name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.3" shelf_web_socket: dependency: transitive description: @@ -1159,34 +1159,34 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "2.0.0" source_helper: dependency: transitive description: name: source_helper - sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" source_maps: dependency: transitive description: name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" url: "https://pub.dev" source: hosted - version: "0.10.12" + version: "0.10.13" source_span: dependency: transitive description: @@ -1207,18 +1207,42 @@ packages: dependency: transitive description: name: sqflite - sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" url: "https://pub.dev" source: hosted - version: "2.3.3+1" + version: "2.4.1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + url: "https://pub.dev" + source: hosted + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.4+6" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "22adfd9a2c7d634041e96d6241e6e1c8138ca6817018afc5d443fef91dcefa9c" + url: "https://pub.dev" + source: hosted + version: "2.4.1+1" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: @@ -1239,10 +1263,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -1255,10 +1279,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" url: "https://pub.dev" source: hosted - version: "3.1.0+1" + version: "3.3.0+3" term_glyph: dependency: transitive description: @@ -1295,26 +1319,26 @@ packages: dependency: transitive description: name: time - sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" universal_io: dependency: transitive description: @@ -1335,34 +1359,34 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "17cd5e205ea615e2c6ea7a77323a11712dffa0720a8a90540db57a01347f9ad9" + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.3.14" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.2" url_launcher_platform_interface: dependency: transitive description: @@ -1375,18 +1399,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.4" uuid: dependency: transitive description: @@ -1399,18 +1423,18 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "7ed22c21d7fdcc88dd6ba7860384af438cd220b251ad65dfc142ab722fabef61" + sha256: a1870d398158844fe5db12441611ed9a2222ff4340258b539eaf3590c1b4bd7e url: "https://pub.dev" source: hosted - version: "1.1.16" + version: "1.1.17" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.13" vector_graphics_compiler: dependency: transitive description: @@ -1447,10 +1471,10 @@ packages: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" web: dependency: transitive description: @@ -1527,10 +1551,10 @@ packages: dependency: transitive description: name: win32 - sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e url: "https://pub.dev" source: hosted - version: "5.5.4" + version: "5.10.1" x25519: dependency: transitive description: @@ -1543,10 +1567,10 @@ packages: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" xml: dependency: transitive description: @@ -1559,10 +1583,10 @@ packages: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: dart: ">=3.6.0 <4.0.0" - flutter: ">=3.24.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4666be8..846ad15 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,10 +14,11 @@ dependencies: flutter_fadein: ^2.0.0 flutter_secure_storage: ^9.0.0 http: ^1.1.2 - nuxify_widgetbook: + nuxify_widgetbook_core: git: - url: git@github.com:Nuxify/widgetbook.git - ref: v1.0.0 + url: https://github.com/Nuxify/widgetbook.git + path: core + ref: v1.7.0 reown_appkit: ^1.3.0 shimmer: ^3.0.0 url_launcher: ^6.3.0 From 09e6ca31f61d8dfd7b6598080db96854abfdbb36 Mon Sep 17 00:00:00 2001 From: Joses Gabriel Date: Tue, 4 Feb 2025 13:51:13 +0800 Subject: [PATCH 3/4] chore(core): bump version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 846ad15..ea6822c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: sophon description: A new Flutter project. publish_to: 'none' -version: 2.4.0 +version: 3.0.0 environment: sdk: '>=3.4.0 <4.0.0' From 1d46c7fe600246f92c26d4586ad874b597b739bc Mon Sep 17 00:00:00 2001 From: Joses Gabriel Date: Tue, 4 Feb 2025 14:27:20 +0800 Subject: [PATCH 4/4] chore(core): update folder structure --- lib/configs/web3_config.dart | 3 ++- lib/core/application/service/cubit/web3_cubit.dart | 7 +------ .../infrastructures}/contracts/staging/greeter.abi.json | 0 lib/core/module/home/interfaces/screens/home_screen.dart | 1 + lib/internal/enums.dart | 5 +++++ pubspec.yaml | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) rename lib/{ => core/infrastructures}/contracts/staging/greeter.abi.json (100%) create mode 100644 lib/internal/enums.dart diff --git a/lib/configs/web3_config.dart b/lib/configs/web3_config.dart index 653288b..d36bd9c 100644 --- a/lib/configs/web3_config.dart +++ b/lib/configs/web3_config.dart @@ -4,7 +4,8 @@ import 'package:web3dart/web3dart.dart'; /// Get deployed greeter contract Future get deployedGreeterContract async { - const String abiDirectory = 'lib/contracts/staging/greeter.abi.json'; + const String abiDirectory = + 'lib/core/infrastructures/contracts/staging/greeter.abi.json'; final String contractAddress = dotenv.get('GREETER_CONTRACT_ADDRESS'); final String contractABI = await rootBundle.loadString(abiDirectory); diff --git a/lib/core/application/service/cubit/web3_cubit.dart b/lib/core/application/service/cubit/web3_cubit.dart index 6eb7639..5c85282 100644 --- a/lib/core/application/service/cubit/web3_cubit.dart +++ b/lib/core/application/service/cubit/web3_cubit.dart @@ -3,16 +3,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:reown_appkit/reown_appkit.dart'; import 'package:sophon/configs/web3_config.dart'; +import 'package:sophon/internal/enums.dart'; import 'package:sophon/internal/web3_contract.dart'; part 'web3_state.dart'; -enum HomeScreenActionButton { - upgradeWallet, - writeToContract, - connectWallet, -} - class Web3Cubit extends Cubit { Web3Cubit() : super(const Web3State()); diff --git a/lib/contracts/staging/greeter.abi.json b/lib/core/infrastructures/contracts/staging/greeter.abi.json similarity index 100% rename from lib/contracts/staging/greeter.abi.json rename to lib/core/infrastructures/contracts/staging/greeter.abi.json diff --git a/lib/core/module/home/interfaces/screens/home_screen.dart b/lib/core/module/home/interfaces/screens/home_screen.dart index 1296a7d..6f65106 100644 --- a/lib/core/module/home/interfaces/screens/home_screen.dart +++ b/lib/core/module/home/interfaces/screens/home_screen.dart @@ -13,6 +13,7 @@ import 'package:sophon/configs/themes.dart'; import 'package:sophon/core/application/service/cubit/web3_cubit.dart'; import 'package:sophon/core/module/auth/interfaces/screens/authentication_screen.dart'; import 'package:sophon/gen/fonts.gen.dart'; +import 'package:sophon/internal/enums.dart'; import 'package:url_launcher/url_launcher.dart'; class HomeScreen extends StatefulWidget { diff --git a/lib/internal/enums.dart b/lib/internal/enums.dart new file mode 100644 index 0000000..d7b0232 --- /dev/null +++ b/lib/internal/enums.dart @@ -0,0 +1,5 @@ +enum HomeScreenActionButton { + upgradeWallet, + writeToContract, + connectWallet, +} diff --git a/pubspec.yaml b/pubspec.yaml index ea6822c..1de849b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ flutter: assets: - .env - - lib/contracts/staging/greeter.abi.json + - lib/core/infrastructures/contracts/staging/greeter.abi.json - assets/images/