Skip to content

Commit 2ca2ed2

Browse files
authored
Merge pull request #66 from mobiplus-opensource/feature/get_packagename_dynamically
catching package name dinamically
2 parents b9e30a0 + 16684d1 commit 2ca2ed2

File tree

2 files changed

+7
-66
lines changed

2 files changed

+7
-66
lines changed

lib/block.screen.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ignore_for_file: prefer_const_constructors
22

33
import 'package:flutter/material.dart';
4+
import 'package:package_info_plus/package_info_plus.dart';
45
import 'package:store_redirect/store_redirect.dart';
56

67
class BlockScreen extends StatefulWidget {
@@ -52,9 +53,7 @@ class BlockScreenStates extends State<BlockScreen> {
5253
),
5354
alignment: Alignment(0.0, 0.0),
5455
),
55-
Container(
56-
child: widget.image
57-
),
56+
Container(child: widget.image),
5857
Container(
5958
margin: EdgeInsets.only(left: 30, right: 30),
6059
child: Text(
@@ -74,13 +73,13 @@ class BlockScreenStates extends State<BlockScreen> {
7473
Padding(
7574
padding: const EdgeInsets.all(15.0),
7675
child: ElevatedButtonTheme(
77-
data: ElevatedButtonThemeData(
78-
style: widget.buttonStyle),
76+
data: ElevatedButtonThemeData(style: widget.buttonStyle),
7977
child: ElevatedButton(
80-
onPressed: () {
78+
onPressed: () async {
79+
final PackageInfo _info = await PackageInfo.fromPlatform();
8180
StoreRedirect.redirect(
82-
androidAppId: "com.android.chrome",
83-
iOSAppId: "535886823");
81+
androidAppId: _info.packageName,
82+
iOSAppId: _info.packageName);
8483
},
8584
child: Text(widget.buttonText),
8685
),

sample/lib/screens/version_blocker/version.blocker.functions.dart

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)