You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the plugins for an app but it has two languages and I use the context property to be able to translate the string of the title and the body of the pageModel however I have an error because I don't have a context for that ... how could I create a widget that allow to use buildcontext and in this way use languages?
my code:
final pageList = [
PageModel(
color: dBlueSkyColor,
heroAssetPath: 'assets/images/delivery1.png',
title: Text('SAVE MONEY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: dOrangeColor,
fontSize: 30.0,
)),
body: Text(
'Weekly best deals picked by our price comparison team',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: dOrangeColor,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/postal.png',
),
PageModel(
color: const Color(0xFF65B0B4),
heroAssetPath: 'assets/images/delivery2.png',
title: Text('SAVE TIME',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body: Text(
'Shop from over 1200 local stores at your fingertips',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/business.png',
),
PageModel(
color: const Color(0xFF9B90BC),
heroAssetPath: 'assets/images/delivery3.png',
title: Text('HOME DELIVERY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body:
Text("You get everything you'd want from your local store to your door",
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
)),
iconAssetPath: 'assets/icons/over.png',
),
];
instead of using plain text use
S.of(context).simpleText
with error in context
The text was updated successfully, but these errors were encountered:
I am using the plugins for an app but it has two languages and I use the context property to be able to translate the string of the title and the body of the pageModel however I have an error because I don't have a context for that ... how could I create a widget that allow to use buildcontext and in this way use languages?
my code:
final pageList = [
PageModel(
color: dBlueSkyColor,
heroAssetPath: 'assets/images/delivery1.png',
title: Text('SAVE MONEY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: dOrangeColor,
fontSize: 30.0,
)),
body: Text(
'Weekly best deals picked by our price comparison team',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: dOrangeColor,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/postal.png',
),
PageModel(
color: const Color(0xFF65B0B4),
heroAssetPath: 'assets/images/delivery2.png',
title: Text('SAVE TIME',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body: Text(
'Shop from over 1200 local stores at your fingertips',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/business.png',
),
PageModel(
color: const Color(0xFF9B90BC),
heroAssetPath: 'assets/images/delivery3.png',
title: Text('HOME DELIVERY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body:
Text("You get everything you'd want from your local store to your door",
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
)),
iconAssetPath: 'assets/icons/over.png',
),
];
instead of using plain text use
S.of(context).simpleText
with error in context
The text was updated successfully, but these errors were encountered: