dialog_pp_flutter 0.0.8 copy "dialog_pp_flutter: ^0.0.8" to clipboard
dialog_pp_flutter: ^0.0.8 copied to clipboard

outdated

Perosnal Use

example/lib/main.dart

import 'dart:async';

import 'package:dialog_pp_flutter/api_call.dart';
import 'package:dialog_pp_flutter/dialog_pp_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';

Future<void> main() async {
  await PPDialog.newVersionCode();
  await advertisementDrawerApi("https://gitlab.com/vs.bitcoding/live_apps/-/raw/main/live_apps.json");
  runApp(ScreenUtilInit(
      builder: (context, child) => const GetMaterialApp(
            home: MYYYYY(),
          )));
}

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

  @override
  State<MYYYYY> createState() => _MYYYYYState();
}

class _MYYYYYState extends State<MYYYYY> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    Future.delayed(const Duration(seconds: 3), () {
      Get.to(const MyApp());
    });
  }



  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
    );
  }
}

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();
    Future.delayed(const Duration(seconds: 0),(){
      checkVersion();
    });


  }

  checkVersion() async {
    PPDialog.updateDialog(
      context,
      isPopupRequired: true,
      isPopup: true,
      apiVersionCode: 3,
      appLogoApi:
      "https://play-lh.googleusercontent.com/c2DcVsBUhJb3UlAGABHwafpuhstHwORpVwWZ0RvWY7NPrgdtT2o4JRhcyO49ehhUNRca=w240-h480-rw",
      appNameApi: "Instagram",
      subtitleAppApi:
      "Share videos, photos, and fun moments with the friends you love",
      appWebsiteUrl:
      "https://play.google.com/store/apps/details?id=com.instagram.android",
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      drawer: PPDialog.drawerScreen(
          appLogo: "assets/dialogs_assets/playstore.png",
          privacyPolicy:
              "https://sites.google.com/view/bitlinksprivacypolicy/home",
          feedbackEmailId: "mailto:bitlinks.llc@gmail.com",
          emailSubject: "Feedback on Pakistan IPTV Links m3u Playlists",
          emailMessage:
              "Hi,\n\n\nYour Feedback Pakistan IPTV Links m3u Playlists! I would like to give you some feedback:"),
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Center(
        child: InkWell(onTap: () {}, child: const Text('sdsfdsf')),
      ),
    );
  }
}