From c7d114e2683eaa1a0fd8315ca199ffd4c3a63481 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 21 Jul 2023 19:11:33 -0500 Subject: [PATCH] remove nested AspectRatio --- lib/pages/ordinals/ordinal_details_view.dart | 23 ++-- .../desktop_ordinal_details_view.dart | 109 +++++++++--------- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/lib/pages/ordinals/ordinal_details_view.dart b/lib/pages/ordinals/ordinal_details_view.dart index 95cff734e..6f6d0b8a7 100644 --- a/lib/pages/ordinals/ordinal_details_view.dart +++ b/lib/pages/ordinals/ordinal_details_view.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:stackwallet/dto/ordinals/inscription_data.dart'; import 'package:stackwallet/models/ordinal.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/ordinals/widgets/dialogs.dart'; @@ -41,10 +40,10 @@ class _OrdinalDetailsViewState extends State { child: SafeArea( child: Scaffold( backgroundColor: - Theme.of(context).extension()!.background, + Theme.of(context).extension()!.background, appBar: AppBar( backgroundColor: - Theme.of(context).extension()!.background, + Theme.of(context).extension()!.background, leading: const AppBarBackButton(), title: Text( "Ordinal details", @@ -154,7 +153,7 @@ class _DetailsItemWCopy extends StatelessWidget { child: SvgPicture.asset( Assets.svg.copy, color: - Theme.of(context).extension()!.infoItemIcons, + Theme.of(context).extension()!.infoItemIcons, width: 12, ), ), @@ -200,15 +199,13 @@ class _OrdinalImageGroup extends StatelessWidget { // ), AspectRatio( aspectRatio: 1, - child: AspectRatio( - aspectRatio: 1, - child: Container( - color: Colors.red, - child: Image.network( - ordinal.content, // Use the preview URL as the image source - fit: BoxFit.cover, - filterQuality: FilterQuality.none, // Set the filter mode to nearest - ), + child: Container( + color: Colors.red, + child: Image.network( + ordinal.content, // Use the preview URL as the image source + fit: BoxFit.cover, + filterQuality: + FilterQuality.none, // Set the filter mode to nearest ), ), ), diff --git a/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart b/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart index 03cae351e..1477a0d2f 100644 --- a/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart +++ b/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart @@ -29,7 +29,8 @@ class DesktopOrdinalDetailsView extends StatefulWidget { static const routeName = "/desktopOrdinalDetailsView"; @override - _DesktopOrdinalDetailsViewState createState() => _DesktopOrdinalDetailsViewState(); + _DesktopOrdinalDetailsViewState createState() => + _DesktopOrdinalDetailsViewState(); } class _DesktopOrdinalDetailsViewState extends State { @@ -38,55 +39,55 @@ class _DesktopOrdinalDetailsViewState extends State { @override Widget build(BuildContext context) { return DesktopScaffold( - appBar: DesktopAppBar( - background: Theme.of(context).extension()!.popupBG, - leading: Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox( - width: 32, - ), - AppBarIconButton( - size: 32, + appBar: DesktopAppBar( + background: Theme.of(context).extension()!.popupBG, + leading: Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox( + width: 32, + ), + AppBarIconButton( + size: 32, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + shadows: const [], + icon: SvgPicture.asset( + Assets.svg.arrowLeft, + width: 18, + height: 18, color: Theme.of(context) .extension()! - .textFieldDefaultBG, - shadows: const [], - icon: SvgPicture.asset( - Assets.svg.arrowLeft, - width: 18, - height: 18, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, - ), - onPressed: Navigator.of(context).pop, + .topNavIconPrimary, ), - const SizedBox( - width: 18, - ), - SvgPicture.asset( - Assets.svg.ordinal, - width: 32, - height: 32, - color: - Theme.of(context).extension()!.textSubtitle1, - ), - const SizedBox( - width: 12, - ), - Text( - "Ordinals", - style: STextStyles.desktopH3(context), - ), - ], - ), + onPressed: Navigator.of(context).pop, + ), + const SizedBox( + width: 18, + ), + SvgPicture.asset( + Assets.svg.ordinal, + width: 32, + height: 32, + color: + Theme.of(context).extension()!.textSubtitle1, + ), + const SizedBox( + width: 12, + ), + Text( + "Ordinals", + style: STextStyles.desktopH3(context), + ), + ], ), - useSpacers: false, - isCompactHeight: true, ), - body: SingleChildScrollView( + useSpacers: false, + isCompactHeight: true, + ), + body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column( @@ -187,7 +188,7 @@ class _DetailsItemWCopy extends StatelessWidget { child: SvgPicture.asset( Assets.svg.copy, color: - Theme.of(context).extension()!.infoItemIcons, + Theme.of(context).extension()!.infoItemIcons, width: 12, ), ), @@ -233,15 +234,13 @@ class _OrdinalImageGroup extends StatelessWidget { // ), AspectRatio( aspectRatio: 1, - child: AspectRatio( - aspectRatio: 1, - child: Container( - color: Colors.red, - child: Image.network( - ordinal.content, // Use the preview URL as the image source - fit: BoxFit.cover, - filterQuality: FilterQuality.none, // Set the filter mode to nearest - ), + child: Container( + color: Colors.red, + child: Image.network( + ordinal.content, // Use the preview URL as the image source + fit: BoxFit.cover, + filterQuality: + FilterQuality.none, // Set the filter mode to nearest ), ), ),