The occasion member ‘context’ cannot be accessed in an initializer


I am, making an attempt to make Slider Display screen, however it reveals me a purple line in context. I am utilizing SDK 2.7.0, I do not know if I want to alter the slider. Might you please assist me? title: getTranslated(context, ‘wel_title1’), Pink line: (context).

class IntroSliderScreen extends StatefulWidget {
  @override
  _GettingStartedScreenState createState() => _GettingStartedScreenState();
}

class _GettingStartedScreenState extends State<IntroSliderScreen>
    with TickerProviderStateMixin {
  PageController pageController = PageController();

  double rely = 0.00;

  Checklist<Slide> slideList = [
    Slide(
      imageUrl: 'assets/images/uptodate_intro.png',
      title: getTranslated(context, 'wel_title1'),
      description: getTranslated(context, 'wel_des1'),
    ),
    Slide(
      imageUrl: 'assets/images/bookmark_share.png',
      title: getTranslated(context, 'wel_title2'),
      description: getTranslated(context, 'wel_des2'),
    ),
    Slide(
      imageUrl: 'assets/images/new_categories.png',
      title: getTranslated(context, 'wel_title3'),
      description: getTranslated(context, 'wel_des3'),
    ),
  ];

  @override
  void initState() {
    tremendous.initState();
    onPageChanged(0);
  }

Leave a Reply