TechnoUrmish / Sizer

A flutter plugin for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.
MIT License
240 stars 73 forks source link

.h is not working in windows #62

Open kwang87 opened 1 year ago

kwang87 commented 1 year ago

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?