stipop_sdk 0.1.0 copy "stipop_sdk: ^0.1.0" to clipboard
stipop_sdk: ^0.1.0 copied to clipboard

outdated

Flutter Plugin for Stipop SDK

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:stipop_sdk/stipop_plugin.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> {
  late Stipop stipop;
  String callbackMsg = '';
  String? stickerImg = null;

  @override
  void initState() {
    super.initState();
    stipop = Stipop(
      onStickerPackSelected: (spPackage) {
        setState(() {
          callbackMsg = 'canDownlaod\n${spPackage.toJson()}';
          stickerImg = null;
        });
      },
      onStickerSelected: (sticker) {
        setState(() {
          callbackMsg = 'onStickerSelected\n${sticker.toJson()}';
          stickerImg = sticker.stickerImg;
        });
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Padding(
            padding: const EdgeInsets.all(8.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                const TextField(
                  decoration: InputDecoration(
                    hintText: 'Stipop_Sample',
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: TextButton(
                    onPressed: () {
                      stipop.showKeyboard();
                    },
                    child: const Text('Show Keyboard'),
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: TextButton(
                    onPressed: () {
                      stipop.showSearch();
                    },
                    child: const Text('Show Search'),
                  ),
                ),
                if (stickerImg != null)
                  Image.network(
                    stickerImg!,
                    width: 100,
                    height: 100,
                  ),
                Expanded(
                  child: Text('Stipop Callback\n$callbackMsg'),
                ),
              ],
            ),
          )),
    );
  }
}
10
likes
0
pub points
21%
popularity

Publisher

unverified uploader

Flutter Plugin for Stipop SDK

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, json_annotation, json_serializable

More

Packages that depend on stipop_sdk