Is there a way to get device resolution as "$height*$width"? Any packages or just plain Flutter?
I want the device resolution: computer or phone resolution. NOT the browser or app resolution.
Thanks.
Is there a way to get device resolution as "$height*$width"? Any packages or just plain Flutter?
I want the device resolution: computer or phone resolution. NOT the browser or app resolution.
Thanks.
Share Improve this question asked Feb 5 at 15:18 Rami DhouibRami Dhouib 351 silver badge6 bronze badges 1- 1 This question is similar to: How to Determine Screen Height and Width. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. – sori Commented Feb 8 at 20:38
1 Answer
Reset to default 0dart:ui
package has two properties that can handle what you need.
import 'dart:ui';
PlatformDispatcher.instance.views.first.physicalSize.height
PlatformDispatcher.instance.views.first.physicalSize.width
good luck!