Coder Social home page Coder Social logo

ueman / application_icon Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 5.0 203 KB

A simple Flutter widget which shows your application icon

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

License: Other

Kotlin 22.71% Ruby 10.59% Swift 7.80% Objective-C 3.34% Dart 55.56%
flutter widget application-icon flutter-ui hacktoberfest

application_icon's Introduction

Application Icon

pub package likes popularity pub points GitHub Workflow Status

Platform support

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.

Setup

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.

Example

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.

📣 About the author

  • Twitter Follow
  • GitHub followers

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.