SpWMLLayoutManager class

(en)A manager class for managing SpWML layout files with a singleton. This manager class suppressing unnecessary resource downloads. This class can also determine screen orientation and device type.

(ja)SpWMLのレイアウトファイルをシングルトンで管理し、不必要なリソースのダウンロードを抑えるためのマネージャークラスです。 画面の向きやデバイスの種類の判定も行えます。

Constructors

SpWMLLayoutManager()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
(en)Clear this class and empty the layout file it maintains.
getAssets(String path, void setStateCallback(), void errorCallback(dynamic error)) String?
(en)Asynchronously retrieves the layout present at the given path and calls back when complete. If you specify an asset that has already been acquired, the contents will be returned as is and no callback will occur. If you specify an asset that has not yet been acquired, null will be returned, and resource acquisition will start after the current rendering is complete. Asset registration in pubspec.yaml is mandatory.
getLayout(String key) String?
(en)Gets the layouts registered with this class. Null is returned if an unregistered key is specified.
getMultiAssets(List<String> paths, void setStateCallback(), void errorCallback(dynamic error)) List<String>?
The multi-simultaneous version of getAssets. Asset registration in pubspec.yaml is mandatory.
getMultiResource(List<String> urls, Future<List<String>> getDataFunction(List<String> urls), void setStateCallback(), void errorCallback(dynamic error)) List<String>?
The multi-simultaneous version of getResource.
getResource(String url, Future<String> getDataFunction(String url), void setStateCallback(), void errorCallback(dynamic error)) String?
(en)Register with this class and call back when the resource acquisition is complete. If you specify a URL that has already been acquired, the content will be returned as is and no callback will occur. If you specify a URL that has not yet been acquired, null will be returned, and resource acquisition will start after the current rendering is completed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeLayout(String key) → void
(en)Removes a layout registered with this class. Nothing happens if you specify an unregistered key.
setLayout(String key, String layout) → void
(en)Register your layouts directly in this class.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getOrientation(BuildContext context) EnumOrientation
(en) Returns the current device orientation.
getScreenHeight(BuildContext context) double
(en) Gets the current screen height. However, it does not include the status bar or notch height.
getScreenWidth(BuildContext context) double
(en) Gets the current screen width.
getWindowClass(BuildContext context) EnumWindowClass
(en) Returns the window class. Classes are determined by width.
isHorizontal(BuildContext context) bool
(en) Returns True if the current device is in landscape orientation.
isVertical(BuildContext context) bool
(en) Returns True if the current device is in portrait orientation.