I have this
I want to pass this data
var pack = package.data;
And use it here
// Image.asset("assets/images/vip_1.png"),
Image.asset("....passed data....."),
I tried
Image.asset(pack.img),
but am getting null response.
Please help
CodePudding user response:
-You need to make sure that your future function readTicket()
returns a value and not null.
-Also wait until returning its value.
-hope I could help
CodePudding user response:
You can do like this :
lib/assets/ -> add your images here
then utils.dart file :
var image1 = 'lib/assets/file_name.jpg';
now on your mainFile :
import your utils.dart file then
Image.asset(image1),