flutter_conscent_plugin 0.2.7 copy "flutter_conscent_plugin: ^0.2.7" to clipboard
flutter_conscent_plugin: ^0.2.7 copied to clipboard

This is a step by step guide for managing Conscent Plugin and its related subclasses.

example/main.dart

import 'dart:async';
import 'dart:convert';
import 'dart:io' show Platform;
import 'package:flutter_conscent_plugin/ConscentInitializer.dart';
import 'package:flutter_conscent_plugin/ConscentMethods.dart';
import 'package:flutter_conscent_plugin/Model/APIMode.dart';
import 'package:flutter_conscent_plugin/Model/PaywallViewEvent.dart';
import 'package:flutter_conscent_plugin/Model/content_access_model.dart';
import 'package:flutter_conscent_plugin/Model/embeddedSubscribtion.dart';
import 'package:flutter_conscent_plugin/Model/getUserDetail.dart';
import 'package:flutter_conscent_plugin/Model/loginChallengepost.dart';
import 'package:flutter_conscent_plugin/Model/subscriptionAccess.dart';
import 'package:flutter_conscent_plugin/defaultSubscribtion.dart';
import 'package:flutter_conscent_plugin/passesWebviews.dart';
import 'package:fk_user_agent/fk_user_agent.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_conscent_plugin/webview.dart';
import 'package:flutter_conscent_plugin/webviewConscent.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uuid/uuid.dart';

class MyAppff extends StatelessWidget {
  const MyAppff({super.key});

  @override
  Widget build(BuildContext context) {
    const appTitle = 'Default Mode';

    return MaterialApp(
      title: appTitle,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(appTitle),
          backgroundColor: const Color.fromRGBO(245, 194, 203, 1.0),
        ),
        body: const _MyAppppState(),
      ),
    );
  }
}

class _MyAppppState extends StatefulWidget {
  const _MyAppppState();
  @override
  State<_MyAppppState> createState() => _MyAppppStateState();
}

class _MyAppppStateState extends State<_MyAppppState> {
  bool showContent = false;

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

//API logout post
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: FutureBuilder<ContentAccessModel?>(
            future: ConscentMethods().getContentAccess(),
            builder: (context, snapshot) {
              var responseDttta = snapshot.data;
              print(responseDttta?.signature);
              if (snapshot.hasData) {
                return Center(
                  child: Column(
                    children: [
                      responseDttta?.signature == null
                          ? Padding(
                              padding: const EdgeInsets.all(20.0),
                              child: Text(
                                'Early use Scientists are still debating when people started wearing clothes. Estimates by various experts have ranged from 40,000 to 3 million years ago. Some more recent studies involving the evolution of body lice have implied a more recent development with some indicating a development of around 170,000 years ago and others indicating as little as 40,000. No single estimate is widely accepted.[1][2][3][4] Ralf Kittler, Manfred Kayser and Mark Stoneking, anthropologists at the Max Planck Institute for Evolutionary Anthropology, conducted a genetic analysis of human body lice that suggests clothing originated around 170,000 years ago. Body lice are an indicator of clothes-wearing, since most humans have sparse body hair, and lice thus require human clothing to survive. Their research suggests that the invention of clothing may have coincided with the northward migration of modern Homo sapiens away from the warm climate of Africa, thought to have begun between 50,000 and 100,000 years ago. However, a second group of researchers using similar genetic methods estimate that clothing originated around 540,000 years ago.[5]...',
                                maxLines: showContent ? null : 4,
                              ),
                            )
                          : const SizedBox.shrink(),
                      showContent
                          ? Container()
                          : Expanded(
                              flex: 2,
                              // child: MyApppp((response)
                              child: responseDttta?.signature != null
                                  ? const Center(
                                      child: Text(
                                          'Early use Scientists are still debating when people started wearing clothes. Estimates by various experts have ranged from 40,000 to 3 million years ago. Some more recent studies involving the evolution of body lice have implied a more recent development with some indicating a development of around 170,000 years ago and others indicating as little as 40,000. No single estimate is widely accepted.[1][2][3][4] Ralf Kittler, Manfred Kayser and Mark Stoneking, anthropologists at the Max Planck Institute for Evolutionary Anthropology, conducted a genetic analysis of human body lice that suggests clothing originated around 170,000 years ago. Body lice are an indicator of clothes-wearing, since most humans have sparse body hair, and lice thus require human clothing to survive. Their research suggests that the invention of clothing may have coincided with the northward migration of modern Homo sapiens away from the warm climate of Africa, thought to have begun between 50,000 and 100,000 years ago. However, a second group of researchers using similar genetic methods estimate that clothing originated around 540,000 years ago.[5]...'),
                                    )
                                  : DefaultSub((response) {
                                      if (responseDttta != null &&
                                          responseDttta.signature != null) {
                                        showContent = true;
                                      } else {
                                        showContent = false;
                                      }
                                      print(showContent);
                                      setState(() {});

                                      (context as Element).reassemble();
                                    })),
                    ],
                  ),
                );
              } else if (snapshot.hasError) {
                return const Text('error');
              } else {
                return const SizedBox.shrink();
              }
            }),
      ),
    );
  }
}
1
likes
0
pub points
56%
popularity

Publisher

unverified uploader

This is a step by step guide for managing Conscent Plugin and its related subclasses.

Homepage

License

unknown (LICENSE)

Dependencies

device_info, fk_user_agent, flutter, flutter_web_plugins, get, http, intl, liquid_pull_to_refresh, pull_to_refresh, shared_preferences, shared_preferences_web, uuid, webview_flutter

More

Packages that depend on flutter_conscent_plugin