Platform | Supported | Remarks |
---|---|---|
Android | ✅ | |
iOS | ✅ | |
macOS | ❌ | |
Linux | ❌ | |
Windows | ❌ | |
Web. | ❌ |
This package provides a widget which shows the application icon of your app.
It tries to use the highest resolution icon of your app icon on iOS. On Android, on API levels equal or higher than 26 (Android O) it tries to show the Adaptive Icon if available. Otherwise, it just shows the normal application icon.
If an adaptive icon is available, it can be long pressed and dragged around. It tries to mimic the dragging in the app launcher.
First, you will need to add application_icon
to your pubspec.yaml
:
dependencies:
flutter:
sdk: flutter
application_icon: x.y.z # use the latest version found on pub.dev
Then, run flutter packages get
in your terminal.
import 'package:application_icon/application_icon.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
// use AppIcon to show your application icon
child: AppIconImage(),
),
),
);
}
}
If you are not interested in displaying the app icon, you can also load
the image with the AppIconInfo
class.