-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Closed
Copy link
Labels
a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesa: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featuref: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2Found to occur in 2.2frameworkflutter/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
Exception has occurred.
"Error: Expected a value of type 'Decoration', but got one of type 'Null'
I believe the bug is somewhere in AnimatedContainer class and AnimationController class
Steps to Reproduce
- Run
flutter create bug. - Update the
main.dartas follows:
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(body: BugWidget()),
),
);
}
class BugWidget extends StatefulWidget {
@override
_BugWidgetState createState() => _BugWidgetState();
}
class _BugWidgetState extends State<BugWidget> {
final photoURL = "https://gravatar.com/avatar/11ef7c4b9749807b121e74cd353be3eb";
var radius = 20.0;
var toggleForegroundImage = false;
@override
Widget build(BuildContext context) {
return Column(
children: [
CircleAvatar(
radius: radius,
foregroundImage:
toggleForegroundImage ? NetworkImage(photoURL) : null,
),
TextButton(
onPressed: () {
setState(() {
radius = radius == 20 ? 40 : 20;
});
},
child: Text('toggle Radius'),
),
TextButton(
onPressed: () {
setState(() {
toggleForegroundImage = !toggleForegroundImage;
});
},
child: Text('toggle ForegroundImage'),
),
],
);
}
}- Run the app and click 2 buttons
- Click button
toggle Radius - Then click button
toggle ForegroundImage
Expected results:
it should show the foregroundImage which is my avatar image
Actual results:
Exception has occurred.
"Error: Expected a value of type 'Decoration', but got one of type 'Null'
Details
``` Flutter 2.2.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision 02c026b (13 days ago) • 2021-05-27 12:24:44 -0700 Engine • revision 0fdb562ac8 Tools • Dart 2.13.1 ```jacob-hutchings and ookami-kb
Metadata
Metadata
Assignees
Labels
a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesa: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featuref: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2Found to occur in 2.2frameworkflutter/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