Exception

The following assertion was thrown during performLayout(): 'package:flutter/src/rendering/box.dart': Failed assertion: line 319 pos 12: 'width > 0.0': is not true. Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.md The relevant error-causing widget was: FittedBox FittedBox:file:///C:/Users/Test/StudioProjects/kidmath/lib/test_page.dart:176:12

Solution

Wrapping your FittedBox widget with SizedBox widget will solve your problem. You can also specify the width and height of the SizedBox widget.