Pakete, Repositories und App-Kategorien suchen

Paketdetailsv0.0.1

live_icon

Ein Flutter-Plugin, um App-Icons und -Bezeichnungen in Echtzeit zu ändern.

AndroidiOS
30-Tage-Downloads
8
Likes
37
Pub-Punkte
150

Paket installieren

flutter pub add live_icon

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Live Icon ist ein Flutter-Plugin, das Echtzeitänderungen an einem App-Icon und -Label auf dem Startbildschirm des Geräts ermöglicht. Es erlaubt Entwicklern die dynamische Aktualisierung der visuellen Identität der App während der Laufzeit, was nützlich für Themen, Markenaktualisierungen oder interaktive Benutzererfahrungen ist. Das Plugin unterstützt sowohl Android als auch iOS und bietet eine nahtlose Integration mit Flutter-Anwendungen. Es nutzt native Plattformfunktionen, um das App-Icon ohne Neustart zu aktualisieren. Ideal für Apps, die basierend auf Benutzerpräferenzen oder App-Zuständen personalisierte oder kontextbezogene Icons bieten möchten.

Anwendungsfälle

  • Dynamische App-Branding
  • Thema-App-Symbole
  • Iconenänderungen basierend auf Benutzereinstellungen
  • Interaktive App-Erlebnisse
  • Echtzeit-Icon-Updates

Hauptmerkmale

  • Echtzeit-Icon- und Bezeichnungsaktualisierungen
  • Unterstützung für Android und iOS
  • Kein Neustart der App erforderlich
  • Einfache API-Integration
  • Native Plattformkompatibilität

Geeignet für

  • Apps mit dynamischer Branding
  • Themenaktivierte Anwendungen
  • Interaktive Benutzeroberflächen
  • Anpassbare App-Identitäten
  • Entwickler, die eine Anpassung des Startbildschirms suchen

Hinweise

  • Plattformspezifische Einrichtung erforderlich
  • Beschränkt auf unterstützte Geräte
  • Funktioniert möglicherweise nicht auf allen Startprogrammen
  • Auf einigen Android-Versionen können Berechtigungen erforderlich sein
  • Das Verhalten unterscheidet sich zwischen iOS- und Android-Implementierungen

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Live Icon

Live_Icon

GitHub GitHub code size in bytes GitHub top language GitHub language count GitHub tag (latest by date) GitHub issues

GitHub Repo stars GitHub forks

Compatibility

✅   Android
❌   iOS (active issue: iOS support)

Features

All the features listed below can be performed at the runtime.

✅   Change App Icons
✅   Change App Label

Quick Start

Step 1: Include plugin to your project
dependencies:
  live_icon: <latest version>
Step 2: Add activity-alias in AndroidManifest.xml
...
...
<application
    android:label="live_icon_example"
    android:icon="@mipmap/ic_launcher">
    <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
        <meta-data
            android:name="io.flutter.embedding.android.NormalTheme"
            android:resource="@style/NormalTheme"
            />
        <meta-data
            android:name="io.flutter.embedding.android.SplashScreenDrawable"
            android:resource="@drawable/launch_background"
            />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>

    <!-- Live Icon Addition -->
    <activity-alias
        android:name=".DarkTheme"
        android:enabled="false"
        android:icon="@mipmap/dark_theme"
        android:label="DarkThemeLabel"
        android:targetActivity=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity-alias>

    <activity-alias
        android:name=".LightTheme"
        android:enabled="false"
        android:icon="@mipmap/light_theme"
        android:label="LightThemeLabel"
        android:targetActivity=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity-alias>
    <!-- Live Icon Addition -->

    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />

</application>
...
...
Step 3: Create classes

Create java/kotlin files with the same name as provided in activity-alias.

In the above AndroidManifest.xml example, 2 activity-alias are provided, so the number of java/kotlin files will be 2. Example:

1. DarkTheme.java
package com.hackthedeveloper.live_icon_example;

public class DarkTheme {
}
2. LightTheme.java
package com.hackthedeveloper.live_icon_example;

public class LightTheme {
}

One thing to note here is that, we have added two extra activity as activity-alias, and we now have 3 activity in total.

Step 4: Initialise plugin

List all the activity-alias class names. NOTE: MainActivity will also be added here as it containes the launch intent.

LiveIcon.initialize(
    classNames: ['MainActivity', 'DarkTheme', 'LightTheme'],
);
Step 5: Switch App icon

Use switchIconTo to switch app icons. It takes in the className that must match the desired activity-alias android:name.

await liveIcon.switchIconTo(
    className: 'DarkTheme',
);

Project Created & Maintained By

Subham Praharaj

GitHub followers

Divyanshu Shekhar

GitHub followers

Contributions

Contributions are welcomed!

If you feel that a hook is missing, feel free to open a pull-request.

For a custom-hook to be merged, you will need to do the following:

Describe the use-case.

  • Open an issue explaining why we need this hook, how to use it, ... This is important as a hook will not get merged if the hook doens't appeal to a large number of people.

  • If your hook is rejected, don't worry! A rejection doesn't mean that it won't be merged later in the future if more people shows an interest in it. In the mean-time, feel free to publish your hook as a package on https://pub.dev.

  • A hook will not be merged unles fully tested, to avoid breaking it inadvertendly in the future.

Copyright & License

Code and documentation Copyright (c) 2021 Devs On Flutter. Code released under the BSD 3-Clause License.

Kategorien

Quell-Repository

Projekte, die dieses Paket verwenden

Noch keine Daten verfügbar.