Pulse FlightRecorder Docs
  • SDK Documentation
    • Pulse Labs FlightRecorder Documentation
      • iOS
        • Overview
        • Install the SDK
        • Get your API Key
        • SDK Configuration
          • Swift + SwiftUI
          • Swift + UIKit with Scenes
          • Swift + UIKit without Scenes
          • Objective-C with Scenes
          • Objective-C without Scenes
        • Create Custom Triggers
          • Capture Recording
          • Show the Introduction Screen
        • Update the SDK
        • Troubleshooting
      • Android
        • Overview
        • Install the SDK
        • Get your API Key
        • SDK Configuration
          • Kotlin
          • Java
        • Create Custom Triggers
          • Capture Recording
          • Show the Introduction Screen
        • Update the SDK
        • Troubleshooting
      • ReactNative
        • Install SDK for ReactNative iOS
        • Install SDK for ReactNative Android
        • Update the SDK
      • Flutter
        • Overview
        • Install the SDK
        • Get your API Key
        • SDK Configuration
        • Create Custom Triggers
          • Capture Recording
          • Show the Introduction Screen
      • In-app Surveys
        • Create Survey
        • Edit Survey
        • Launch Survey
        • Pause Survey
        • Survey Responses
        • Survey Styling
    • ⬅️FlightRecorder Home
Powered by GitBook
On this page
  1. SDK Documentation
  2. Pulse Labs FlightRecorder Documentation
  3. Flutter
  4. Create Custom Triggers

Show the Introduction Screen

The SDK displays the introduction screen during the very first app launch, considering this the trigger. This feature enables you to add extra triggers and also allows you to disable the default app launch trigger.

For instance, you may choose to present the introduction screen at the end of your onboarding screens or provide an option to show it again from a help menu.

Select a Trigger and Show the Introduction Screen

  1. Decide from what event you want to capture the video, for example a button press. We will call this the trigger. This very simple example shows a possible trigger - when a floating action button is pressed

    class HomeScreen extends StatelessWidget {
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          floatingActionButton: Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              FloatingActionButton(
                heroTag: const Key('1'),
                onPressed: () {
                  
                },
                child: const Icon(Icons.upload_file),
              )
            ],
          ),
          body: PlaceHolder(),
        );
      }
    }
  2. Update the widget to add a reference to Flight Recorder:

    Kotlin
    class HomeScreen extends StatelessWidget {
      final FlightRecorder flightRecorderPlugin;
      const HomeScreen({super.key, required this.flightRecorderPlugin});
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          floatingActionButton: Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              FloatingActionButton(
                heroTag: const Key('1'),
                onPressed: () {
                  
                },
                child: const Icon(Icons.upload_file),
              )
            ],
          ),
          body: PlaceHolder(),
        );
      }
    }

  3. Call showIntroductionScreen at the moment you want to capture the video inside the trigger.

    flightRecorderPlugin.showIntroductionScreen()

    In our example, we call the method from the FloatingActionButton onPressed function:

    class HomeScreen extends StatelessWidget {
      final FlightRecorder flightRecorderPlugin;
      const HomeScreen({super.key, required this.flightRecorderPlugin});
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          floatingActionButton: Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              FloatingActionButton(
                heroTag: const Key('1'),
                onPressed: () {
                  flightRecorderPlugin.showIntroductionScreen();
                },
                child: const Icon(Icons.upload_file),
              )
            ],
          ),
          body: PlaceHolder(),
        );
      }
    }

PreviousCapture RecordingNextIn-app Surveys

Last updated 1 year ago