-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Steps to Reproduce
- Execute
flutter runon the code sample - Look at the screen
Expected results:
Since the source image has a wider aspect ratio than the BoxDecoration, and fitWidth is used in combination with repeatY, I would expect the image to be repeated vertically, like this:
Actual results:
Instead the image is drawn only once:
(Note that if BoxFit.fitWidth is changed to BoxFit.contain, then I get the expected behaviour in this example. But BoxFit.contain only fits the width if the source image has a wider aspect ratio than the BoxDecoration; I want to fit the width regardless of the aspect ratios).
A similar problem exists between fitHeight and repeatX (though to see it you'll have to modify the aspect ratios in my example program).
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(
FittedBox(
child: Container(
width: 100,
height: 200,
decoration: const BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: NetworkImage(
'https://docs.flutter.dev/assets/images/shared/brand/flutter/logo/flutter-lockup.png'),
fit: BoxFit.fitWidth,
repeat: ImageRepeat.repeatY,
),
),
),
),
);
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version

