diff --git a/wallet/ios/Runner.xcodeproj/project.pbxproj b/wallet/ios/Runner.xcodeproj/project.pbxproj index 84fdfcbee8..ef740201ca 100644 --- a/wallet/ios/Runner.xcodeproj/project.pbxproj +++ b/wallet/ios/Runner.xcodeproj/project.pbxproj @@ -237,6 +237,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -411,7 +412,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = ""; @@ -549,7 +550,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; @@ -582,7 +583,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = ""; @@ -668,7 +669,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist"; @@ -752,7 +753,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist"; @@ -838,7 +839,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist"; @@ -922,7 +923,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = QV67PMQ8H3; ENABLE_BITCODE = NO; GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist"; diff --git a/wallet/lib/components/buttons/add_friend_button.dart b/wallet/lib/components/buttons/add_friend_button.dart index 00185d943b..37280e5171 100644 --- a/wallet/lib/components/buttons/add_friend_button.dart +++ b/wallet/lib/components/buttons/add_friend_button.dart @@ -6,10 +6,10 @@ class AddFriendButton extends StatelessWidget { final String text; const AddFriendButton({ - Key? key, + super.key, required this.onTap, this.text = "", - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/custom_paint_button.dart b/wallet/lib/components/buttons/custom_paint_button.dart index d6afc82fe7..c9d600a9e7 100644 --- a/wallet/lib/components/buttons/custom_paint_button.dart +++ b/wallet/lib/components/buttons/custom_paint_button.dart @@ -8,7 +8,7 @@ class CustomPaintButton extends StatelessWidget { final Color bgColor; final double width; - const CustomPaintButton({Key? key, required this.onPressed, required this.title, required this.bgColor, required this.width}) : super(key: key); + const CustomPaintButton({super.key, required this.onPressed, required this.title, required this.bgColor, required this.width}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/favorite_button.dart b/wallet/lib/components/buttons/favorite_button.dart index 36002888ad..a06a353108 100644 --- a/wallet/lib/components/buttons/favorite_button.dart +++ b/wallet/lib/components/buttons/favorite_button.dart @@ -5,9 +5,9 @@ class FavoriteButton extends StatelessWidget { final VoidCallback onTap; const FavoriteButton({ - Key? key, + super.key, required this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/more_button.dart b/wallet/lib/components/buttons/more_button.dart index 7e1ba25a4c..ad94995604 100644 --- a/wallet/lib/components/buttons/more_button.dart +++ b/wallet/lib/components/buttons/more_button.dart @@ -8,8 +8,11 @@ class MoreButton extends StatelessWidget { final VoidCallback onTap; final bool showText; - const MoreButton({Key? key, required this.onTap, this.showText = true}) - : super(key: key); + const MoreButton({ + super.key, + required this.onTap, + this.showText = true, + }); @override Widget build(BuildContext context) { @@ -25,7 +28,7 @@ class MoreButton extends StatelessWidget { ) else const SizedBox.shrink(), - Icon( + Icon( Icons.keyboard_arrow_right_rounded, size: kIconSize, color: AppColors.kSelectedIcon, diff --git a/wallet/lib/components/buttons/next_button.dart b/wallet/lib/components/buttons/next_button.dart index e462126bf2..baf87a9e7e 100644 --- a/wallet/lib/components/buttons/next_button.dart +++ b/wallet/lib/components/buttons/next_button.dart @@ -5,9 +5,9 @@ class NextButton extends StatelessWidget { final VoidCallback onTap; const NextButton({ - Key? key, + super.key, required this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/pylons_blue_button_with_loader.dart b/wallet/lib/components/buttons/pylons_blue_button_with_loader.dart index 7122cd7087..1a66685262 100644 --- a/wallet/lib/components/buttons/pylons_blue_button_with_loader.dart +++ b/wallet/lib/components/buttons/pylons_blue_button_with_loader.dart @@ -8,12 +8,12 @@ class PylonsBlueButtonLoading extends StatelessWidget { final bool enabled; const PylonsBlueButtonLoading({ - Key? key, + super.key, required this.onTap, this.text = "", required this.loader, this.enabled = true, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/pylons_get_started_button.dart b/wallet/lib/components/buttons/pylons_get_started_button.dart index 334754d9b0..926f1848af 100644 --- a/wallet/lib/components/buttons/pylons_get_started_button.dart +++ b/wallet/lib/components/buttons/pylons_get_started_button.dart @@ -16,7 +16,7 @@ class PylonsGetStartedButton extends StatelessWidget { final double fontSize; const PylonsGetStartedButton({ - Key? key, + super.key, required this.onTap, this.text = "", required this.loader, @@ -27,7 +27,7 @@ class PylonsGetStartedButton extends StatelessWidget { this.btnHeight = 45, this.btnWidth = 200, this.fontSize = 16, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/buttons/share_button.dart b/wallet/lib/components/buttons/share_button.dart index bb49205b71..a13c1b1a14 100644 --- a/wallet/lib/components/buttons/share_button.dart +++ b/wallet/lib/components/buttons/share_button.dart @@ -5,9 +5,9 @@ class ShareButton extends StatelessWidget { final VoidCallback onTap; const ShareButton({ - Key? key, + super.key, required this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/feedback_text_field.dart b/wallet/lib/components/feedback_text_field.dart index fa4688cc1b..aa9e7f3788 100644 --- a/wallet/lib/components/feedback_text_field.dart +++ b/wallet/lib/components/feedback_text_field.dart @@ -6,17 +6,17 @@ import 'package:pylons_wallet/utils/image_util.dart'; import 'package:pylons_wallet/utils/screen_responsive.dart'; class FeedBackTextField extends StatelessWidget { - const FeedBackTextField( - {Key? key, - required this.label, - this.hint = "", - this.controller, - this.validator, - this.noOfLines = 1, // default to single line - this.inputFormatters = const [], - this.keyboardType = TextInputType.text, - this.textCapitalization = TextCapitalization.none}) - : super(key: key); + const FeedBackTextField({ + super.key, + required this.label, + this.hint = "", + this.controller, + this.validator, + this.noOfLines = 1, // default to single line + this.inputFormatters = const [], + this.keyboardType = TextInputType.text, + this.textCapitalization = TextCapitalization.none, + }); final String label; final String hint; @@ -68,7 +68,11 @@ class FeedBackTextField extends StatelessWidget { height: isOneLine() ? 40.h : 120.h, child: Align( child: TextFormField( - style: TextStyle(fontSize: isOneLine() ? 18.sp : 15.sp, fontWeight: FontWeight.w400, color: AppColors.kTextBlackColor), + style: TextStyle( + fontSize: isOneLine() ? 18.sp : 15.sp, + fontWeight: FontWeight.w400, + color: AppColors.kTextBlackColor, + ), controller: controller, validator: validator, minLines: noOfLines, @@ -93,7 +97,11 @@ class FeedBackTextField extends StatelessWidget { height: isOneLine() ? 32.h : 110.h, child: Align( child: TextFormField( - style: TextStyle(fontSize: isOneLine() ? 16.sp : 14.sp, fontWeight: FontWeight.w400, color: AppColors.kTextBlackColor), + style: TextStyle( + fontSize: isOneLine() ? 16.sp : 14.sp, + fontWeight: FontWeight.w400, + color: AppColors.kTextBlackColor, + ), controller: controller, validator: validator, minLines: noOfLines, diff --git a/wallet/lib/components/image_widgets.dart b/wallet/lib/components/image_widgets.dart index 29551f33ed..a0ce6fddbe 100644 --- a/wallet/lib/components/image_widgets.dart +++ b/wallet/lib/components/image_widgets.dart @@ -5,8 +5,8 @@ const backgroundImage = BackgroundImage(); class BackgroundImage extends StatelessWidget { const BackgroundImage({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/maintenance_mode_widgets.dart b/wallet/lib/components/maintenance_mode_widgets.dart index 4b107bd9eb..dfc06dfe74 100644 --- a/wallet/lib/components/maintenance_mode_widgets.dart +++ b/wallet/lib/components/maintenance_mode_widgets.dart @@ -7,7 +7,7 @@ import '../utils/constants.dart'; class MaintenanceModeBannerWidget extends StatelessWidget { - const MaintenanceModeBannerWidget({Key? key}) : super(key: key); + const MaintenanceModeBannerWidget({super.key}); @override Widget build(BuildContext context) { @@ -24,7 +24,7 @@ class MaintenanceModeBannerWidget extends StatelessWidget { } class MaintenanceModeMessageWidget extends StatelessWidget { - const MaintenanceModeMessageWidget({Key? key}) : super(key: key); + const MaintenanceModeMessageWidget({super.key}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/pylons_blue_button.dart b/wallet/lib/components/pylons_blue_button.dart index 22ca2bd45c..88df3028c8 100644 --- a/wallet/lib/components/pylons_blue_button.dart +++ b/wallet/lib/components/pylons_blue_button.dart @@ -9,11 +9,11 @@ class PylonsBlueButton extends StatelessWidget { final bool fulfilled; const PylonsBlueButton({ - Key? key, + super.key, required this.onTap, this.text = "", this.fulfilled = true, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/pylons_glass.dart b/wallet/lib/components/pylons_glass.dart index 39ab4d244d..adf68ec58e 100644 --- a/wallet/lib/components/pylons_glass.dart +++ b/wallet/lib/components/pylons_glass.dart @@ -10,16 +10,16 @@ class GlassMorphism extends StatelessWidget { final double borderRadius; final double blurLevel; - const GlassMorphism( - {Key? key, - required this.child, - required this.startColor, - required this.startOpacity, - required this.endColor, - required this.endOpacity, - this.borderRadius = 0, - required this.blurLevel}) - : super(key: key); + const GlassMorphism({ + super.key, + required this.child, + required this.startColor, + required this.startOpacity, + required this.endColor, + required this.endOpacity, + this.borderRadius = 0, + required this.blurLevel, + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/pylons_rounded_button.dart b/wallet/lib/components/pylons_rounded_button.dart index 281d45f05c..d3cbcaf6c0 100644 --- a/wallet/lib/components/pylons_rounded_button.dart +++ b/wallet/lib/components/pylons_rounded_button.dart @@ -12,12 +12,12 @@ class PylonsRoundedButton extends StatelessWidget { final Color textColor; const PylonsRoundedButton({ - Key? key, + super.key, this.glyph, required this.onTap, this.textColor = Colors.black, this.text = "", - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/components/pylons_text_input_old.dart b/wallet/lib/components/pylons_text_input_old.dart index f1ad001ea7..9529c8df2f 100644 --- a/wallet/lib/components/pylons_text_input_old.dart +++ b/wallet/lib/components/pylons_text_input_old.dart @@ -2,13 +2,12 @@ import 'package:flutter/material.dart'; class PylonsTextInputOld extends StatelessWidget { const PylonsTextInputOld( - {Key? key, + {super.key, required this.controller, required this.label, this.disabled = false, this.inputType = TextInputType.text, - this.errorText}) - : super(key: key); + this.errorText}); final TextEditingController controller; final String label; diff --git a/wallet/lib/components/pylons_text_input_widget.dart b/wallet/lib/components/pylons_text_input_widget.dart index 810c0fea2c..3cf0d84063 100644 --- a/wallet/lib/components/pylons_text_input_widget.dart +++ b/wallet/lib/components/pylons_text_input_widget.dart @@ -4,14 +4,14 @@ import 'package:pylons_wallet/pages/presenting_onboard_page/components/custom_cl import 'package:pylons_wallet/utils/constants.dart'; class PylonsTextInput extends StatelessWidget { - const PylonsTextInput( - {Key? key, - required this.controller, - required this.label, - this.disabled = false, - this.inputType = TextInputType.text, - this.errorText}) - : super(key: key); + const PylonsTextInput({ + super.key, + required this.controller, + required this.label, + this.disabled = false, + this.inputType = TextInputType.text, + this.errorText, + }); final TextEditingController controller; final String label; diff --git a/wallet/lib/components/user_image_widget.dart b/wallet/lib/components/user_image_widget.dart index 7db30fffdf..769d39f8b5 100644 --- a/wallet/lib/components/user_image_widget.dart +++ b/wallet/lib/components/user_image_widget.dart @@ -18,7 +18,7 @@ import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/image_util.dart'; abstract class UserImageWidget extends StatelessWidget { - const UserImageWidget({Key? key}) : super(key: key); + const UserImageWidget({super.key}); @visibleForTesting ImageProvider getImage(ImageProvider defaultVal, String uriKey) { diff --git a/wallet/lib/ipc/handler/handlers/create_recipe_handler.dart b/wallet/lib/ipc/handler/handlers/create_recipe_handler.dart index a46a2257a2..360047341f 100644 --- a/wallet/lib/ipc/handler/handlers/create_recipe_handler.dart +++ b/wallet/lib/ipc/handler/handlers/create_recipe_handler.dart @@ -40,7 +40,7 @@ class CreateRecipeHandler implements BaseHandler { final nft = await NFT.fromRecipeId(msgObj.cookbookId, msgObj.id); if (nft != null) { - await navigatorKey.currentState!.pushNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: nft); + await navigatorKey.currentState!.pushNamed(Routes.ownerView.name, arguments: nft); } GetIt.I.get().changeTabs(0); diff --git a/wallet/lib/ipc/ipc_engine.dart b/wallet/lib/ipc/ipc_engine.dart index a3853dffdb..1f6d27f59f 100644 --- a/wallet/lib/ipc/ipc_engine.dart +++ b/wallet/lib/ipc/ipc_engine.dart @@ -97,15 +97,15 @@ class IPCEngine { handleEaselLink( link: initialLink, showOwnerView: (nullableNFT) => navigatorKey.currentState!.pushNamed( - RouteUtil.ROUTE_OWNER_VIEW, + Routes.ownerView.name, arguments: nullableNFT, ), showCreateAccountView: (nullableNFT) => navigatorKey.currentState!.pushNamed( - RouteUtil.ROUTE_ACCEPT_POLICY, + Routes.acceptPolicy.name, arguments: nullableNFT, ), showPurchaseView: (nullableNFT) => navigatorKey.currentState!.pushNamed( - RouteUtil.ROUTE_PURCHASE_VIEW, + Routes.purchaseView.name, arguments: nullableNFT, ), getNFtFromRecipe: getNFtFromRecipe, @@ -232,7 +232,7 @@ class IPCEngine { await item.getOwnerAddress(); showLoader.dismiss(); - await navigatorKey.currentState!.pushNamed(RouteUtil.ROUTE_PURCHASE_VIEW, arguments: item); + await navigatorKey.currentState!.pushNamed(Routes.purchaseView.name, arguments: item); walletsStore.setStateUpdatedFlag(flag: true); } @@ -259,7 +259,7 @@ class IPCEngine { if (item == null) { return; } - navigatorKey.currentState!.pushNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: item); + navigatorKey.currentState!.pushNamed(Routes.ownerView.name, arguments: item); walletsStore.setStateUpdatedFlag(flag: true); } diff --git a/wallet/lib/main_development.dart b/wallet/lib/main_development.dart index 09f46f0b66..9b9d8ed424 100644 --- a/wallet/lib/main_development.dart +++ b/wallet/lib/main_development.dart @@ -22,13 +22,17 @@ Future main() async { await EasyLocalization.ensureInitialized(); await Firebase.initializeApp(); + void logMessage(String message) { + FirebaseCrashlytics.instance.log(message); + } + // Read the values from .env file await dotenv.load(fileName: Assets.env.devEnv); await di.init( onLogEvent: (AnalyticsEventEnum event) {}, onLogError: (exception, {bool fatal = false, StackTrace? stack}) { FirebaseCrashlytics.instance.recordError(exception, stack, fatal: fatal); - }, + }, onLogMessage: logMessage, ); isTablet = getIsCurrentDeviceTablet(); @@ -42,7 +46,7 @@ Future main() async { fallbackLocale: const Locale('en'), saveLocale: false, useOnlyLangCode: true, - child: PylonsApp(), + child: PylonsApp(onLogMessage: logMessage), ), ); } \ No newline at end of file diff --git a/wallet/lib/main_local.dart b/wallet/lib/main_local.dart index 82447c8b5e..eabe428abb 100644 --- a/wallet/lib/main_local.dart +++ b/wallet/lib/main_local.dart @@ -16,11 +16,17 @@ Future main() async { await EasyLocalization.ensureInitialized(); // Read the values from .env file await dotenv.load(fileName: Assets.env.localEnv); + + void logMessage(String message) { + FirebaseCrashlytics.instance.log(message); + } + await di.init( onLogEvent: (AnalyticsEventEnum event) {}, onLogError: (exception, {bool fatal = false, StackTrace? stack}) { FirebaseCrashlytics.instance.recordError(exception, stack, fatal: fatal); }, + onLogMessage: logMessage, ); runApp( @@ -30,7 +36,9 @@ Future main() async { fallbackLocale: const Locale('en'), saveLocale: false, useOnlyLangCode: true, - child: PylonsApp()), + child: PylonsApp( + onLogMessage: logMessage, + )), ); } diff --git a/wallet/lib/main_prod.dart b/wallet/lib/main_prod.dart index 6338139d0b..5fc79e3847 100644 --- a/wallet/lib/main_prod.dart +++ b/wallet/lib/main_prod.dart @@ -35,10 +35,13 @@ Future main() async { PlatformDispatcher.instance.onError = (error, stack) { FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); - return true; }; + void logMessage(String message) { + FirebaseCrashlytics.instance.log(message); + } + HttpOverrides.global = MyHttpOverrides(); await initializeAppCheck(); @@ -52,6 +55,7 @@ Future main() async { onLogError: (exception, {bool fatal = false, StackTrace? stack}) { FirebaseCrashlytics.instance.recordError(exception, stack, fatal: fatal); }, + onLogMessage: logMessage, ); Stripe.publishableKey = di.sl().baseStripPubKey; @@ -75,7 +79,7 @@ Future main() async { path: 'i18n', fallbackLocale: const Locale('en'), useOnlyLangCode: true, - child: PylonsApp(), + child: PylonsApp(onLogMessage: logMessage), ), ); }, (error, stack) => FirebaseCrashlytics.instance.recordError(error, stack)); diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index 736f402d40..c391e1dd3f 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -44,7 +44,7 @@ import 'widgets/toggle_button.dart'; class OwnerView extends StatefulWidget { final NFT nft; - const OwnerView({required this.nft, Key? key}) : super(key: key); + const OwnerView({required this.nft, super.key}); @override State createState() => _OwnerViewState(); @@ -84,7 +84,7 @@ class _OwnerViewState extends State { } class OwnerViewContent extends StatefulWidget { - const OwnerViewContent({Key? key}) : super(key: key); + const OwnerViewContent({super.key}); @override State createState() => _OwnerViewContentState(); @@ -194,7 +194,7 @@ class _OwnerViewContentState extends State { } class OwnerBottomDrawer extends StatefulWidget { - const OwnerBottomDrawer({Key? key}) : super(key: key); + const OwnerBottomDrawer({super.key}); @override State createState() => _OwnerBottomDrawerState(); @@ -274,7 +274,7 @@ Widget _title({required NFT nft, required String owner}) { } class _CollapsedBottomMenu extends StatefulWidget { - const _CollapsedBottomMenu({Key? key}) : super(key: key); + const _CollapsedBottomMenu(); @override State<_CollapsedBottomMenu> createState() => _CollapsedBottomMenuState(); @@ -381,7 +381,7 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { } class _ExpandedBottomMenu extends StatefulWidget { - const _ExpandedBottomMenu({Key? key}) : super(key: key); + const _ExpandedBottomMenu(); @override State<_ExpandedBottomMenu> createState() => __ExpandedBottomMenuState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/buy_button.dart b/wallet/lib/pages/detailed_asset_view/widgets/buy_button.dart index 9a67cfdb52..8cbd4c2f14 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/buy_button.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/buy_button.dart @@ -9,7 +9,7 @@ const btcAsset = "assets/images/icons/ico_btc.png"; class BuyButton extends StatelessWidget { final NFT nft; final double usdAmount; - const BuyButton({Key? key, required this.nft, required this.usdAmount}) : super(key: key); + const BuyButton({super.key, required this.nft, required this.usdAmount}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart b/wallet/lib/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart index cdcd458ad2..b530588021 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart @@ -52,7 +52,7 @@ class CreateTradeBottomSheet { class _CreateTradeBottomSheetWidget extends StatefulWidget { final NFT nft; - const _CreateTradeBottomSheetWidget({Key? key, required this.nft}) : super(key: key); + const _CreateTradeBottomSheetWidget({required this.nft}); @override State<_CreateTradeBottomSheetWidget> createState() => __CreateTradeBottomSheetWidgetState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/for_sale_bottom_sheet.dart b/wallet/lib/pages/detailed_asset_view/widgets/for_sale_bottom_sheet.dart index 8268b6083b..2dd74ebca4 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/for_sale_bottom_sheet.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/for_sale_bottom_sheet.dart @@ -47,7 +47,7 @@ class ForSaleBottomSheet { } class _ForSaleBottomSheetWidget extends StatefulWidget { - const _ForSaleBottomSheetWidget({Key? key}) : super(key: key); + const _ForSaleBottomSheetWidget(); @override State<_ForSaleBottomSheetWidget> createState() => _ForSaleBottomSheetWidgetState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/nft_3d_asset.dart b/wallet/lib/pages/detailed_asset_view/widgets/nft_3d_asset.dart index 16ef8a1654..e4775084d6 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/nft_3d_asset.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/nft_3d_asset.dart @@ -13,7 +13,7 @@ class Nft3dWidget extends StatelessWidget { final Color backgroundColor; final bool showLoader; - const Nft3dWidget({Key? key, required this.backgroundColor, required this.url, required this.cameraControls, this.showLoader = false}) : super(key: key); + const Nft3dWidget({super.key, required this.backgroundColor, required this.url, required this.cameraControls, this.showLoader = false}); @override Widget build(BuildContext context) { @@ -36,13 +36,13 @@ class Nft3dWidget extends StatelessWidget { class Nft3DWidgetContent extends StatelessWidget { const Nft3DWidgetContent({ - Key? key, + super.key, required this.backgroundColor, required this.url, required this.cameraControls, required this.viewModel, this.showLoader = false, - }) : super(key: key); + }); final Color backgroundColor; final String url; diff --git a/wallet/lib/pages/detailed_asset_view/widgets/nft_image_asset.dart b/wallet/lib/pages/detailed_asset_view/widgets/nft_image_asset.dart index 5ba01a2096..c700e67996 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/nft_image_asset.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/nft_image_asset.dart @@ -9,7 +9,7 @@ class NftImageWidget extends StatelessWidget { final double opacity; - const NftImageWidget({Key? key, required this.url, required this.opacity}) : super(key: key); + const NftImageWidget({super.key, required this.url, required this.opacity}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/detailed_asset_view/widgets/nft_not_for_sale_dialog.dart b/wallet/lib/pages/detailed_asset_view/widgets/nft_not_for_sale_dialog.dart index cfced507b3..51179a5ce0 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/nft_not_for_sale_dialog.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/nft_not_for_sale_dialog.dart @@ -45,7 +45,7 @@ class NFTNotForSaleDialog { class NFTForSaleConfirmationWidget extends StatefulWidget { final OwnerViewViewModel ownerViewViewModel; - const NFTForSaleConfirmationWidget({Key? key, required this.ownerViewViewModel}) : super(key: key); + const NFTForSaleConfirmationWidget({super.key, required this.ownerViewViewModel}); @override State createState() => _NFTForSaleConfirmationWidgetState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/owner_audio_widget.dart b/wallet/lib/pages/detailed_asset_view/widgets/owner_audio_widget.dart index 6ce4d77325..ab046f8b9e 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/owner_audio_widget.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/owner_audio_widget.dart @@ -11,7 +11,7 @@ import '../../owner_purchase_view_common/progress_bar_state.dart'; class OwnerAudioWidget extends StatefulWidget { final String url; - const OwnerAudioWidget({Key? key, required this.url}) : super(key: key); + const OwnerAudioWidget({super.key, required this.url}); @override _OwnerAudioWidgetState createState() => _OwnerAudioWidgetState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/owner_video_player_screen.dart b/wallet/lib/pages/detailed_asset_view/widgets/owner_video_player_screen.dart index f8f4b556a3..9c4aaab521 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/owner_video_player_screen.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/owner_video_player_screen.dart @@ -12,7 +12,7 @@ import '../../../generated/locale_keys.g.dart'; class OwnerVideoPlayerScreen extends StatefulWidget { final NFT nft; - const OwnerVideoPlayerScreen({Key? key, required this.nft}) : super(key: key); + const OwnerVideoPlayerScreen({super.key, required this.nft}); @override State createState() => _OwnerVideoPlayerScreenState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/owner_video_progress_widget.dart b/wallet/lib/pages/detailed_asset_view/widgets/owner_video_progress_widget.dart index bb7098d5f3..2957202fbb 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/owner_video_progress_widget.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/owner_video_progress_widget.dart @@ -8,7 +8,7 @@ import 'package:video_player/video_player.dart'; class OwnerVideoProgressWidget extends StatefulWidget { final String url; - const OwnerVideoProgressWidget({Key? key, required this.url}) : super(key: key); + const OwnerVideoProgressWidget({super.key, required this.url}); @override _OwnerVideoProgressWidgetState createState() => _OwnerVideoProgressWidgetState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/pdf_placeholder.dart b/wallet/lib/pages/detailed_asset_view/widgets/pdf_placeholder.dart index 607e4ab8e7..c2f46261b3 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/pdf_placeholder.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/pdf_placeholder.dart @@ -11,11 +11,11 @@ class PdfPlaceHolder extends StatelessWidget { final String thumbnailUrl; const PdfPlaceHolder({ - Key? key, + super.key, required this.nftUrl, required this.nftName, required this.thumbnailUrl, - }) : super(key: key); + }); Widget getPdfThumbnailFromUrl() { return Stack( diff --git a/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer.dart b/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer.dart index 6fcbcf7d49..75b4360d41 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer.dart @@ -13,7 +13,7 @@ import 'package:pylons_wallet/utils/route_util.dart'; class PdfViewer extends StatefulWidget { final String? fileUrl; - const PdfViewer({Key? key, this.fileUrl}) : super(key: key); + const PdfViewer({super.key, this.fileUrl}); @override State createState() => _PdfViewerState(); @@ -79,7 +79,7 @@ class _PdfViewerState extends State { child: InkWell( onTap: () { Navigator.of(context) - .pushNamed(RouteUtil.ROUTE_PDF_FULL_SCREEN, arguments: [doc]); + .pushNamed(Routes.pdfFullScreen.name, arguments: [doc]); }, child: Container( width: 30.w, diff --git a/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart b/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart index 0b1014a9df..fcb44379c8 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart @@ -10,8 +10,8 @@ import 'package:pylons_wallet/utils/image_util.dart'; class PdfViewerFullScreen extends StatefulWidget { const PdfViewerFullScreen({ - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => _PdfViewerFullScreenState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/swipe_right_to_sell_button.dart b/wallet/lib/pages/detailed_asset_view/widgets/swipe_right_to_sell_button.dart index 46bc2f02f8..e2c5cef035 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/swipe_right_to_sell_button.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/swipe_right_to_sell_button.dart @@ -14,13 +14,13 @@ class SwipeRightToSellButton extends StatefulWidget { final bool isEnabled; const SwipeRightToSellButton({ - Key? key, + super.key, required this.activeColor, required this.height, required this.initialWidth, required this.onSwipeComplete, required this.isEnabled, - }) : super(key: key); + }); @override State createState() => _SwipeRightToSellButtonState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart b/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart index aa31c7ddfe..6a8f9405bd 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/tab_fields.dart @@ -24,7 +24,7 @@ class TabField extends StatefulWidget { final Function(TabFields) onChangeTab; TabField({ - Key? key, + super.key, required this.name, required this.icon, required this.nft, @@ -32,7 +32,7 @@ class TabField extends StatefulWidget { required this.nftOwnershipHistoryList, required this.isExpanded, required this.onChangeTab, - }) : super(key: key); + }); @override State createState() => _TabFieldState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/toggle_button.dart b/wallet/lib/pages/detailed_asset_view/widgets/toggle_button.dart index ad3d94d3c3..56324b459e 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/toggle_button.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/toggle_button.dart @@ -5,10 +5,10 @@ class ToggleButton extends StatefulWidget { final bool enabled; final void Function({required bool enabled}) onPressed; const ToggleButton({ - Key? key, + super.key, required this.enabled, required this.onPressed, - }) : super(key: key); + }); @override State createState() => _ToggleButtonState(); diff --git a/wallet/lib/pages/detailed_asset_view/widgets/video_placeholder.dart b/wallet/lib/pages/detailed_asset_view/widgets/video_placeholder.dart index 16f0a7c779..d79090d71c 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/video_placeholder.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/video_placeholder.dart @@ -14,11 +14,11 @@ class VideoPlaceHolder extends StatelessWidget { final String thumbnailUrl; const VideoPlaceHolder({ - Key? key, + super.key, required this.nftUrl, required this.nftName, required this.thumbnailUrl, - }) : super(key: key); + }); Widget getVideoThumbnailFromUrl() { return Stack( @@ -108,12 +108,12 @@ class BuildThumbnailContainer extends StatelessWidget { final WidgetBuilder waitingWidget; const BuildThumbnailContainer({ - Key? key, + super.key, required this.snapshot, required this.errorWidget, required this.successWidget, required this.waitingWidget, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/detailed_asset_view/widgets/wallpaper_set_screen.dart b/wallet/lib/pages/detailed_asset_view/widgets/wallpaper_set_screen.dart index 512717a34f..fba5ed9161 100644 --- a/wallet/lib/pages/detailed_asset_view/widgets/wallpaper_set_screen.dart +++ b/wallet/lib/pages/detailed_asset_view/widgets/wallpaper_set_screen.dart @@ -33,7 +33,7 @@ class WallpaperScreen { } class _WallpaperScreen extends StatefulWidget { - const _WallpaperScreen({Key? key, required this.nft}) : super(key: key); + const _WallpaperScreen({required this.nft}); final String nft; @override diff --git a/wallet/lib/pages/gestures_for_detail_screen.dart b/wallet/lib/pages/gestures_for_detail_screen.dart index dcad260f40..6304d559c3 100644 --- a/wallet/lib/pages/gestures_for_detail_screen.dart +++ b/wallet/lib/pages/gestures_for_detail_screen.dart @@ -16,13 +16,13 @@ class GesturesForDetailsScreen extends StatefulWidget { final Function(TapUpDetails)? tapUp; const GesturesForDetailsScreen({ - Key? key, + super.key, required this.child, required this.screen, required this.nft, required this.viewModel, this.tapUp, - }) : super(key: key); + }); @override State createState() => _GesturesForDetailsScreenState(); @@ -207,7 +207,7 @@ class _GesturesForDetailsScreenState extends State { index = index + 1; final NFT nft = recipesProvider.nftCreations.elementAt(index); - Navigator.of(context).pushReplacementNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: nft); + Navigator.of(context).pushReplacementNamed(Routes.ownerView.name, arguments: nft); } if (widget.nft.type == NftType.TYPE_ITEM) { int index = itemsProvider.items.indexOf(widget.nft); @@ -215,7 +215,7 @@ class _GesturesForDetailsScreenState extends State { if (itemsProvider.items.length - 1 == index) return; index = index + 1; final NFT nft = itemsProvider.items.elementAt(index); - Navigator.of(context).pushReplacementNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: nft); + Navigator.of(context).pushReplacementNamed(Routes.ownerView.name, arguments: nft); } } @@ -227,7 +227,7 @@ class _GesturesForDetailsScreenState extends State { if (index == 0) return; index = index - 1; final NFT nft = collectionViewModel.creations.elementAt(index); - Navigator.of(context).pushReplacementNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: nft); + Navigator.of(context).pushReplacementNamed(Routes.ownerView.name, arguments: nft); } if (widget.nft.type == NftType.TYPE_ITEM) { int index = collectionViewModel.assets.indexOf(widget.nft); @@ -235,7 +235,7 @@ class _GesturesForDetailsScreenState extends State { if (index == 0) return; index = index - 1; final NFT nft = collectionViewModel.assets.elementAt(index); - Navigator.of(context).pushReplacementNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: nft); + Navigator.of(context).pushReplacementNamed(Routes.ownerView.name, arguments: nft); } } } diff --git a/wallet/lib/pages/home/collection_screen/collection_screen.dart b/wallet/lib/pages/home/collection_screen/collection_screen.dart index 5fae4d1aaa..37fdabbc15 100644 --- a/wallet/lib/pages/home/collection_screen/collection_screen.dart +++ b/wallet/lib/pages/home/collection_screen/collection_screen.dart @@ -45,7 +45,7 @@ class Collection { } class CollectionScreen extends StatefulWidget { - const CollectionScreen({Key? key}) : super(key: key); + const CollectionScreen({super.key}); @override State createState() => _CollectionScreenState(); @@ -137,7 +137,7 @@ class _CollectionScreenState extends State { if (asset.type == NftType.TYPE_RECIPE) { onRecipeClicked(asset); } else { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: asset); + Navigator.of(context).pushNamed(Routes.ownerView.name, arguments: asset); } } @@ -149,7 +149,7 @@ class _CollectionScreenState extends State { loader.dismiss(); if (mounted) { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_OWNER_VIEW, arguments: asset); + Navigator.of(context).pushNamed(Routes.ownerView.name, arguments: asset); } } } @@ -157,7 +157,7 @@ class _CollectionScreenState extends State { class NONNftCreations extends StatelessWidget { final OnNFTSelected onNFTSelected; - const NONNftCreations({Key? key, required this.onNFTSelected}) : super(key: key); + const NONNftCreations({super.key, required this.onNFTSelected}); @override Widget build(BuildContext context) { @@ -222,11 +222,11 @@ class SheetHeading extends StatelessWidget { final String title; final CollectionsType collectionType; const SheetHeading({ - Key? key, + super.key, required this.leadingSVG, required this.title, required this.collectionType, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/collection_screen/preview_nft_grid.dart b/wallet/lib/pages/home/collection_screen/preview_nft_grid.dart index 0a5e747f3b..49cd5a3334 100644 --- a/wallet/lib/pages/home/collection_screen/preview_nft_grid.dart +++ b/wallet/lib/pages/home/collection_screen/preview_nft_grid.dart @@ -10,15 +10,15 @@ class PreviewNFTGrid extends StatelessWidget { final AssetType assetType; - const PreviewNFTGrid( - {Key? key, - required this.on3dNFT, - required this.onAudioNFT, - required this.onVideoNFT, - required this.onPdfNFT, - required this.onImageNFT, - required this.assetType}) - : super(key: key); + const PreviewNFTGrid({ + super.key, + required this.on3dNFT, + required this.onAudioNFT, + required this.onVideoNFT, + required this.onPdfNFT, + required this.onImageNFT, + required this.assetType, + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart index 0c0c7ed4ec..ad0f724cbd 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart @@ -24,7 +24,7 @@ import '../preview_nft_grid.dart'; class CreationsCollection extends StatelessWidget { final OnNFTSelected onNFTSelected; - const CreationsCollection({Key? key, required this.onNFTSelected}) : super(key: key); + const CreationsCollection({super.key, required this.onNFTSelected}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/collection_screen/widgets/purchase_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/purchase_collection_sheet.dart index 5290bede46..e8d559f06f 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/purchase_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/purchase_collection_sheet.dart @@ -22,7 +22,7 @@ import '../collection_view_model.dart'; class PurchasesCollection extends StatelessWidget { final OnNFTSelected onNFTSelected; - const PurchasesCollection({Key? key, required this.onNFTSelected}) : super(key: key); + const PurchasesCollection({super.key, required this.onNFTSelected}); @override Widget build(BuildContext context) { @@ -78,13 +78,13 @@ class PurchaseCollectionItem extends StatelessWidget { final String thumbnailUrl; final String name; const PurchaseCollectionItem({ - Key? key, + super.key, required this.onPressed, required this.assetType, required this.url, required this.thumbnailUrl, required this.name, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/collection_screen/widgets/show_recipe_json.dart b/wallet/lib/pages/home/collection_screen/widgets/show_recipe_json.dart index 1718a2f205..904872f920 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/show_recipe_json.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/show_recipe_json.dart @@ -28,7 +28,7 @@ class ShowRecipeJsonDialog { class _RecipeJson extends StatelessWidget { final Recipe recipe; - const _RecipeJson({Key? key, required this.recipe}) : super(key: key); + const _RecipeJson({required this.recipe}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/collection_screen/widgets/trades_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/trades_collection_sheet.dart index 6d62db2dff..a0eb2e3226 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/trades_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/trades_collection_sheet.dart @@ -19,7 +19,7 @@ import '../collection_screen.dart'; class TradesCollection extends StatelessWidget { final OnNFTSelected onNFTSelected; - const TradesCollection({Key? key, required this.onNFTSelected}) : super(key: key); + const TradesCollection({super.key, required this.onNFTSelected}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/currency_screen/widgets/balance_ibc_coins.dart b/wallet/lib/pages/home/currency_screen/widgets/balance_ibc_coins.dart index b4529d2ab2..902dc80f73 100644 --- a/wallet/lib/pages/home/currency_screen/widgets/balance_ibc_coins.dart +++ b/wallet/lib/pages/home/currency_screen/widgets/balance_ibc_coins.dart @@ -13,7 +13,7 @@ import 'package:shimmer_animation/shimmer_animation.dart'; class BalanceIBCCoins extends StatefulWidget { final Balance balance; - const BalanceIBCCoins({Key? key, required this.balance}) : super(key: key); + const BalanceIBCCoins({super.key, required this.balance}); @override _BalanceIBCCoinsState createState() => _BalanceIBCCoinsState(); diff --git a/wallet/lib/pages/home/currency_screen/widgets/stripe_payout_widget.dart b/wallet/lib/pages/home/currency_screen/widgets/stripe_payout_widget.dart index deae89f0fb..c913f9e77c 100644 --- a/wallet/lib/pages/home/currency_screen/widgets/stripe_payout_widget.dart +++ b/wallet/lib/pages/home/currency_screen/widgets/stripe_payout_widget.dart @@ -34,7 +34,7 @@ class StripePayoutForm extends StatefulWidget { final String maxAmount; final Function? onCallback; - const StripePayoutForm({Key? key, required this.maxAmount, this.onCallback}) : super(key: key); + const StripePayoutForm({super.key, required this.maxAmount, this.onCallback}); @override StripePayoutFormState createState() => StripePayoutFormState(); diff --git a/wallet/lib/pages/home/easel_section/no_easel_art_work.dart b/wallet/lib/pages/home/easel_section/no_easel_art_work.dart index a003c7ccf9..557cc4c630 100644 --- a/wallet/lib/pages/home/easel_section/no_easel_art_work.dart +++ b/wallet/lib/pages/home/easel_section/no_easel_art_work.dart @@ -10,7 +10,7 @@ import 'package:url_launcher/url_launcher_string.dart'; import '../../../generated/locale_keys.g.dart'; class NoEaselArtWork extends StatelessWidget { - const NoEaselArtWork({Key? key}) : super(key: key); + const NoEaselArtWork({super.key}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/home.dart b/wallet/lib/pages/home/home.dart index 69171e1422..1e79753dc8 100644 --- a/wallet/lib/pages/home/home.dart +++ b/wallet/lib/pages/home/home.dart @@ -31,7 +31,7 @@ import 'collection_screen/collection_screen.dart'; import 'wallet_screen/wallet_screen.dart'; class HomeScreen extends StatefulWidget { - const HomeScreen({Key? key}) : super(key: key); + const HomeScreen({super.key}); @override State createState() => HomeScreenState(); @@ -164,7 +164,7 @@ class HomeScreenState extends State with SingleTickerProviderStateMi left: 0.86.sw, child: GestureDetector( onTap: () async { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_MESSAGE); + Navigator.of(context).pushNamed(Routes.message.name); }, behavior: HitTestBehavior.translucent, child: Stack( @@ -286,7 +286,7 @@ class HomeScreenState extends State with SingleTickerProviderStateMi right: 0.12.sw, child: InkResponse( onTap: () async { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_MESSAGE); + Navigator.of(context).pushNamed(Routes.message.name); }, child: Stack( children: [ @@ -407,7 +407,7 @@ class WalletTab extends StatelessWidget { final int index; final String tabName; - const WalletTab({Key? key, required this.tabName, required this.index}) : super(key: key); + const WalletTab({super.key, required this.tabName, required this.index}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/home/message_screen/message_screen.dart b/wallet/lib/pages/home/message_screen/message_screen.dart index 4e03cfa2f3..8d15d517c7 100644 --- a/wallet/lib/pages/home/message_screen/message_screen.dart +++ b/wallet/lib/pages/home/message_screen/message_screen.dart @@ -13,7 +13,7 @@ import 'package:pylons_wallet/utils/constants.dart'; import '../../../generated/locale_keys.g.dart'; class MessagesScreen extends StatefulWidget { - const MessagesScreen({Key? key}) : super(key: key); + const MessagesScreen({super.key}); @override State createState() => _MessagesScreenState(); diff --git a/wallet/lib/pages/home/message_screen/message_tile.dart b/wallet/lib/pages/home/message_screen/message_tile.dart index fce7ff5dd6..d3ccccd287 100644 --- a/wallet/lib/pages/home/message_screen/message_tile.dart +++ b/wallet/lib/pages/home/message_screen/message_tile.dart @@ -9,7 +9,7 @@ import 'package:pylons_wallet/utils/extension.dart'; import 'package:pylons_wallet/utils/time_ago.dart' as time_ago; class MessageTile extends StatefulWidget { - const MessageTile({Key? key, required this.notificationMessage}) : super(key: key); + const MessageTile({super.key, required this.notificationMessage}); final NotificationMessage notificationMessage; diff --git a/wallet/lib/pages/home/message_screen/nft_sold_dialog.dart b/wallet/lib/pages/home/message_screen/nft_sold_dialog.dart index f6c1a7cb47..dc94efbc25 100644 --- a/wallet/lib/pages/home/message_screen/nft_sold_dialog.dart +++ b/wallet/lib/pages/home/message_screen/nft_sold_dialog.dart @@ -42,9 +42,9 @@ class NftSoldContent extends StatefulWidget { final RemoteNotification notification; const NftSoldContent({ - Key? key, + super.key, required this.notification, - }) : super(key: key); + }); @override State createState() => _NftSoldContentState(); @@ -137,7 +137,7 @@ class _NftSoldContentState extends State { child: InkWell( onTap: () { Navigator.of(context).pop(); - Navigator.of(context).pushNamed(RouteUtil.ROUTE_MESSAGE); + Navigator.of(context).pushNamed(Routes.message.name); }, child: Container( height: 40.h, diff --git a/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart b/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart index 55d5f10e1b..ef4d379fac 100644 --- a/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart +++ b/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart @@ -34,7 +34,7 @@ TextStyle kSubTitleText = TextStyle( ); class AddPylonScreen extends StatefulWidget { - const AddPylonScreen({Key? key}) : super(key: key); + const AddPylonScreen({super.key}); @override State createState() => _AddPylonScreenState(); diff --git a/wallet/lib/pages/home/wallet_screen/wallet_screen.dart b/wallet/lib/pages/home/wallet_screen/wallet_screen.dart index 955c8fc5bd..009fc6e7d3 100644 --- a/wallet/lib/pages/home/wallet_screen/wallet_screen.dart +++ b/wallet/lib/pages/home/wallet_screen/wallet_screen.dart @@ -19,7 +19,7 @@ import 'package:pylons_wallet/utils/route_util.dart'; import 'package:sprintf/sprintf.dart'; class WalletScreen extends StatefulWidget { - const WalletScreen({Key? key}) : super(key: key); + const WalletScreen({super.key}); @override State createState() => _WalletScreenState(); @@ -99,7 +99,7 @@ class _WalletScreenState extends State { currencyModel: currencyModel, onFaucetPressed: () { if (currencyModel.ibcCoins.getName() == kPylons) { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_ADD_PYLON); + Navigator.of(context).pushNamed(Routes.addPylon.name); } }, ); diff --git a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart index 217255f1fa..0fcf12d982 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart @@ -21,9 +21,9 @@ class CurrencyBackgroundCard extends StatelessWidget { final bool isDefault; const CurrencyBackgroundCard({ - Key? key, + super.key, required this.isDefault, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -73,7 +73,7 @@ class CurrencyCard extends StatelessWidget { final Currency currencyModel; final VoidCallback onFaucetPressed; - const CurrencyCard({Key? key, required this.currencyModel, this.color, required this.isDefault, required this.onFaucetPressed}) : super(key: key); + const CurrencyCard({super.key, required this.currencyModel, this.color, required this.isDefault, required this.onFaucetPressed}); Widget getHelpIcon(BuildContext context) { if (currencyModel.ibcCoins.getName() == kPylons) { diff --git a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart index e4b1d003e4..1049d575ef 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart @@ -42,8 +42,7 @@ class LatestTransactions extends StatelessWidget { final String defaultCurrency; - const LatestTransactions({Key? key, required this.denomSpecificTxList, required this.defaultCurrency}) - : super(key: key); + const LatestTransactions({super.key, required this.denomSpecificTxList, required this.defaultCurrency}); @override Widget build(BuildContext context) { @@ -225,7 +224,7 @@ class LatestTransactions extends StatelessWidget { .value; navigator.pushNamed( - RouteUtil.ROUTE_TRANSACTION_DETAIL, + Routes.trasactionDetail.name, arguments: TxDetailArguments( recipe: recipe, creator: creator, diff --git a/wallet/lib/pages/home/wallet_screen/widgets/row_components.dart b/wallet/lib/pages/home/wallet_screen/widgets/row_components.dart index aa3b05f127..27ef9719be 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/row_components.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/row_components.dart @@ -19,7 +19,7 @@ import '../../../../generated/locale_keys.g.dart'; class RowComponents extends StatelessWidget { final VoidCallback onRefresh; - const RowComponents({Key? key, required this.onRefresh}) : super(key: key); + const RowComponents({super.key, required this.onRefresh}); @override Widget build(BuildContext context) { @@ -41,7 +41,7 @@ class RowComponents extends StatelessWidget { width: 20.w, ), GestureDetector( - onTap: () => Navigator.of(context).pushNamed(RouteUtil.ROUTE_TRANSACTION_HISTORY), + onTap: () => Navigator.of(context).pushNamed(Routes.transactionHistory.name), child: SvgPicture.asset(Assets.images.icons.transactionHistory), ), SizedBox( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/transaction_details.dart b/wallet/lib/pages/home/wallet_screen/widgets/transaction_details.dart index b36c4c562e..1009a15fda 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/transaction_details.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/transaction_details.dart @@ -24,7 +24,7 @@ import '../../../../generated/locale_keys.g.dart'; TextStyle _titleTextStyle = TextStyle(color: AppColors.kBlack, fontFamily: kUniversalFontFamily, fontWeight: FontWeight.bold, fontSize: 20.sp); class TransactionDetailsScreen extends StatefulWidget { - const TransactionDetailsScreen({Key? key}) : super(key: key); + const TransactionDetailsScreen({super.key}); @override State createState() => _TransactionDetailsScreenState(); diff --git a/wallet/lib/pages/home/wallet_screen/widgets/view_in_collection_button.dart b/wallet/lib/pages/home/wallet_screen/widgets/view_in_collection_button.dart index bbed42b061..f6da28d56e 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/view_in_collection_button.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/view_in_collection_button.dart @@ -8,9 +8,12 @@ class BlueClippedButton extends StatelessWidget { final String text; final bool enabled; - const BlueClippedButton( - {Key? key, required this.onTap, this.text = "", this.enabled = true}) - : super(key: key); + const BlueClippedButton({ + super.key, + required this.onTap, + this.text = "", + this.enabled = true, + }); @override Widget build(BuildContext context) { @@ -25,9 +28,7 @@ class BlueClippedButton extends StatelessWidget { child: Center( child: Text( text, - style: TextStyle( - color: enabled ? AppColors.kWhite : AppColors.kDarkGrey.withOpacity(0.5), - fontSize: 16.sp), + style: TextStyle(color: enabled ? AppColors.kWhite : AppColors.kDarkGrey.withOpacity(0.5), fontSize: 16.sp), textAlign: TextAlign.center, )), ), diff --git a/wallet/lib/pages/home/wallet_screen/widgets/what_is_pylon_dialog.dart b/wallet/lib/pages/home/wallet_screen/widgets/what_is_pylon_dialog.dart index f9702cef11..6e218150fa 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/what_is_pylon_dialog.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/what_is_pylon_dialog.dart @@ -34,7 +34,7 @@ class WhatIsPylonDialog { } class WhatIsPylonWidget extends StatefulWidget { - const WhatIsPylonWidget({Key? key}) : super(key: key); + const WhatIsPylonWidget({super.key}); @override State createState() => _WhatIsPylonWidgetState(); diff --git a/wallet/lib/pages/home/widget/pylons_drawer.dart b/wallet/lib/pages/home/widget/pylons_drawer.dart index e6bec20744..1dd1c562a0 100644 --- a/wallet/lib/pages/home/widget/pylons_drawer.dart +++ b/wallet/lib/pages/home/widget/pylons_drawer.dart @@ -13,7 +13,7 @@ import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/route_util.dart'; class PylonsDrawer extends StatelessWidget { - const PylonsDrawer({Key? key}) : super(key: key); + const PylonsDrawer({super.key}); @override Widget build(BuildContext context) { @@ -52,7 +52,7 @@ class PylonsDrawer extends StatelessWidget { width: isTablet ? 60 : 85, icon: Assets.images.svg.settingsGeneral, onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_GENERAL); + Navigator.of(context).pushNamed(Routes.general.name); }, ), /// Revert when the functionality is added @@ -76,7 +76,7 @@ class PylonsDrawer extends StatelessWidget { width: isTablet ? 60 : 85, icon: Assets.images.svg.settingsRecovery, onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_RECOVERY); + Navigator.of(context).pushNamed(Routes.recovery.name); }, ), DrawerTile( @@ -85,7 +85,7 @@ class PylonsDrawer extends StatelessWidget { width: isTablet ? 60 : 85, icon: Assets.images.svg.settingsLegal, onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_LEGAL); + Navigator.of(context).pushNamed(Routes.legal.name); }, ), const Spacer(), @@ -120,14 +120,14 @@ class DrawerTile extends StatelessWidget { const DrawerTile( this.title, { - Key? key, + super.key, required this.onPressed, this.height = 45, this.width = 85, this.icon, this.iconColor = AppColors.kWhite, this.textAlign = TextAlign.start, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/owner_purchase_view_common/qr_code_screen.dart b/wallet/lib/pages/owner_purchase_view_common/qr_code_screen.dart index c04239f3ef..a95da61c29 100644 --- a/wallet/lib/pages/owner_purchase_view_common/qr_code_screen.dart +++ b/wallet/lib/pages/owner_purchase_view_common/qr_code_screen.dart @@ -18,7 +18,7 @@ import 'package:qr_flutter/qr_flutter.dart'; import '../../generated/locale_keys.g.dart'; class QRCodeScreen extends StatefulWidget { - const QRCodeScreen({Key? key, required this.nft}) : super(key: key); + const QRCodeScreen({super.key, required this.nft}); final NFT nft; diff --git a/wallet/lib/pages/presenting_onboard_page/components/import_from_google_form.dart b/wallet/lib/pages/presenting_onboard_page/components/import_from_google_form.dart index d1447f590e..10e9a2f210 100644 --- a/wallet/lib/pages/presenting_onboard_page/components/import_from_google_form.dart +++ b/wallet/lib/pages/presenting_onboard_page/components/import_from_google_form.dart @@ -24,7 +24,7 @@ import '../../../generated/locale_keys.g.dart'; class ImportFromGoogleForm extends StatefulWidget { final WalletsStore walletStore; - const ImportFromGoogleForm({Key? key, required this.walletStore}) : super(key: key); + const ImportFromGoogleForm({super.key, required this.walletStore}); @override ImportFromGoogleFormState createState() { @@ -135,7 +135,7 @@ class ImportFromGoogleFormState extends State { failure.message.show(); }, (walletInfo) { remoteNotificationsProvider.updateFCMToken(address: walletInfo.publicAddress); - Navigator.of(context).pushNamedAndRemoveUntil(RouteUtil.ROUTE_HOME, (route) => true); + Navigator.of(context).pushNamedAndRemoveUntil(Routes.home.name, (route) => true); }); } @@ -165,7 +165,7 @@ class ImportFromGoogleFormState extends State { failure.message.show(); }, (walletInfo) { remoteNotificationsProvider.updateFCMToken(address: walletInfo.publicAddress); - Navigator.of(context).pushNamedAndRemoveUntil(RouteUtil.ROUTE_HOME, (route) => true); + Navigator.of(context).pushNamedAndRemoveUntil(Routes.home.name, (route) => true); }); } @@ -196,7 +196,7 @@ class ImportFromGoogleFormState extends State { }, (walletInfo) { remoteNotificationsProvider.updateFCMToken(address: walletInfo.publicAddress); - Navigator.of(context).pushNamedAndRemoveUntil(RouteUtil.ROUTE_HOME, (route) => true); + Navigator.of(context).pushNamedAndRemoveUntil(Routes.home.name, (route) => true); }); } } diff --git a/wallet/lib/pages/presenting_onboard_page/components/new_user_form.dart b/wallet/lib/pages/presenting_onboard_page/components/new_user_form.dart index 64121e7a96..4053c205a6 100644 --- a/wallet/lib/pages/presenting_onboard_page/components/new_user_form.dart +++ b/wallet/lib/pages/presenting_onboard_page/components/new_user_form.dart @@ -22,7 +22,7 @@ import '../../../generated/locale_keys.g.dart'; class NewUserForm extends StatefulWidget { final WalletsStore walletsStore; - const NewUserForm({Key? key, required this.walletsStore}) : super(key: key); + const NewUserForm({super.key, required this.walletsStore}); @override NewUserFormState createState() => NewUserFormState(); @@ -172,7 +172,7 @@ class NewUserFormState extends State { failure.message.show(); }, (walletInfo) async { firebaseRemoteNotificationsProvider.updateFCMToken(address: accountProvider.accountPublicInfo!.publicAddress); - navigator.pushNamedAndRemoveUntil(RouteUtil.ROUTE_HOME, (route) => false); + navigator.pushNamedAndRemoveUntil(Routes.home.name, (route) => false); }); } } diff --git a/wallet/lib/pages/presenting_onboard_page/presenting_onboard_page.dart b/wallet/lib/pages/presenting_onboard_page/presenting_onboard_page.dart index 313cb977bf..54361e5b50 100644 --- a/wallet/lib/pages/presenting_onboard_page/presenting_onboard_page.dart +++ b/wallet/lib/pages/presenting_onboard_page/presenting_onboard_page.dart @@ -14,7 +14,7 @@ import 'package:pylons_wallet/utils/route_util.dart'; import '../../generated/locale_keys.g.dart'; class PresentingOnboardPage extends StatefulWidget { - const PresentingOnboardPage({Key? key}) : super(key: key); + const PresentingOnboardPage({super.key}); @override State createState() => __PresentingOnboardPageState(); @@ -86,14 +86,14 @@ class __PresentingOnboardPageState extends State { title: LocaleKeys.create_wallet.tr(), bgColor: AppColors.kCreateWalletButtonColorDark, onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_CREATE_WALLET); + Navigator.of(context).pushNamed(Routes.createWallet.name); }), VerticalSpace(25.h), buildBackupButton( title: LocaleKeys.restore_wallet.tr(), bgColor: AppColors.kButtonColor, onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_RESTORE_WALLET); + Navigator.of(context).pushNamed(Routes.restoreWallet.name); }), VerticalSpace(25.h), ], diff --git a/wallet/lib/pages/presenting_onboard_page/screens/accept_policy_screen.dart b/wallet/lib/pages/presenting_onboard_page/screens/accept_policy_screen.dart index a57d0b162b..f902c143e3 100644 --- a/wallet/lib/pages/presenting_onboard_page/screens/accept_policy_screen.dart +++ b/wallet/lib/pages/presenting_onboard_page/screens/accept_policy_screen.dart @@ -22,7 +22,7 @@ class AcceptPolicyScreen extends StatefulWidget { final NFT nft; final AcceptPolicyViewModel viewModel; - const AcceptPolicyScreen({Key? key, required this.nft, required this.viewModel}) : super(key: key); + const AcceptPolicyScreen({super.key, required this.nft, required this.viewModel}); @override State createState() => _AcceptPolicyScreenState(); @@ -101,9 +101,9 @@ class AcceptPolicyScreenContent extends StatelessWidget { final NFT nft; const AcceptPolicyScreenContent({ - Key? key, + super.key, required this.nft, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -200,8 +200,8 @@ class MyCheckBox extends StatelessWidget { required this.isSelected, required this.onChange, required this.onLinkTap, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/presenting_onboard_page/screens/create_wallet_screen.dart b/wallet/lib/pages/presenting_onboard_page/screens/create_wallet_screen.dart index 2687bacda3..3c86af2b43 100644 --- a/wallet/lib/pages/presenting_onboard_page/screens/create_wallet_screen.dart +++ b/wallet/lib/pages/presenting_onboard_page/screens/create_wallet_screen.dart @@ -9,7 +9,7 @@ import 'package:pylons_wallet/stores/wallet_store.dart'; import 'package:pylons_wallet/utils/constants.dart'; class CreateWalletScreen extends StatefulWidget { - const CreateWalletScreen({Key? key}) : super(key: key); + const CreateWalletScreen({super.key}); @override State createState() => _CreateWalletScreenState(); diff --git a/wallet/lib/pages/presenting_onboard_page/screens/restore_wallet_screen.dart b/wallet/lib/pages/presenting_onboard_page/screens/restore_wallet_screen.dart index 7dd74d3abf..869711b7ba 100644 --- a/wallet/lib/pages/presenting_onboard_page/screens/restore_wallet_screen.dart +++ b/wallet/lib/pages/presenting_onboard_page/screens/restore_wallet_screen.dart @@ -9,7 +9,7 @@ import 'package:pylons_wallet/stores/wallet_store.dart'; import 'package:pylons_wallet/utils/constants.dart'; class RestoreWalletScreen extends StatefulWidget { - const RestoreWalletScreen({Key? key}) : super(key: key); + const RestoreWalletScreen({super.key}); @override State createState() => _RestoreWalletScreenState(); diff --git a/wallet/lib/pages/presenting_onboard_page/viewmodel/accept_policy_viewmodel.dart b/wallet/lib/pages/presenting_onboard_page/viewmodel/accept_policy_viewmodel.dart index caf5ff5bdf..241bdc3184 100644 --- a/wallet/lib/pages/presenting_onboard_page/viewmodel/accept_policy_viewmodel.dart +++ b/wallet/lib/pages/presenting_onboard_page/viewmodel/accept_policy_viewmodel.dart @@ -37,8 +37,8 @@ class AcceptPolicyViewModel extends ChangeNotifier { void onTapGetStartedButton(NFT nft) { setUserAcceptPolicies(); - navigatorKey.currentState!.pushReplacementNamed(RouteUtil.ROUTE_HOME); - navigatorKey.currentState!.pushNamed(RouteUtil.ROUTE_PURCHASE_VIEW, arguments: nft); + navigatorKey.currentState!.pushReplacementNamed(Routes.home.name); + navigatorKey.currentState!.pushNamed(Routes.purchaseView.name, arguments: nft); } bool getUserAcceptPolicies() { diff --git a/wallet/lib/pages/purchase_item/purchase_item_screen.dart b/wallet/lib/pages/purchase_item/purchase_item_screen.dart index e60a663427..1a4defd79d 100644 --- a/wallet/lib/pages/purchase_item/purchase_item_screen.dart +++ b/wallet/lib/pages/purchase_item/purchase_item_screen.dart @@ -47,7 +47,7 @@ import '../../modules/Pylonstech.pylons.pylons/module/client/pylons/execution.pb class PurchaseItemScreen extends StatefulWidget { final NFT nft; - const PurchaseItemScreen({Key? key, required this.nft}) : super(key: key); + const PurchaseItemScreen({super.key, required this.nft}); @override State createState() => _PurchaseItemScreenState(); @@ -83,8 +83,8 @@ class _PurchaseItemScreenState extends State { class PurchaseItemContent extends StatefulWidget { const PurchaseItemContent({ - Key? key, - }) : super(key: key); + super.key, + }); @override _PurchaseItemContentState createState() => _PurchaseItemContentState(); @@ -223,7 +223,7 @@ class _PurchaseItemContentState extends State { } class OwnerBottomDrawer extends StatefulWidget { - const OwnerBottomDrawer({Key? key}) : super(key: key); + const OwnerBottomDrawer({super.key}); @override State createState() => _OwnerBottomDrawerState(); @@ -322,7 +322,7 @@ class _OwnerBottomDrawerState extends State { GestureDetector( onTap: () async { if (viewModel.accountPublicInfo == null) { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_ONBOARDING); + Navigator.of(context).pushNamed(Routes.onboarding.name); return; } final Size size = MediaQuery.of(context).size; @@ -618,7 +618,7 @@ class _OwnerBottomDrawerState extends State { GestureDetector( onTap: () async { if (viewModel.accountPublicInfo == null) { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_ONBOARDING); + Navigator.of(context).pushNamed(Routes.onboarding.name); return; } final Size size = MediaQuery.of(context).size; @@ -643,7 +643,7 @@ class _OwnerBottomDrawerState extends State { onTapped: () async { if (viewModel.accountPublicInfo == null) { LocaleKeys.create_an_account_first.tr().show(); - Navigator.of(context).pushNamed(RouteUtil.ROUTE_ONBOARDING); + Navigator.of(context).pushNamed(Routes.onboarding.name); return; } bool balancesFetchResult = true; diff --git a/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart b/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart index 05b710a9c1..cad4183fc7 100644 --- a/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart +++ b/wallet/lib/pages/purchase_item/widgets/buy_nft_button.dart @@ -15,7 +15,7 @@ class BuyNFTButton extends StatelessWidget { final VoidCallback onTapped; final NFT nft; - const BuyNFTButton({Key? key, required this.onTapped, required this.nft}) : super(key: key); + const BuyNFTButton({super.key, required this.onTapped, required this.nft}); Widget getButtonContent(NFT nft, PurchaseItemViewModel viewModel) { final double btnHeight = 37.h; diff --git a/wallet/lib/pages/purchase_item/widgets/insufficient_balance_dialog.dart b/wallet/lib/pages/purchase_item/widgets/insufficient_balance_dialog.dart index dbd5b5ab92..cd9f3c14c8 100644 --- a/wallet/lib/pages/purchase_item/widgets/insufficient_balance_dialog.dart +++ b/wallet/lib/pages/purchase_item/widgets/insufficient_balance_dialog.dart @@ -93,7 +93,7 @@ class InsufficientBalanceDialog { title: LocaleKeys.add_pylons.tr(), bgColor: AppColors.kTextBlackColor, onPressed: () async { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_ADD_PYLON); + Navigator.of(context).pushNamed(Routes.addPylon.name); }), ), Expanded( diff --git a/wallet/lib/pages/purchase_item/widgets/pay_now_dialog.dart b/wallet/lib/pages/purchase_item/widgets/pay_now_dialog.dart index db5b6f9b0a..4f8a9df847 100644 --- a/wallet/lib/pages/purchase_item/widgets/pay_now_dialog.dart +++ b/wallet/lib/pages/purchase_item/widgets/pay_now_dialog.dart @@ -88,11 +88,11 @@ class PayNowWidget extends StatefulWidget { final bool shouldBuy; const PayNowWidget({ - Key? key, + super.key, required this.nft, required this.onPurchaseDone, required this.shouldBuy, - }) : super(key: key); + }); @override State createState() => _PayNowWidgetState(); @@ -194,7 +194,7 @@ class _PayNowWidgetState extends State { onPressed: () async { final navigator = Navigator.of(context); navigator.pop(); - navigator.pushNamed(RouteUtil.ROUTE_ADD_PYLON); + navigator.pushNamed(Routes.addPylon.name); }, ), ), @@ -316,7 +316,7 @@ class _PayNowWidgetState extends State { navigator.pop(); if (!executionResponse.success) { executionResponse.error.show(); - navigator.pushNamed(RouteUtil.ROUTE_FAILURE); + navigator.pushNamed(Routes.transactionFailure.name); return; } @@ -407,7 +407,7 @@ class _PayNowWidgetState extends State { navigator.pop(); if (!executionResponse.success) { - navigator.pushNamed(RouteUtil.ROUTE_FAILURE); + navigator.pushNamed(Routes.transactionFailure.name); return; } diff --git a/wallet/lib/pages/purchase_item/widgets/pay_with_swipe.dart b/wallet/lib/pages/purchase_item/widgets/pay_with_swipe.dart index d5bed4e3c3..a85bbbbe09 100644 --- a/wallet/lib/pages/purchase_item/widgets/pay_with_swipe.dart +++ b/wallet/lib/pages/purchase_item/widgets/pay_with_swipe.dart @@ -12,7 +12,7 @@ class PylonsPayWithSwipe extends StatefulWidget { final double initialWidth; final VoidCallback onSwipeComplete; - const PylonsPayWithSwipe({Key? key, required this.activeColor, required this.inactiveColor, required this.height, required this.initialWidth, required this.onSwipeComplete}) : super(key: key); + const PylonsPayWithSwipe({super.key, required this.activeColor, required this.inactiveColor, required this.height, required this.initialWidth, required this.onSwipeComplete}); @override State createState() => _PylonsPayWithSwipeState(); diff --git a/wallet/lib/pages/purchase_item/widgets/purchase_audio_widget.dart b/wallet/lib/pages/purchase_item/widgets/purchase_audio_widget.dart index b9f0a31bbf..aa4bf0d88d 100644 --- a/wallet/lib/pages/purchase_item/widgets/purchase_audio_widget.dart +++ b/wallet/lib/pages/purchase_item/widgets/purchase_audio_widget.dart @@ -12,9 +12,9 @@ class PurchaseAudioWidget extends StatefulWidget { final String url; const PurchaseAudioWidget({ - Key? key, + super.key, required this.url, - }) : super(key: key); + }); @override _AudioWidgetState createState() => _AudioWidgetState(); diff --git a/wallet/lib/pages/purchase_item/widgets/purchase_video_player_screen.dart b/wallet/lib/pages/purchase_item/widgets/purchase_video_player_screen.dart index 7ba7b6cf7f..ce6c36343d 100644 --- a/wallet/lib/pages/purchase_item/widgets/purchase_video_player_screen.dart +++ b/wallet/lib/pages/purchase_item/widgets/purchase_video_player_screen.dart @@ -12,7 +12,7 @@ import '../../../generated/locale_keys.g.dart'; class PurchaseVideoPlayerScreen extends StatefulWidget { final NFT nft; - const PurchaseVideoPlayerScreen({Key? key, required this.nft}) : super(key: key); + const PurchaseVideoPlayerScreen({super.key, required this.nft}); @override State createState() => _PurchaseVideoPlayerScreenState(); diff --git a/wallet/lib/pages/purchase_item/widgets/purchase_video_progress_widget.dart b/wallet/lib/pages/purchase_item/widgets/purchase_video_progress_widget.dart index 71366feb22..263bda390c 100644 --- a/wallet/lib/pages/purchase_item/widgets/purchase_video_progress_widget.dart +++ b/wallet/lib/pages/purchase_item/widgets/purchase_video_progress_widget.dart @@ -8,7 +8,7 @@ import 'package:video_player/video_player.dart'; class PurchaseVideoProgressWidget extends StatefulWidget { final String url; - const PurchaseVideoProgressWidget({Key? key, required this.url}) : super(key: key); + const PurchaseVideoProgressWidget({super.key, required this.url}); @override _PurchaseVideoProgressWidgetState createState() => _PurchaseVideoProgressWidgetState(); diff --git a/wallet/lib/pages/purchase_item/widgets/trade_receipt_dialog.dart b/wallet/lib/pages/purchase_item/widgets/trade_receipt_dialog.dart index b389e1ac62..6ee3edc144 100644 --- a/wallet/lib/pages/purchase_item/widgets/trade_receipt_dialog.dart +++ b/wallet/lib/pages/purchase_item/widgets/trade_receipt_dialog.dart @@ -40,7 +40,7 @@ class TradeReceiptDialog { class TradeReceiptWidget extends StatefulWidget { final TradeReceiptModel model; - const TradeReceiptWidget({Key? key, required this.model}) : super(key: key); + const TradeReceiptWidget({super.key, required this.model}); @override State createState() => _TradeReceiptWidgetState(); diff --git a/wallet/lib/pages/purchase_item/widgets/transaction_complete_dialog.dart b/wallet/lib/pages/purchase_item/widgets/transaction_complete_dialog.dart index 5f82050034..8381d534dd 100644 --- a/wallet/lib/pages/purchase_item/widgets/transaction_complete_dialog.dart +++ b/wallet/lib/pages/purchase_item/widgets/transaction_complete_dialog.dart @@ -46,7 +46,7 @@ class TradeCompleteWidget extends StatefulWidget { final TradeReceiptModel model; final VoidCallback onBackPressed; - const TradeCompleteWidget({Key? key, required this.model, required this.onBackPressed}) : super(key: key); + const TradeCompleteWidget({super.key, required this.model, required this.onBackPressed}); @override State createState() => _TradeCompleteWidgetState(); diff --git a/wallet/lib/pages/routing_page/splash_screen.dart b/wallet/lib/pages/routing_page/splash_screen.dart index ac7e9c2b65..c5f4060145 100644 --- a/wallet/lib/pages/routing_page/splash_screen.dart +++ b/wallet/lib/pages/routing_page/splash_screen.dart @@ -18,7 +18,7 @@ import 'package:pylons_wallet/utils/image_util.dart'; import 'package:pylons_wallet/utils/route_util.dart'; class SplashScreen extends StatefulWidget { - const SplashScreen({Key? key}) : super(key: key); + const SplashScreen({super.key}); @override State createState() => _SplashScreenState(); @@ -73,7 +73,7 @@ class _SplashScreenState extends State { if (accountProvider.accountPublicInfo == null) { //Loads the last used wallet. - navigator.pushReplacementNamed(RouteUtil.ROUTE_ONBOARDING); + navigator.pushReplacementNamed(Routes.onboarding.name); } else { final repository = GetIt.I.get(); @@ -102,7 +102,7 @@ class _SplashScreenState extends State { void moveToHome() { Navigator.of( navigatorKey.currentState!.overlay!.context, - ).pushReplacementNamed(RouteUtil.ROUTE_HOME); + ).pushReplacementNamed(Routes.home.name); } @override @@ -182,7 +182,7 @@ class _SplashScreenState extends State { await accountProvider.loadWallets(); navigator.pushReplacementNamed( - RouteUtil.ROUTE_APP_UPDATE, + Routes.appUpdate.name, arguments: remoteConfigVersion, ); diff --git a/wallet/lib/pages/routing_page/update_app.dart b/wallet/lib/pages/routing_page/update_app.dart index c0b9115672..75a5bd7195 100644 --- a/wallet/lib/pages/routing_page/update_app.dart +++ b/wallet/lib/pages/routing_page/update_app.dart @@ -25,7 +25,7 @@ import '../../generated/locale_keys.g.dart'; TextStyle kUpdateAppSkipText = const TextStyle(fontWeight: FontWeight.w500, color: Colors.black54); class UpdateApp extends StatefulWidget { - const UpdateApp({Key? key}) : super(key: key); + const UpdateApp({super.key}); @override State createState() => _UpdateAppState(); @@ -302,10 +302,10 @@ class _UpdateAppState extends State { if (accountProvider.accountPublicInfo == null) { //Loads the last used wallet. - navigator.pushNamed(RouteUtil.ROUTE_ONBOARDING); + navigator.pushNamed(Routes.onboarding.name); } else { // Assigning the latest wallet to the app. - navigator.pushNamed(RouteUtil.ROUTE_HOME); + navigator.pushNamed(Routes.home.name); } } diff --git a/wallet/lib/pages/settings/common/settings_divider.dart b/wallet/lib/pages/settings/common/settings_divider.dart index 0881253158..9949ba1324 100644 --- a/wallet/lib/pages/settings/common/settings_divider.dart +++ b/wallet/lib/pages/settings/common/settings_divider.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class SettingsDivider extends StatelessWidget { - const SettingsDivider({Key? key}) : super(key: key); + const SettingsDivider({super.key}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/general_screen/general_screen.dart b/wallet/lib/pages/settings/screens/general_screen/general_screen.dart index 6b9bc9bb38..6b5c1106bd 100644 --- a/wallet/lib/pages/settings/screens/general_screen/general_screen.dart +++ b/wallet/lib/pages/settings/screens/general_screen/general_screen.dart @@ -23,7 +23,7 @@ TextStyle kGeneralLabelText = TextStyle( TextStyle kGeneralOptionsText = TextStyle(fontSize: 18.sp, color: Colors.black, fontWeight: FontWeight.w500); class GeneralScreen extends StatefulWidget { - const GeneralScreen({Key? key}) : super(key: key); + const GeneralScreen({super.key}); @override State createState() => _GeneralScreenState(); @@ -86,19 +86,19 @@ class _GeneralScreenState extends State { GeneralForwardItem( title: LocaleKeys.payment.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_PAYMENT); + Navigator.of(context).pushNamed(Routes.payment.name); }, ), GeneralForwardItem( title: LocaleKeys.security.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_SECURITY); + Navigator.of(context).pushNamed(Routes.security.name); }, ), GeneralForwardItem( title: LocaleKeys.transactions.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_FAILURE); + Navigator.of(context).pushNamed(Routes.transactionFailure.name); }, ), GeneralForwardItem( @@ -225,7 +225,7 @@ class GeneralForwardItem extends StatelessWidget { final String title; final VoidCallback onPressed; - const GeneralForwardItem({required this.title, Key? key, required this.onPressed}) : super(key: key); + const GeneralForwardItem({required this.title, super.key, required this.onPressed}); GeneralScreenLocalizationViewModel get _languageViewModel => GetIt.I.get(); @@ -286,7 +286,7 @@ class GeneralForwardItem extends StatelessWidget { class NotificationsListItem extends StatefulWidget { final String title; - const NotificationsListItem({Key? key, required this.title}) : super(key: key); + const NotificationsListItem({super.key, required this.title}); @override State createState() => _NotificationsListItemState(); diff --git a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart index b8dbec279b..21eb937dc1 100644 --- a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart +++ b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart @@ -17,7 +17,7 @@ TextStyle kPaymentLabelText = TextStyle(fontSize: 28.sp, fontFamily: kUniversalF TextStyle kPaymentOptionsText = TextStyle(fontSize: 18.sp, fontFamily: kUniversalFontFamily, color: Colors.black, fontWeight: FontWeight.w500); class PaymentScreen extends StatefulWidget { - const PaymentScreen({Key? key}) : super(key: key); + const PaymentScreen({super.key}); @override State createState() => _PaymentScreenState(); @@ -78,7 +78,7 @@ class _PaymentScreenState extends State { PaymentForwardItem( title: LocaleKeys.transaction_history.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_TRANSACTION_HISTORY); + Navigator.of(context).pushNamed(Routes.transactionHistory.name); }, ) ], @@ -111,7 +111,7 @@ class PaymentForwardItem extends StatelessWidget { final String title; final VoidCallback onPressed; - const PaymentForwardItem({required this.title, Key? key, required this.onPressed}) : super(key: key); + const PaymentForwardItem({required this.title, super.key, required this.onPressed}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart index 150808be45..886ea19309 100644 --- a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart +++ b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart @@ -15,7 +15,7 @@ TextStyle kTransactionHistoryLabelText = TextStyle(fontSize: 20.sp, fontFamily: TextStyle kTransactionHistoryOptionsText = TextStyle(fontSize: 18.sp, fontFamily: kUniversalFontFamily, color: Colors.black, fontWeight: FontWeight.w600); class TransactionHistoryScreen extends StatefulWidget { - const TransactionHistoryScreen({Key? key}) : super(key: key); + const TransactionHistoryScreen({super.key}); @override State createState() => _TransactionHistoryScreenState(); diff --git a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transaction_card.dart b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transaction_card.dart index 3755b3a6b1..c9215872ec 100644 --- a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transaction_card.dart +++ b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transaction_card.dart @@ -14,8 +14,8 @@ class TransactionCard extends StatelessWidget { required this.denomText, required this.transactionTypeEnum, required this.isDateSame, - Key? key, - }) : super(key: key); + super.key, + }); final String transactionType; final DateTime date; @@ -105,11 +105,11 @@ class LeadingBuilder extends StatelessWidget { final WalletHistoryTransactionType transactionType; const LeadingBuilder({ - Key? key, + super.key, required this.onSendReceive, required this.onBuySell, required this.transactionType, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transactions_list_view.dart b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transactions_list_view.dart index 24201b9560..83fbf8c6b5 100644 --- a/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transactions_list_view.dart +++ b/wallet/lib/pages/settings/screens/general_screen/screens/payment_screen/widgets/transactions_list_view.dart @@ -9,7 +9,7 @@ import 'package:pylons_wallet/utils/extension.dart'; class TransactionsListView extends StatelessWidget { final List transactionsHistoryList; - const TransactionsListView({Key? key, required this.transactionsHistoryList}) : super(key: key); + const TransactionsListView({super.key, required this.transactionsHistoryList}); bool isDateSame({required int index}) { if (index == 0) return false; diff --git a/wallet/lib/pages/settings/screens/general_screen/screens/security_screen.dart b/wallet/lib/pages/settings/screens/general_screen/screens/security_screen.dart index 1e62aa53a9..2ab227f53c 100644 --- a/wallet/lib/pages/settings/screens/general_screen/screens/security_screen.dart +++ b/wallet/lib/pages/settings/screens/general_screen/screens/security_screen.dart @@ -17,7 +17,7 @@ TextStyle kSecurityBiometricIdText = TextStyle(fontSize: 17.sp, color: Colors.bl TextStyle kSecurityNoBiometricText = TextStyle(fontSize: 15.sp, color: AppColors.kDarkRed, fontWeight: FontWeight.w500); class SecurityScreen extends StatefulWidget { - const SecurityScreen({Key? key}) : super(key: key); + const SecurityScreen({super.key}); @override State createState() => _SecurityScreenState(); diff --git a/wallet/lib/pages/settings/screens/general_screen/widgets/general_network_dropdown.dart b/wallet/lib/pages/settings/screens/general_screen/widgets/general_network_dropdown.dart index 7a0d847ea0..124333b1b7 100644 --- a/wallet/lib/pages/settings/screens/general_screen/widgets/general_network_dropdown.dart +++ b/wallet/lib/pages/settings/screens/general_screen/widgets/general_network_dropdown.dart @@ -15,8 +15,8 @@ class GeneralForwardNetworkItem extends StatelessWidget { const GeneralForwardNetworkItem({ required this.title, - Key? key, - }) : super(key: key); + super.key, + }); GeneralScreenViewModel get _generalScreenProvider => GetIt.I.get(); diff --git a/wallet/lib/pages/settings/screens/legal_screen.dart b/wallet/lib/pages/settings/screens/legal_screen.dart index 8b1318e31f..1c55d65cbc 100644 --- a/wallet/lib/pages/settings/screens/legal_screen.dart +++ b/wallet/lib/pages/settings/screens/legal_screen.dart @@ -13,7 +13,7 @@ TextStyle kLegalOptionsText = TextStyle(fontSize: 18.sp, fontFamily: kUniversalF TextStyle kLegalHeadlineText = TextStyle(fontSize: 28.sp, fontFamily: kUniversalFontFamily, color: Colors.black, fontWeight: FontWeight.w800); class LegalScreen extends StatefulWidget { - const LegalScreen({Key? key}) : super(key: key); + const LegalScreen({super.key}); @override State createState() => _LegalScreenState(); @@ -87,7 +87,7 @@ class LegalForwardItem extends StatelessWidget { final String title; final VoidCallback onPressed; - const LegalForwardItem({required this.title, Key? key, required this.onPressed}) : super(key: key); + const LegalForwardItem({required this.title, super.key, required this.onPressed}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/recovery_screen/recovery_screen.dart b/wallet/lib/pages/settings/screens/recovery_screen/recovery_screen.dart index d76241d5f9..15af82d61f 100644 --- a/wallet/lib/pages/settings/screens/recovery_screen/recovery_screen.dart +++ b/wallet/lib/pages/settings/screens/recovery_screen/recovery_screen.dart @@ -15,7 +15,7 @@ TextStyle kRecoveryOptionsText = TextStyle(fontSize: 18.sp, fontFamily: kUnivers TextStyle kRecoveryHeadlineText = TextStyle(fontSize: 28.sp, fontFamily: kUniversalFontFamily, color: Colors.black, fontWeight: FontWeight.w800); class RecoveryScreen extends StatefulWidget { - const RecoveryScreen({Key? key}) : super(key: key); + const RecoveryScreen({super.key}); @override State createState() => _RecoveryScreenState(); @@ -88,13 +88,13 @@ class _RecoveryScreenState extends State { RecoveryForwardItem( title: LocaleKeys.view_recovery_phrase.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_VIEW_RECOVERY_PHRASE); + Navigator.of(context).pushNamed(Routes.viewRecoveryPhrase.name); }, ), RecoveryForwardItem( title: LocaleKeys.practice_test.tr(), onPressed: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_PRACTICE_TEST); + Navigator.of(context).pushNamed(Routes.practiceTest.name); }, ), ], @@ -108,7 +108,7 @@ class RecoveryForwardItem extends StatelessWidget { final String title; final VoidCallback onPressed; - const RecoveryForwardItem({required this.title, Key? key, required this.onPressed}) : super(key: key); + const RecoveryForwardItem({required this.title, super.key, required this.onPressed}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/recovery_screen/screens/practice_test.dart b/wallet/lib/pages/settings/screens/recovery_screen/screens/practice_test.dart index 65bc4a5b0d..0738f728c4 100644 --- a/wallet/lib/pages/settings/screens/recovery_screen/screens/practice_test.dart +++ b/wallet/lib/pages/settings/screens/recovery_screen/screens/practice_test.dart @@ -18,7 +18,7 @@ TextStyle kPracticeTestHeadlineText = TextStyle(fontSize: 28.sp, fontFamily: kUn TextStyle kPracticeTestSubtitleText = TextStyle(fontSize: 15.sp, fontFamily: kUniversalFontFamily, color: AppColors.kBlue, fontWeight: FontWeight.w800); class PracticeTest extends StatefulWidget { - const PracticeTest({Key? key}) : super(key: key); + const PracticeTest({super.key}); @override State createState() => _PracticeTestState(); } @@ -327,10 +327,10 @@ class MnemonicList extends StatelessWidget { final Function onAcceptF; final ScrollController scroller; const MnemonicList({ - Key? key, + super.key, required this.onAcceptF, required this.scroller, - }) : super(key: key); + }); @override Widget build(BuildContext context) { final List givenListNotifier = context.read().givenListNotifier.value; @@ -414,7 +414,7 @@ class PracticeTestMnemonic extends StatelessWidget { final bool showSequenceNo; final Mnemonic mnemonic; final int index; - const PracticeTestMnemonic({Key? key, required this.showSequenceNo, required this.mnemonic, required this.index}) : super(key: key); + const PracticeTestMnemonic({super.key, required this.showSequenceNo, required this.mnemonic, required this.index}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart b/wallet/lib/pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart index 442e2bd2de..3a583e3c5b 100644 --- a/wallet/lib/pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart +++ b/wallet/lib/pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart @@ -28,7 +28,7 @@ TextStyle kRecoveryMnemonicText = TextStyle(fontSize: 18.sp, fontFamily: kUniver TextStyle kRecoveryMnemonicIndexText = TextStyle(fontSize: 10.sp, fontFamily: kUniversalFontFamily, color: Colors.white, fontWeight: FontWeight.w800); class ViewRecoveryScreen extends StatefulWidget { - const ViewRecoveryScreen({Key? key}) : super(key: key); + const ViewRecoveryScreen({super.key}); @override State createState() => _ViewRecoveryScreenState(); @@ -187,7 +187,7 @@ class _ViewRecoveryScreenState extends State { SizedBox(height: 30.h), InkWell( onTap: () { - Navigator.of(context).pushNamed(RouteUtil.ROUTE_PRACTICE_TEST); + Navigator.of(context).pushNamed(Routes.practiceTest.name); }, child: Text( LocaleKeys.practice_test.tr(), @@ -285,7 +285,7 @@ class RecoveryForwardItem extends StatelessWidget { final String title; final VoidCallback onPressed; - const RecoveryForwardItem({required this.title, Key? key, required this.onPressed}) : super(key: key); + const RecoveryForwardItem({required this.title, super.key, required this.onPressed}); @override Widget build(BuildContext context) { @@ -346,7 +346,7 @@ class MnemonicClipper extends CustomClipper { class MnemonicList extends StatelessWidget { final List mnemonic; - const MnemonicList({Key? key, required this.mnemonic}) : super(key: key); + const MnemonicList({super.key, required this.mnemonic}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/pages/settings/screens/submit_feedback.dart b/wallet/lib/pages/settings/screens/submit_feedback.dart index d45b5373f1..d964c2c132 100644 --- a/wallet/lib/pages/settings/screens/submit_feedback.dart +++ b/wallet/lib/pages/settings/screens/submit_feedback.dart @@ -32,7 +32,7 @@ class SubmitFeedback { } class _SubmitFeedbackDialogContent extends StatefulWidget { - const _SubmitFeedbackDialogContent({Key? key}) : super(key: key); + const _SubmitFeedbackDialogContent(); @override State<_SubmitFeedbackDialogContent> createState() => _SubmitFeedbackDialogContentState(); diff --git a/wallet/lib/pages/settings/settings_screen.dart b/wallet/lib/pages/settings/settings_screen.dart index 37a59ea6b9..c9584b005b 100644 --- a/wallet/lib/pages/settings/settings_screen.dart +++ b/wallet/lib/pages/settings/settings_screen.dart @@ -29,7 +29,7 @@ TextStyle kSettingsUserEnteredTextStyle = TextStyle( TextStyle kSettingsUserNameTextStyle = TextStyle(fontSize: 18.sp, fontFamily: kUniversalFontFamily, color: AppColors.kSettingsUserNameColor, fontWeight: FontWeight.w500); class SettingScreen extends StatefulWidget { - const SettingScreen({Key? key}) : super(key: key); + const SettingScreen({super.key}); @override State createState() => _SettingScreenState(); @@ -263,7 +263,7 @@ class _SettingScreenState extends State { imagePath: Assets.images.svg.settingsGeneral, onPressed: () { ScaffoldMessenger.of(context).hideCurrentSnackBar(); - Navigator.of(context).pushNamed(RouteUtil.ROUTE_GENERAL); + Navigator.of(context).pushNamed(Routes.general.name); }, ), const SettingsDivider(), @@ -272,7 +272,7 @@ class _SettingScreenState extends State { imagePath: Assets.images.svg.settingsRecovery, onPressed: () { ScaffoldMessenger.of(context).hideCurrentSnackBar(); - Navigator.of(context).pushNamed(RouteUtil.ROUTE_RECOVERY); + Navigator.of(context).pushNamed(Routes.recovery.name); }, ), const SettingsDivider(), @@ -281,7 +281,7 @@ class _SettingScreenState extends State { imagePath: Assets.images.svg.settingsLegal, onPressed: () { ScaffoldMessenger.of(context).hideCurrentSnackBar(); - Navigator.of(context).pushNamed(RouteUtil.ROUTE_LEGAL); + Navigator.of(context).pushNamed(Routes.legal.name); }, ), const SettingsDivider(), @@ -357,7 +357,7 @@ class SettingListItem extends StatefulWidget { final String imagePath; final VoidCallback onPressed; - const SettingListItem({Key? key, required this.title, required this.imagePath, required this.onPressed}) : super(key: key); + const SettingListItem({super.key, required this.title, required this.imagePath, required this.onPressed}); @override State createState() => _SettingListItemState(); diff --git a/wallet/lib/pages/settings/widgets/delete_dialog.dart b/wallet/lib/pages/settings/widgets/delete_dialog.dart index e2c62f975e..7a5c42b79a 100644 --- a/wallet/lib/pages/settings/widgets/delete_dialog.dart +++ b/wallet/lib/pages/settings/widgets/delete_dialog.dart @@ -100,7 +100,7 @@ class DeleteDialog { await GetIt.I.get().saveNetworkEnvironmentPreference( networkEnvironment: selectedEnvResponse.getOrElse(() => '')); - navigator.pushNamedAndRemoveUntil(RouteUtil.ROUTE_ONBOARDING, (route) => false); + navigator.pushNamedAndRemoveUntil(Routes.onboarding.name, (route) => false); })), SizedBox( width: 15.w, diff --git a/wallet/lib/pages/stripe_screen.dart b/wallet/lib/pages/stripe_screen.dart index 04377f4565..9d5143c5e4 100644 --- a/wallet/lib/pages/stripe_screen.dart +++ b/wallet/lib/pages/stripe_screen.dart @@ -18,7 +18,11 @@ class StripeScreen extends StatefulWidget { final String url; final VoidCallback onBack; - const StripeScreen({Key? key, required this.url, required this.onBack}) : super(key: key); + const StripeScreen({ + super.key, + required this.url, + required this.onBack, + }); @override State createState() => _StripeScreenState(); diff --git a/wallet/lib/pages/transaction_failure_manager/local_transaction_detail_screen.dart b/wallet/lib/pages/transaction_failure_manager/local_transaction_detail_screen.dart index 1fa332df31..325c1c595f 100644 --- a/wallet/lib/pages/transaction_failure_manager/local_transaction_detail_screen.dart +++ b/wallet/lib/pages/transaction_failure_manager/local_transaction_detail_screen.dart @@ -21,7 +21,7 @@ import '../../generated/locale_keys.g.dart'; TextStyle _titleTextStyle = TextStyle(color: AppColors.kBlack, fontFamily: kUniversalFontFamily, fontWeight: FontWeight.bold, fontSize: 20.sp); class LocalTransactionDetailScreen extends StatefulWidget { - const LocalTransactionDetailScreen({Key? key}) : super(key: key); + const LocalTransactionDetailScreen({super.key}); @override State createState() => _LocalTransactionDetailScreenState(); diff --git a/wallet/lib/pages/transaction_failure_manager/local_transactions_screen.dart b/wallet/lib/pages/transaction_failure_manager/local_transactions_screen.dart index ab56ce2775..79072ce1aa 100644 --- a/wallet/lib/pages/transaction_failure_manager/local_transactions_screen.dart +++ b/wallet/lib/pages/transaction_failure_manager/local_transactions_screen.dart @@ -18,7 +18,7 @@ import 'package:pylons_wallet/utils/extension.dart'; import '../../generated/locale_keys.g.dart'; class LocalTransactionsScreen extends StatefulWidget { - const LocalTransactionsScreen({Key? key}) : super(key: key); + const LocalTransactionsScreen({super.key}); @override State createState() => _LocalTransactionsScreenState(); diff --git a/wallet/lib/pages/transaction_failure_manager/widgets/my_list_tile.dart b/wallet/lib/pages/transaction_failure_manager/widgets/my_list_tile.dart index b8ea51b199..3428b2f581 100644 --- a/wallet/lib/pages/transaction_failure_manager/widgets/my_list_tile.dart +++ b/wallet/lib/pages/transaction_failure_manager/widgets/my_list_tile.dart @@ -11,18 +11,18 @@ class MyListTile extends StatelessWidget { final LocalTransactionModel txModel; const MyListTile({ - Key? key, + super.key, required this.leadingWidget, required this.titleWidget, required this.trailingWidget, required this.txModel, - }) : super(key: key); + }); @override Widget build(BuildContext context) { return InkWell( onTap: () { - Navigator.of(navigatorKey.currentState!.overlay!.context).pushNamed(RouteUtil.ROUTE_LOCAL_TRX_DETAILS, arguments: txModel); + Navigator.of(navigatorKey.currentState!.overlay!.context).pushNamed(Routes.localTransactionDetails.name, arguments: txModel); }, child: SizedBox( height: 40.h, diff --git a/wallet/lib/pylons_app.dart b/wallet/lib/pylons_app.dart index 2024763ba7..3c6c1aff61 100644 --- a/wallet/lib/pylons_app.dart +++ b/wallet/lib/pylons_app.dart @@ -16,33 +16,9 @@ import 'package:provider/provider.dart'; import 'package:pylons_wallet/components/loading.dart'; import 'package:pylons_wallet/components/no_internet.dart'; import 'package:pylons_wallet/components/pylons_app_theme.dart'; -import 'package:pylons_wallet/model/nft.dart'; -import 'package:pylons_wallet/pages/detailed_asset_view/owner_view.dart'; import 'package:pylons_wallet/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart'; -import 'package:pylons_wallet/pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart'; -import 'package:pylons_wallet/pages/home/home.dart'; import 'package:pylons_wallet/pages/home/home_provider.dart'; -import 'package:pylons_wallet/pages/home/message_screen/message_screen.dart'; -import 'package:pylons_wallet/pages/home/wallet_screen/add_pylon_screen.dart'; -import 'package:pylons_wallet/pages/home/wallet_screen/widgets/transaction_details.dart'; -import 'package:pylons_wallet/pages/presenting_onboard_page/presenting_onboard_page.dart'; -import 'package:pylons_wallet/pages/presenting_onboard_page/screens/create_wallet_screen.dart'; -import 'package:pylons_wallet/pages/presenting_onboard_page/screens/restore_wallet_screen.dart'; -import 'package:pylons_wallet/pages/routing_page/splash_screen.dart'; -import 'package:pylons_wallet/pages/purchase_item/purchase_item_screen.dart'; -import 'package:pylons_wallet/pages/routing_page/update_app.dart'; -import 'package:pylons_wallet/pages/settings/screens/general_screen/general_screen.dart'; -import 'package:pylons_wallet/pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart'; -import 'package:pylons_wallet/pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart'; -import 'package:pylons_wallet/pages/settings/screens/general_screen/screens/security_screen.dart'; -import 'package:pylons_wallet/pages/settings/screens/legal_screen.dart'; -import 'package:pylons_wallet/pages/settings/screens/recovery_screen/recovery_screen.dart'; -import 'package:pylons_wallet/pages/settings/screens/recovery_screen/screens/practice_test.dart'; -import 'package:pylons_wallet/pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart'; -import 'package:pylons_wallet/pages/settings/settings_screen.dart'; import 'package:pylons_wallet/pages/settings/utils/user_info_provider.dart'; -import 'package:pylons_wallet/pages/transaction_failure_manager/local_transaction_detail_screen.dart'; -import 'package:pylons_wallet/pages/transaction_failure_manager/local_transactions_screen.dart'; import 'package:pylons_wallet/providers/account_provider.dart'; import 'package:pylons_wallet/providers/items_provider.dart'; import 'package:pylons_wallet/providers/recipes_provider.dart'; @@ -55,10 +31,10 @@ import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/dependency_injection/dependency_injection.dart'; import 'package:pylons_wallet/utils/enums.dart'; import 'package:pylons_wallet/utils/route_util.dart'; +import 'package:pylons_wallet/utils/types.dart'; import 'generated/locale_keys.g.dart'; import 'model/transaction_failure_model.dart'; -import 'pages/presenting_onboard_page/screens/accept_policy_screen.dart'; import 'providers/collections_tab_provider.dart'; GlobalKey navigatorKey = GlobalKey(); @@ -66,8 +42,11 @@ GlobalKey navigatorKey = GlobalKey(); final noInternet = NoInternetDialog(); class PylonsApp extends StatefulWidget { + const PylonsApp({required this.onLogMessage}); @override State createState() => _PylonsAppState(); + + final OnLogMessage onLogMessage; } class _PylonsAppState extends State with WidgetsBindingObserver { @@ -155,88 +134,9 @@ class _PylonsAppState extends State with WidgetsBindingObserver { title: "Pylons Wallet", theme: PylonsAppTheme().buildAppTheme(), initialRoute: '/', - routes: { - '/': (context) => const SplashScreen(), - RouteUtil.ROUTE_HOME: (context) => const HomeScreen(), - RouteUtil.ROUTE_APP_UPDATE: (context) => const UpdateApp(), - RouteUtil.ROUTE_SETTINGS: (context) => const SettingScreen(), - RouteUtil.ROUTE_LEGAL: (context) => const LegalScreen(), - RouteUtil.ROUTE_RECOVERY: (context) => const RecoveryScreen(), - RouteUtil.ROUTE_GENERAL: (context) => const GeneralScreen(), - RouteUtil.ROUTE_SECURITY: (context) => const SecurityScreen(), - RouteUtil.ROUTE_PAYMENT: (context) => const PaymentScreen(), - RouteUtil.ROUTE_PRACTICE_TEST: (context) => const PracticeTest(), - RouteUtil.ROUTE_VIEW_RECOVERY_PHRASE: (context) => const ViewRecoveryScreen(), - RouteUtil.ROUTE_TRANSACTION_HISTORY: (context) => const TransactionHistoryScreen(), - RouteUtil.ROUTE_ONBOARDING: (context) => const PresentingOnboardPage(), - RouteUtil.ROUTE_CREATE_WALLET: (context) => const CreateWalletScreen(), - RouteUtil.ROUTE_RESTORE_WALLET: (context) => const RestoreWalletScreen(), - RouteUtil.ROUTE_ADD_PYLON: (context) => const AddPylonScreen(), - RouteUtil.ROUTE_TRANSACTION_DETAIL: (context) => const TransactionDetailsScreen(), - RouteUtil.ROUTE_MESSAGE: (context) => const MessagesScreen(), - RouteUtil.ROUTE_PDF_FULL_SCREEN: (context) => const PdfViewerFullScreen(), - RouteUtil.ROUTE_FAILURE: (context) => const LocalTransactionsScreen(), - RouteUtil.ROUTE_LOCAL_TRX_DETAILS: (context) => const LocalTransactionDetailScreen(), - RouteUtil.ROUTE_OWNER_VIEW: (context) { - if (ModalRoute.of(context) == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments is NFT) { - final nft = ModalRoute.of(context)!.settings.arguments! as NFT; - - return OwnerView( - key: ValueKey(nft), - nft: nft, - ); - } - - return const SizedBox(); - }, - RouteUtil.ROUTE_PURCHASE_VIEW: (context) { - if (ModalRoute.of(context) == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments is NFT) { - final nft = ModalRoute.of(context)!.settings.arguments! as NFT; - - return PurchaseItemScreen( - key: ValueKey(nft), - nft: nft, - ); - } - - return const SizedBox(); - }, - RouteUtil.ROUTE_ACCEPT_POLICY: (context) { - if (ModalRoute.of(context) == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments == null) { - return const SizedBox(); - } - - if (ModalRoute.of(context)?.settings.arguments is NFT) { - final nft = ModalRoute.of(context)!.settings.arguments! as NFT; - - return AcceptPolicyScreen( - nft: nft, - viewModel: sl(), - ); - } - - return const SizedBox(); - }, + onGenerateRoute: (settings) { + widget.onLogMessage("Navigated to ${settings.name}: ${settings.arguments}"); + return RouteUtil.onGenerateRoute(settings); }, builder: (context, widget) { return Material( @@ -279,7 +179,7 @@ class _PylonsAppState extends State with WidgetsBindingObserver { registerFailure(purchaseDetails); purchaseDetails.error?.message.show(); await Future.delayed(const Duration(seconds: 2)); - navigator.pushNamed(RouteUtil.ROUTE_FAILURE); + navigator.pushNamed(Routes.transactionFailure.name); break; case PurchaseStatus.restored: @@ -452,7 +352,7 @@ class _PylonsAppState extends State with WidgetsBindingObserver { loading.dismiss(); googleInAppPurchase.getLeft().message.show(); await Future.delayed(const Duration(seconds: 2)); - navigator.pushNamed(RouteUtil.ROUTE_FAILURE); + navigator.pushNamed(Routes.transactionFailure.name); return; } diff --git a/wallet/lib/stores/wallet_store_imp.dart b/wallet/lib/stores/wallet_store_imp.dart index c32ea2e78b..5857f005ba 100644 --- a/wallet/lib/stores/wallet_store_imp.dart +++ b/wallet/lib/stores/wallet_store_imp.dart @@ -816,10 +816,6 @@ class WalletsStoreImp implements WalletsStore { final getUsernameBasedOnAddress = await repository.getUsername(address: wallet.bech32Address); - if (getUsernameBasedOnAddress.isLeft()) { - return Left(getUsernameBasedOnAddress.getLeft()); - } - final userName = getUsernameBasedOnAddress.getOrElse(() => ''); final creds = AlanPrivateAccountCredentials( diff --git a/wallet/lib/utils/custom_transaction_broadcaster/custom_transaction_broadcaster_imp.dart b/wallet/lib/utils/custom_transaction_broadcaster/custom_transaction_broadcaster_imp.dart index 348e982058..93d561dfec 100644 --- a/wallet/lib/utils/custom_transaction_broadcaster/custom_transaction_broadcaster_imp.dart +++ b/wallet/lib/utils/custom_transaction_broadcaster/custom_transaction_broadcaster_imp.dart @@ -32,8 +32,7 @@ class CustomTransactionBroadcasterImp implements CustomTransactionBroadcaster { "passed privateCredentials is not $AlanPrivateAccountCredentials")); } final txSender = TxSender.fromNetworkInfo(_networkInfo); - final response = await txSender.broadcastTx(transaction.signedTransaction, - mode: BroadcastMode.BROADCAST_MODE_BLOCK); + final response = await txSender.broadcastTx(transaction.signedTransaction); if (response.hasCode()) { if (response.code != 0) { diff --git a/wallet/lib/utils/dependency_injection/dependency_injection.dart b/wallet/lib/utils/dependency_injection/dependency_injection.dart index 285aefc0e9..a0321bafda 100644 --- a/wallet/lib/utils/dependency_injection/dependency_injection.dart +++ b/wallet/lib/utils/dependency_injection/dependency_injection.dart @@ -76,6 +76,7 @@ final sl = GetIt.instance; Future init({ required OnLogEvent onLogEvent, required OnLogError onLogError, + required OnLogMessage onLogMessage, }) async { /// Services sl.registerLazySingleton( diff --git a/wallet/lib/utils/failure/failure.dart b/wallet/lib/utils/failure/failure.dart index 5538bc76cf..b13cfc136a 100644 --- a/wallet/lib/utils/failure/failure.dart +++ b/wallet/lib/utils/failure/failure.dart @@ -7,119 +7,119 @@ abstract class Failure extends Equatable { } class TxNotFoundFailure extends Failure { - const TxNotFoundFailure(String message) : super(message); + const TxNotFoundFailure(super.message); @override List get props => [message]; } class RecipeNotFoundFailure extends Failure { - const RecipeNotFoundFailure(String message) : super(message); + const RecipeNotFoundFailure(super.message); @override List get props => [message]; } class CookBookNotFoundFailure extends Failure { - const CookBookNotFoundFailure(String message) : super(message); + const CookBookNotFoundFailure(super.message); @override List get props => [message]; } class NoInternetFailure extends Failure { - const NoInternetFailure(String message) : super(message); + const NoInternetFailure(super.message); @override List get props => [message]; } class StripeFailure extends Failure { - const StripeFailure(String message) : super(message); + const StripeFailure(super.message); @override List get props => [message]; } class WalletCreationFailure extends Failure { - const WalletCreationFailure(String message) : super(message); + const WalletCreationFailure(super.message); @override List get props => [message]; } class ExecutionNotFoundFailure extends Failure { - const ExecutionNotFoundFailure(String message) : super(message); + const ExecutionNotFoundFailure(super.message); @override List get props => [message]; } class ServerFailure extends Failure { - const ServerFailure(String message) : super(message); + const ServerFailure(super.message); @override List get props => [message]; } class ItemNotFoundFailure extends Failure { - const ItemNotFoundFailure(String message) : super(message); + const ItemNotFoundFailure(super.message); @override List get props => [message]; } class TradeNotFoundFailure extends Failure { - const TradeNotFoundFailure(String message) : super(message); + const TradeNotFoundFailure(super.message); @override List get props => [message]; } class UsernameAddressFoundFailure extends Failure { - const UsernameAddressFoundFailure(String message) : super(message); + const UsernameAddressFoundFailure(super.message); @override List get props => [message]; } class InvalidInputFailure extends Failure { - const InvalidInputFailure(String message) : super(message); + const InvalidInputFailure(super.message); @override List get props => [message]; } class AccountAlreadyExistsFailure extends Failure { - const AccountAlreadyExistsFailure(String message) : super(message); + const AccountAlreadyExistsFailure(super.message); @override List get props => [message]; } class AccountCreationFailure extends Failure { - const AccountCreationFailure(String message) : super(message); + const AccountCreationFailure(super.message); @override List get props => [message]; } class CacheFailure extends Failure { - const CacheFailure(String message) : super(message); + const CacheFailure(super.message); @override List get props => [message]; } class FirebaseDynamicLinkFailure extends Failure { - const FirebaseDynamicLinkFailure(String message) : super(message); + const FirebaseDynamicLinkFailure(super.message); @override List get props => [message]; } class PlatformFailure extends Failure { - const PlatformFailure(String message) : super(message); + const PlatformFailure(super.message); @override List get props => [message]; @@ -170,14 +170,14 @@ class FetchAllNotificationFailure extends Failure { } class FcmTokenRetrievalError extends Failure { - const FcmTokenRetrievalError(String message) : super(message); + const FcmTokenRetrievalError(super.message); @override List get props => [message]; } class AppCheckTokenFailure extends Failure { - const AppCheckTokenFailure(String message) : super(message); + const AppCheckTokenFailure(super.message); @override List get props => [message]; @@ -212,14 +212,14 @@ class MarkReadNotificationFailure extends Failure { } class SavingLocalDataFailure extends Failure { - const SavingLocalDataFailure(String message) : super(message); + const SavingLocalDataFailure(super.message); @override List get props => [message]; } class GettingLocalDataFailure extends Failure { - const GettingLocalDataFailure(String message) : super(message); + const GettingLocalDataFailure(super.message); @override List get props => [message]; diff --git a/wallet/lib/utils/linked_scroll_controller.dart b/wallet/lib/utils/linked_scroll_controller.dart index f8632ff43f..8c85cea263 100644 --- a/wallet/lib/utils/linked_scroll_controller.dart +++ b/wallet/lib/utils/linked_scroll_controller.dart @@ -112,7 +112,7 @@ class _LinkedScrollControllerGroupOffsetNotifier extends ChangeNotifier { class _LinkedScrollController extends ScrollController { final LinkedScrollControllerGroup _controllers; - _LinkedScrollController(this._controllers, {required double initialScrollOffset}) : super(initialScrollOffset: initialScrollOffset, keepScrollOffset: false); + _LinkedScrollController(this._controllers, {required super.initialScrollOffset}) : super(keepScrollOffset: false); @override void dispose() { @@ -178,16 +178,11 @@ class _LinkedScrollController extends ScrollController { class _LinkedScrollPosition extends ScrollPositionWithSingleContext { _LinkedScrollPosition( this.owner, { - required ScrollPhysics physics, - required ScrollContext context, - double? initialPixels, - ScrollPosition? oldPosition, - }) : super( - physics: physics, - context: context, - initialPixels: initialPixels, - oldPosition: oldPosition, - ); + required super.physics, + required super.context, + super.initialPixels = null, + super.oldPosition, + }); final _LinkedScrollController owner; @@ -286,7 +281,7 @@ class _LinkedScrollPosition extends ScrollPositionWithSingleContext { } class _LinkedScrollActivity extends ScrollActivity { - _LinkedScrollActivity(_LinkedScrollPosition delegate) : super(delegate); + _LinkedScrollActivity(_LinkedScrollPosition super.delegate); @override _LinkedScrollPosition get delegate => super.delegate as _LinkedScrollPosition; diff --git a/wallet/lib/utils/read_more.dart b/wallet/lib/utils/read_more.dart index 8f1bdb4ef0..33f5edbda2 100644 --- a/wallet/lib/utils/read_more.dart +++ b/wallet/lib/utils/read_more.dart @@ -12,7 +12,7 @@ enum TrimMode { class ReadMoreText extends StatefulWidget { const ReadMoreText( this.data, { - Key? key, + super.key, this.trimExpandedText = 'show less', this.trimCollapsedText = 'read more', this.colorClickableText, @@ -30,7 +30,7 @@ class ReadMoreText extends StatefulWidget { this.delimiter = '$_kEllipsis ', this.delimiterStyle, this.callback, - }) : super(key: key); + }); /// Used on TrimMode.Length final int trimLength; diff --git a/wallet/lib/utils/route_util.dart b/wallet/lib/utils/route_util.dart index 2dae1ad41e..0b29aa77d7 100644 --- a/wallet/lib/utils/route_util.dart +++ b/wallet/lib/utils/route_util.dart @@ -1,27 +1,197 @@ +// ignore_for_file: cast_nullable_to_non_nullable + +import 'package:flutter/material.dart'; +import 'package:pylons_wallet/pages/settings/screens/general_screen/general_screen.dart'; +import 'package:pylons_wallet/pages/settings/screens/recovery_screen/recovery_screen.dart'; + +import '../model/nft.dart'; +import '../pages/detailed_asset_view/owner_view.dart'; +import '../pages/detailed_asset_view/widgets/pdf_viewer_full_screen.dart'; +import '../pages/home/home.dart'; +import '../pages/home/message_screen/message_screen.dart'; +import '../pages/home/wallet_screen/add_pylon_screen.dart'; +import '../pages/home/wallet_screen/widgets/transaction_details.dart'; +import '../pages/presenting_onboard_page/presenting_onboard_page.dart'; +import '../pages/presenting_onboard_page/screens/accept_policy_screen.dart'; +import '../pages/presenting_onboard_page/screens/create_wallet_screen.dart'; +import '../pages/presenting_onboard_page/screens/restore_wallet_screen.dart'; +import '../pages/purchase_item/purchase_item_screen.dart'; +import '../pages/routing_page/splash_screen.dart'; +import '../pages/routing_page/update_app.dart'; +import '../pages/settings/screens/general_screen/screens/payment_screen/payment_screen.dart'; +import '../pages/settings/screens/general_screen/screens/payment_screen/screens/transaction_history.dart'; +import '../pages/settings/screens/general_screen/screens/security_screen.dart'; +import '../pages/settings/screens/legal_screen.dart'; +import '../pages/settings/screens/recovery_screen/screens/practice_test.dart'; +import '../pages/settings/screens/recovery_screen/screens/view_recovery_phrase.dart'; +import '../pages/settings/settings_screen.dart'; +import '../pages/transaction_failure_manager/local_transaction_detail_screen.dart'; +import '../pages/transaction_failure_manager/local_transactions_screen.dart'; +import 'dependency_injection/dependency_injection.dart'; + class RouteUtil { RouteUtil(); + static Route? onGenerateRoute(RouteSettings settings) { + final route = Routes.getAppRouteFromString(settings.name ?? ""); + switch (route) { + case Routes.initial: + return createRoute(const SplashScreen()); + case Routes.home: + return createRoute(const HomeScreen()); + case Routes.appUpdate: + return createRoute(const UpdateApp()); + case Routes.settings: + return createRoute(const SettingScreen()); + case Routes.legal: + return createRoute(const LegalScreen()); + case Routes.recovery: + return createRoute(const RecoveryScreen()); + case Routes.general: + return createRoute(const GeneralScreen()); + case Routes.security: + return createRoute(const SecurityScreen()); + case Routes.payment: + return createRoute(const PaymentScreen()); + case Routes.practiceTest: + return createRoute(const PracticeTest()); + case Routes.viewRecoveryPhrase: + return createRoute(const ViewRecoveryScreen()); + case Routes.onboarding: + return createRoute(const PresentingOnboardPage()); + case Routes.createWallet: + return createRoute(const CreateWalletScreen()); + case Routes.restoreWallet: + return createRoute(const RestoreWalletScreen()); + case Routes.addPylon: + return createRoute(const AddPylonScreen()); + case Routes.trasactionDetail: + return createRoute(const TransactionDetailsScreen()); + case Routes.message: + return createRoute(const MessagesScreen()); + case Routes.pdfFullScreen: + return createRoute(const PdfViewerFullScreen()); + case Routes.transactionFailure: + return createRoute(const LocalTransactionsScreen()); + case Routes.ownerView: + if (settings.arguments != null && settings.arguments is NFT) { + return createRoute(OwnerView( + key: ValueKey(settings.arguments), + nft: settings.arguments as NFT, + )); + } + + return createRoute(const SizedBox()); + case Routes.purchaseView: + if (settings.arguments != null && settings.arguments is NFT) { + return createRoute(PurchaseItemScreen( + key: ValueKey(settings.arguments), + nft: settings.arguments as NFT, + )); + } + + return createRoute(const SizedBox()); + case Routes.acceptPolicy: + if (settings.arguments != null && settings.arguments is NFT) { + return createRoute(AcceptPolicyScreen( + nft: settings.arguments as NFT, + viewModel: sl(), + )); + } + + return createRoute(const SizedBox()); + case Routes.localTransactionDetails: + return createRoute(const LocalTransactionDetailScreen()); + case Routes.fallback: + return createRoute(const SizedBox()); + case Routes.transactionHistory: + return createRoute(const TransactionHistoryScreen()); + } + } + + static MaterialPageRoute createRoute(Widget page) { + return MaterialPageRoute(builder: (_) => page); + } +} + +enum Routes { + initial, + home, + appUpdate, + settings, + legal, + recovery, + general, + security, + payment, + practiceTest, + viewRecoveryPhrase, + onboarding, + createWallet, + restoreWallet, + addPylon, + trasactionDetail, + message, + pdfFullScreen, + transactionFailure, + localTransactionDetails, + ownerView, + purchaseView, + transactionHistory, + acceptPolicy, + fallback; - static String ROUTE_HOME = "/home"; - static String ROUTE_APP_UPDATE = "/app_update"; - static String ROUTE_SETTINGS = "/settings"; - static String ROUTE_LEGAL = "/legal"; - static String ROUTE_RECOVERY = "/recovery"; - static String ROUTE_GENERAL = "/general"; - static String ROUTE_PAYMENT = "/payment"; - static String ROUTE_SECURITY = "/security"; - static String ROUTE_VIEW_RECOVERY_PHRASE = "/view-recovery-phrase"; - static String ROUTE_PRACTICE_TEST = "/practice-test"; - static String ROUTE_TRANSACTION_HISTORY = "/transaction-history"; - static String ROUTE_ONBOARDING = "/onboarding"; - static String ROUTE_CREATE_WALLET = "/create_wallet"; - static String ROUTE_RESTORE_WALLET = "/restore_wallet"; - static String ROUTE_ADD_PYLON = "/add_pylon"; - static String ROUTE_TRANSACTION_DETAIL = "/transaction_detail"; - static String ROUTE_MESSAGE = "/message_screen"; - static String ROUTE_FAILURE = "/failure_screen"; - static String ROUTE_LOCAL_TRX_DETAILS = "/local_transaction_details_screen"; - static String ROUTE_PDF_FULL_SCREEN = "/pdf_full_screen"; - static String ROUTE_OWNER_VIEW = "/owner_view"; - static String ROUTE_PURCHASE_VIEW = "/purchase_view"; - static String ROUTE_ACCEPT_POLICY = "/accept_policy"; + static Routes getAppRouteFromString(String routeName) { + switch (routeName) { + case '/': + return initial; + case 'home': + return home; + case 'appUpdate': + return appUpdate; + case 'settings': + return settings; + case 'legal': + return legal; + case 'recovery': + return recovery; + case 'general': + return general; + case 'security': + return security; + case 'payment': + return payment; + case 'practiceTest': + return practiceTest; + case 'viewRecoveryPhrase': + return viewRecoveryPhrase; + case 'onboarding': + return onboarding; + case 'createWallet': + return createWallet; + case 'restoreWallet': + return restoreWallet; + case 'addPylon': + return addPylon; + case 'trasactionDetail': + return trasactionDetail; + case 'message': + return message; + case 'pdfFullScreen': + return pdfFullScreen; + case 'transactionFailure': + return transactionFailure; + case 'ownerView': + return ownerView; + case 'purchaseView': + return purchaseView; + case 'acceptPolicy': + return acceptPolicy; + case 'localTransactionDetails': + return localTransactionDetails; + case 'transactionHistory': + return transactionHistory; + default: + return fallback; + } + } } diff --git a/wallet/lib/utils/screen_responsive.dart b/wallet/lib/utils/screen_responsive.dart index 438df846e7..697f1556a0 100644 --- a/wallet/lib/utils/screen_responsive.dart +++ b/wallet/lib/utils/screen_responsive.dart @@ -6,8 +6,7 @@ class ScreenResponsive extends StatelessWidget { final WidgetBuilder tabletScreen; const ScreenResponsive( - {Key? key, required this.mobileScreen, required this.tabletScreen}) - : super(key: key); + {super.key, required this.mobileScreen, required this.tabletScreen}); @override Widget build(BuildContext context) { diff --git a/wallet/lib/utils/types.dart b/wallet/lib/utils/types.dart index b037509805..06232d2451 100644 --- a/wallet/lib/utils/types.dart +++ b/wallet/lib/utils/types.dart @@ -6,6 +6,9 @@ typedef OnLogError = void Function( typedef OnLogEvent = void Function(AnalyticsEventEnum event); +typedef OnLogMessage = void Function(String message); + + enum AnalyticsEventEnum { noLink, chromeThrowLink, diff --git a/wallet/pkgs/transaction_signing_gateway/lib/alan/alan_transaction_broadcaster.dart b/wallet/pkgs/transaction_signing_gateway/lib/alan/alan_transaction_broadcaster.dart index 0505fc4db4..870acb6abb 100644 --- a/wallet/pkgs/transaction_signing_gateway/lib/alan/alan_transaction_broadcaster.dart +++ b/wallet/pkgs/transaction_signing_gateway/lib/alan/alan_transaction_broadcaster.dart @@ -28,7 +28,7 @@ class AlanTransactionBroadcaster implements TransactionBroadcaster { } final txSender = TxSender.fromNetworkInfo(_networkInfo); final response = - await txSender.broadcastTx(transaction.signedTransaction, mode: BroadcastMode.BROADCAST_MODE_BLOCK); + await txSender.broadcastTx(transaction.signedTransaction); if (response.hasTxhash()) { return right(response.toTransactionResponse()); diff --git a/wallet/pubspec.yaml b/wallet/pubspec.yaml index c6339e3ee8..5d22159e4e 100644 --- a/wallet/pubspec.yaml +++ b/wallet/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.0.1+172 environment: - sdk: ">=2.15.0 <3.0.0" + sdk: ">=2.17.0 <3.0.0" dependencies: advance_pdf_viewer: