GithubHelp home page GithubHelp logo

akshaynjarangal / appstore_info Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 55 KB

Present app store with corresponding app details inside the flutter app

Home Page: https://pub.dev/packages/appstore_info

License: MIT License

Dart 57.43% Ruby 17.32% Swift 24.98% Objective-C 0.27%

appstore_info's Introduction

appstore_info

A Flutter plugin for retrieving information about apps on the App Store with in the app.

Features

  • Retrieve app information such as name, description, developer, version, and more.
  • Check for app updates by comparing the version on the App Store with the installed version.
  • View app details directly from the App Store using SKStoreProductViewController.

Installation

Add appstore_info to your pubspec.yaml file:

dependencies:
  appstore_info: ^1.1.0

Caution: This code will only execute on a real iOS device. It will not work on the iOS simulator.

Usage

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

import 'package:flutter/services.dart';
import 'package:appstore_info/appstore_info.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  bool isLoading = false;

  set loadingState(bool value) {
    setState(() {
      isLoading = value;
    });
  }

  final _appstoreInfoPlugin = AppstoreInfo();

  // Function to open the App Store inside the app
  Future<void> openAppStoreInside() async {
    try {
      loadingState = true; // Set the loading state to true
      // Open the App Store with the specified app ID
      // Example: Instagram app ID is 389801252
      // URL: https://apps.apple.com/in/app/instagram/id389801252
      await _appstoreInfoPlugin.presentAppStore(appID: '389801252');
      loadingState = false; // Set the loading state back to false
    } on PlatformException {
      loadingState = false; // Set the loading state back to false in case of an exception
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('App Store Info Example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              if (isLoading)
                const CupertinoActivityIndicator()
              else
                CupertinoButton(
                  color: CupertinoColors.activeBlue,
                  onPressed: openAppStoreInside,
                  child: const Text("Open App Store"),
                ),
            ],
          ),
        ),
      ),
    );
  }
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

appstore_info's People

Contributors

akshaynjarangal avatar

Stargazers

 avatar

Watchers

 avatar

appstore_info's Issues

HBO Max App - AppStore Modal not showing

Hey again,

I noticed that on appID 1666653815 (HBO Max) the AppStore Modal wont be displayed instead it throws an error in the plugin.

Any idea what the reason could be?

UI Flicker when closing Store Modal Popup

Hey,

I do notice some flickering when I use the "done" button on the presented appstore modal.
It also happens, when I tap outside. Seems like it momentarily switches to full-screen and then back to the correct size and animates the close-animation...

Any idea how to fix this?

EDIT:
I've tried this on iPad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.