It's just a flutter dp util.

  • Usage We assume the design width is 750. And we want get 5 px size.

** Use the global

  1. Initial once
gInit(context);
  1. convert value.
gDp(5);

** Or create a one

var dp = Dp(context);
var size = dp.dp(5);

Libraries

dp