LauncherHelper class
LauncherHelper
A class to help reduce work when creating a launcher.
Available methods/getters:
- Use getApplications to get list of apps installed.
- launchApp can launch apps by providing their package name.
- getWallpaper returns device wallpaper as
Uint8List
. - getWallpaperBrightness returns brightness of wallpaper.
- getLuminance calculates approximate luminance/brightness of an image.
- getBrightnessFrom calculates brightness of an image from every pixel.
- wallpaperPalette generated color palettes of wallpaper using PaletteGenerator.
Constructors
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Static Properties
-
getApplications
→ Future<
Applications> -
Returns an Applications object with AppInfo of apps installed on the user's device.
read-only
-
getApps
→ Future<
List> -
Returns a list of apps installed on the user's device
read-only
-
getWallpaper
→ Future<
Uint8List> -
This gets the current wallpaper on the user's device. This method
needs the READ_EXTERNAL_STORAGE permission on Android Oreo & above.
read-only
- wallpaperPalette → Future
-
It generates a palette based current Wallpaper to for use in UI colors. [...]
read-only
Static Methods
-
getBrightnessFrom(
Uint8List imageData, { int skipPixel: 1 }) → Future -
This gets the brightness of any image (image as
Uint8List
). The function returns a brightness level between 0 and 255, where 0 = totally black and 255 = totally bright. [...] -
getLuminance(
{Uint8List imageData, int skip: 1 }) → Future< double> - This asynchronously calculates luminance for an image. [...]
-
getWallpaperBrightness(
{int skipPixel: 1 }) → Future< int> - This gets the brightness of current Wallpaper to determine theme (light or dark). The function returns a brightness level between 0 and 255, where 0 = totally black and 255 = totally bright. [...]
-
launchApp(
String packageName) → Future< bool> - Launches an app using its package name