mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-11-29 09:11:17 +01:00
8 lines
435 B
Dart
8 lines
435 B
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
/// The pixel width to decode a network image at so it fills [logicalWidth]
|
|
/// sharply on this screen — and no wider. Without it a thumbnail keeps the
|
|
/// full-size download decoded in memory. Null when the width is unbounded.
|
|
int? decodeWidthFor(BuildContext context, double logicalWidth) =>
|
|
logicalWidth.isFinite ? (logicalWidth * MediaQuery.devicePixelRatioOf(context)).ceil() : null;
|