Null pointer exception in Showcase widget

252 Views Asked by At

I have used showcaseview: ^1.1.1

Gives this error. :


  Null check operator used on a null value
 I/flutter (14014): #0      _OverlayBuilderState.addToOverlay
 package:showcaseview/src/layout_overlays.dart:163
 I/flutter (14014): #1      _OverlayBuilderState.showOverlay
 package:showcaseview/src/layout_overlays.dart:155
 I/flutter (14014): #2      _OverlayBuilderState.initState.<anonymous closure>
 package:showcaseview/src/layout_overlays.dart:120
 I/flutter (14014): #3      SchedulerBinding._invokeFrameCallback
 package:flutter/…/scheduler/binding.dart:1144
 I/flutter (14014): #4      SchedulerBinding.handleDrawFrame
 package:flutter/…/scheduler/binding.dart:1090
 I/flutter (14014): #5      SchedulerBinding._handleDrawFrame
 package:flutter/…/scheduler/binding.dart:998
 I/flutter (14014): #6      _rootRun (dart:async/zone.dart:1354:13)
 I/flutter (14014): #7      _CustomZone.run (dart:async/zone.dart:1258:19)
 I/flutter (14014): #8      _CustomZone.runGuarded (dart:async/zone.dart:1162:7)

I have Passed the ShowCaseWidget like this

    ShowCaseWidget(builder:Builder((context) => MaterialApp.router(...),
      ),
   );

And then in the Page I want to show the showcase,

 @override
void initState() {
super.initState();

WidgetsBinding.instance!.addPostFrameCallback(
    (_) => ShowCaseWidget.of(context)!.startShowCase([_one]));

}

And in the widget tree

Showcase(
            key: _one,
            description: "This is test descriptiton",
            child: IconButton(
              icon: Image.asset('assets/images/invite.png'),
              onPressed: () {
                // getIt<IAnalyticsService>().logCreateNavigateClick();
                // showModalBottomSheet(
                //   context: context,
                //   builder: (context) => const CreateSheet(),
                // );
                AutoRouter.of(context).push(SelectTopicRoute());
              },
            ),
          ),
0

There are 0 best solutions below