windows_store 1.0.0 copy "windows_store: ^1.0.0" to clipboard
windows_store: ^1.0.0 copied to clipboard

PlatformWindows

A flutter plugin for retrieving license information from Microsoft Store apps.

example/lib/main.dart

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

import 'package:windows_store/windows_store.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _windowsStorePlugin = WindowsStoreApi();
  StoreAppLicense? license;

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    final result = await _windowsStorePlugin.getAppLicenseAsync();
    setState(() {
      license = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              Text('isActive = ${license?.isActive}'),
              Text('isTrial = ${license?.isActive}'),
              Text('skuStoreId = ${license?.skuStoreId}'),
              Text('trialUniqueId = ${license?.trialUniqueId}'),
              Text('trialTimeRemaining = ${license?.trialTimeRemaining}'),
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
150
points
188
downloads

Publisher

verified publishersongbook-pro.com

Weekly Downloads

A flutter plugin for retrieving license information from Microsoft Store apps.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on windows_store

Packages that implement windows_store