Skip to content

Commit 815d752

Browse files
committed
fix(article): podcast image on large screens
1 parent 4a2ae8e commit 815d752

File tree

1 file changed

+61
-38
lines changed

1 file changed

+61
-38
lines changed

lib/helpers/news.dart

Lines changed: 61 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,9 @@ class ImageRenderer extends StatelessWidget {
17061706
),
17071707
)
17081708
: SizedBox(
1709-
height: MediaQuery.of(context).size.width / (16 / 9),
1709+
height: (isPodcastPreview ?? false)
1710+
? null
1711+
: MediaQuery.of(context).size.width / (16 / 9),
17101712
child: GestureDetector(
17111713
onTap: () {
17121714
showDialog(
@@ -1799,38 +1801,40 @@ class ImageRenderer extends StatelessWidget {
17991801
},
18001802
);
18011803
},
1802-
child: Stack(
1803-
alignment: Alignment.bottomCenter,
1804-
children: [
1805-
CachedNetworkImage(
1806-
imageUrl: imageUrl,
1807-
placeholder: (context, url) => SizedBox(
1808-
height:
1809-
MediaQuery.of(context).size.width / (16 / 9),
1810-
child: const LoadingIndicatorUtil(
1811-
replaceImage: true,
1812-
borderRadius: false,
1813-
fullBorderRadius: false,
1814-
),
1815-
),
1816-
errorWidget: (context, url, error) =>
1817-
ImageRequestErrorUtil(
1818-
height:
1819-
MediaQuery.of(context).size.width / (16 / 9),
1820-
),
1821-
fadeOutDuration: const Duration(milliseconds: 300),
1822-
fadeInDuration: const Duration(milliseconds: 300),
1823-
cacheManager: CacheManager(
1824-
Config(
1825-
"newsImages",
1826-
stalePeriod: const Duration(days: 1),
1827-
),
1828-
),
1829-
),
1830-
Container(
1831-
alignment: Alignment.bottomCenter,
1832-
child: caption != null && caption != ''
1833-
? Container(
1804+
child: caption != null && caption != ''
1805+
? Stack(
1806+
alignment: Alignment.bottomCenter,
1807+
children: [
1808+
CachedNetworkImage(
1809+
imageUrl: imageUrl,
1810+
placeholder: (context, url) => SizedBox(
1811+
height: MediaQuery.of(context).size.width /
1812+
(16 / 9),
1813+
child: const LoadingIndicatorUtil(
1814+
replaceImage: true,
1815+
borderRadius: false,
1816+
fullBorderRadius: false,
1817+
),
1818+
),
1819+
errorWidget: (context, url, error) =>
1820+
ImageRequestErrorUtil(
1821+
height: MediaQuery.of(context).size.width /
1822+
(16 / 9),
1823+
),
1824+
fadeOutDuration:
1825+
const Duration(milliseconds: 300),
1826+
fadeInDuration:
1827+
const Duration(milliseconds: 300),
1828+
cacheManager: CacheManager(
1829+
Config(
1830+
"newsImages",
1831+
stalePeriod: const Duration(days: 1),
1832+
),
1833+
),
1834+
),
1835+
Container(
1836+
alignment: Alignment.bottomCenter,
1837+
child: Container(
18341838
width: double.infinity,
18351839
padding: const EdgeInsets.all(4),
18361840
color: Colors.black.withOpacity(0.7),
@@ -1841,11 +1845,30 @@ class ImageRenderer extends StatelessWidget {
18411845
),
18421846
textAlign: TextAlign.center,
18431847
),
1844-
)
1845-
: Container(),
1846-
),
1847-
],
1848-
),
1848+
),
1849+
),
1850+
],
1851+
)
1852+
: CachedNetworkImage(
1853+
imageUrl: imageUrl,
1854+
placeholder: (context, url) => SizedBox(
1855+
child: const LoadingIndicatorUtil(
1856+
replaceImage: true,
1857+
borderRadius: false,
1858+
fullBorderRadius: false,
1859+
),
1860+
),
1861+
errorWidget: (context, url, error) =>
1862+
ImageRequestErrorUtil(),
1863+
fadeOutDuration: const Duration(milliseconds: 300),
1864+
fadeInDuration: const Duration(milliseconds: 300),
1865+
cacheManager: CacheManager(
1866+
Config(
1867+
"newsImages",
1868+
stalePeriod: const Duration(days: 1),
1869+
),
1870+
),
1871+
),
18491872
),
18501873
),
18511874
);

0 commit comments

Comments
 (0)