flutter_launch_store 1.0.6 copy "flutter_launch_store: ^1.0.6" to clipboard
flutter_launch_store: ^1.0.6 copied to clipboard

A Flutter plugin for launching a Store in the mobile platform. Supports AppStore, PlayStore and AppGallery.

example/lib/main.dart

import 'dart:async';

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final myController = TextEditingController();

  @override
  void dispose() {
    myController.dispose();
    super.dispose();
  }

  Future<void> openWithStore() async {
    var appId = myController.text;
    print('app id: $appId');
    try {
      StoreLauncher.openWithStore(appId).catchError((e) {
        print('ERROR> $e');
      });
    } catch (e) {
      print(e.toString());
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin flutter_launch_store example app'),
        ),
        body: Container(
          padding: const EdgeInsets.all(12.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              TextField(
                controller: myController,
                decoration: const InputDecoration(
                  hintText: 'Please enter Package Name',
                  border: OutlineInputBorder(borderSide: BorderSide(color: Colors.teal)),
                ),
              ),
              ElevatedButton(
                onPressed: openWithStore,
                child: const Text('Open With Store'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
130
pub points
83%
popularity

Publisher

verified publishertramontana.co.hu

A Flutter plugin for launching a Store in the mobile platform. Supports AppStore, PlayStore and AppGallery.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_launch_store