but it make exception error.
error message:
BoxConstraints forces an infinite height.
These invalid constraints were provided to RenderDecoratedBox's layout() function by the following function, which probably computed the invalid constraints in question:
RenderBox.layout (package:flutter/src/rendering/box.dart:2522:11)
The offending constraints were:
BoxConstraints(w=198.0, h=Infinity)
I can't understand infinity height size..
If fix my code "height: 20.h" to "height: 20"
it fine work.
how can i solve it?
i have simple code: Widget build(BuildContext context, WidgetRef ref) { return Sizer( builder: (context, orientation, deviceType) => Container( // margin: EdgeInsets.all(2.w), width: 60.w, height: 20.h, decoration: const BoxDecoration( color: Colors.blue, borderRadius: BorderRadius.all( Radius.circular(8), ), ), ), ); }
but it make exception error. error message: BoxConstraints forces an infinite height. These invalid constraints were provided to RenderDecoratedBox's layout() function by the following function, which probably computed the invalid constraints in question: RenderBox.layout (package:flutter/src/rendering/box.dart:2522:11) The offending constraints were: BoxConstraints(w=198.0, h=Infinity)
I can't understand infinity height size..
If fix my code "height: 20.h" to "height: 20" it fine work. how can i solve it?