flutter_push_devonics 1.0.5 copy "flutter_push_devonics: ^1.0.5" to clipboard
flutter_push_devonics: ^1.0.5 copied to clipboard

PlatformAndroid

Push Devonics Flutter Plugin

example/lib/main.dart

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

import 'package:flutter_push_devonics/flutter_push_devonics.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> {
  String _userID = 'Empty';

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {

    FlutterPushDevonics.init("APP_ID");
    FlutterPushDevonics.sendTag("TEST", "VALUE TEST");
    String userID = await FlutterPushDevonics.getUserID ?? 'Empty User ID';

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _userID = userID;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('PUSH DEVONICS'),
        ),
        body: Center(
          child: Text('PUSH USER ID: $_userID\n'),
        ),
      ),
    );
  }
}
1
likes
100
pub points
0%
popularity

Publisher

unverified uploader

Push Devonics Flutter Plugin

Homepage

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_push_devonics