In this article, we will see How to change the launcher app icon in Flutter. Let's start it.
- For creating the Launcher icon use Android Asset Studio for editing.
- Tap Launcher icon generator.
- Some default icons will be there if you want you can use them.
- By using the Image tap you can insert an image. Text tap is used to insert a text.
- Use the Padding option to reduce and increase its size.
- Tap download to save the launcher icon then it will save in Zip format.
- Open Zip file > res.
- Select the mipmap files and copy them.
- And then save it in another folder then again select the mipmap and Cut it.
- Now move to your program and then.
- Tap Android > app > src > main > res > paste the mipmap files.
- Open androidmainfest.xml file.
- Set your app name in android:label.
- In android:icon enter your filename which you saved in Android Asset Studio
Create Share Button in Flutter
Flutter plugin to Sharing Text, Link, content, etc from Flutter App through the platform's share dialog. To Add ACTION_SEND for Android and UIActivityViewController for iOS.
Install the package
After creating a new flutter document move to pubspec.yaml file
Find Dependencies and then add the package name.
Dependencies:
share : ^0.5.3
Note: you should add under cupertino_icons: ^0.1.2
Tap Package gets at right corner.
Note: It is only available for Android.
Import the Package
Import the package under the basic package
import 'package:share/share.dart';
How to Add a Text Field
new TextField(
decoration: const InputDecoration(
labelText: 'Share:',
hintText: 'Enter your Text',
),
maxLines: 2,
onChanged: (String value) => setState(() {
text = value;
}),
),
How to Set the Share Page
const Padding(padding: EdgeInsets.only(top: 24.0)),
new Builder(
builder: (BuildContext context) {
return new RaisedButton(
child: const Text('Share'),
onPressed: text.isEmpty
? null
: () {
final RenderBox box = context.findRenderObject();
Share.share(text,
sharePositionOrigin:
box.localToGlobal(Offset.zero) &
box.size);
},
);
},
),
Note: If you get the “timeout waiting for the application to start error in flutter move to pubspec.yaml> Packages upgrade.
Add Play Store Review option in Flutter
Developing an app is a somewhat costly process and also needs huge skills, time, and effort to attain a good and complete mobile app. Launch review is actually used to rate the app how do you feel about it.
Install the package
After creating a new flutter document move to pubspec.yaml file
Find Dependencies and then add the package name.
Note: you should add under cupertino_icons: ^0.1.2
Dependencies:
Launch_review: ^1.0.1
Tap Package get at right corner.
Import the package
Import the package under basic package
import ‘package:launch_review/launch_review.dart’;
Id’s for opening app store page
- AndroidAppId: “com.iyaffle.rangoli”
- iOSAppId: “585027354”
Create initstate
class _MyAppState extends State<MyApp> {
@override
initState() {
super.initState();
Launch Review
For button
body: new Center(
child: new RaisedButton(
child: new Text("Rate App"),
onPressed: () {
LaunchReview.launch(
androidAppId: "com.iyaffle.rangoli",
iOSAppId: "585027354");
}
), //Center
), //RaisedButton
For icon
body: new Center(
child: new IconButton(
icon: Icon(Icons.rate_review, size: 60.0),
onPressed: () {
LaunchReview.launch(
androidAppId: "com.iyaffle.rangoli",
iOSAppId: "585027354");
}
), //Center
),//IconButton