gleap_sdk 6.0.2 copy "gleap_sdk: ^6.0.2" to clipboard
gleap_sdk: ^6.0.2 copied to clipboard

outdated

The Gleap SDK for Flutter is the easiest way to integrate Gleap into your apps!

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:gleap_sdk/gleap_sdk.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    await Gleap.initialize(
      token: 'YOUR_API_KEY',
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Gleap Example'),
          backgroundColor: const Color(0xFF485BFF),
        ),
        body: Center(
          child: GestureDetector(
            onTap: () async {
              await Gleap.startFeedbackFlow();
            },
            child: Container(
              alignment: Alignment.center,
              height: 50,
              width: 150,
              color: const Color(0xFF485BFF),
              child: const Text(
                'Report Bug',
                style: TextStyle(
                  color: Colors.white,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
14
likes
0
pub points
91%
popularity

Publisher

verified publishergleap.io

The Gleap SDK for Flutter is the easiest way to integrate Gleap into your apps!

Homepage

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, js

More

Packages that depend on gleap_sdk