iaphub_flutter 1.4.0 copy "iaphub_flutter: ^1.4.0" to clipboard
iaphub_flutter: ^1.4.0 copied to clipboard

The easiest way to monetize your iOS and Android Flutter apps by selling in-app purchases. Sell subscriptions and other digital goods using our user-friendly SDK.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'stores/index.dart';
import 'pages/login.dart';
import 'pages/store.dart';

void main() => runApp(const MyApp());

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'IAPHUB Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const HomePage());
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(children: [
      Observer(
          builder: (_) =>
              appStore.isLogged ? const StorePage() : const LoginPage()),
      Observer(builder: (_) {
        if (appStore.alert != null) {
          return AlertDialog(
            title: const Text("Alert"),
            content: Text(appStore.alert ?? ""),
            actions: <Widget>[
              TextButton(
                child: const Text("OK"),
                onPressed: () {
                  appStore.closeAlert();
                },
              ),
            ],
          );
        } else {
          return Container();
        }
      })
    ]));
  }
}
14
likes
150
pub points
40%
popularity

Publisher

verified publisheriaphub.com

The easiest way to monetize your iOS and Android Flutter apps by selling in-app purchases. Sell subscriptions and other digital goods using our user-friendly SDK.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on iaphub_flutter