AppLanguage class
<p>AppLanguage view model class interact with modal in the context of the App Language. The class provides methods that set's the language, change the language in the modal.</p> <p>Methods include:</p> <ul> <li><code>fetchLocale</code></li> <li><code>changeLanguage</code></li> <li><code>selectLanguagePress</code></li> <li><code>dbLanguageUpdate</code></li> <li><code>appLanguageQuery</code></li> <li><code>userLanguageQuery</code></li> </ul>
Inheritance
- Object
- ChangeNotifier
- BaseModel
- AppLanguage
Constructors
AppLanguage ({bool isTest = false})
Properties
appLocal → Locale
<span class="feature">read-only</span>
databaseFunctions → DataBaseMutationFunctions
<span class="feature">final</span>
hashCode → int
The hash code for this object.
<span class="feature">read-only</span><span class="feature">inherited</span>
hasListeners → bool
Whether any listeners are currently registered.
<span class="feature">read-only</span><span class="feature">inherited</span>
isBusy → bool
<span class="feature">read-only</span><span class="feature">inherited</span>
isTest → bool
<span class="feature">final</span>
navigationService → NavigationService
<span class="feature">final</span>
runtimeType → Type
A representation of the runtime type of the object.
<span class="feature">read-only</span><span class="feature">inherited</span>
state → ViewState
<span class="feature">read-only</span><span class="feature">inherited</span>
Methods
addListener(VoidCallback listener) void
Register a closure to be called when the object changes.
<span class="feature">inherited</span>
appLanguageQuery() Future<void>
This function perform graphQL query to check the app language. The function uses <code>gqlAuthQuery</code> method provided by Database Functions Services.
changeLanguage(Locale type) Future<void>
This function change the app default language.
dbLanguageUpdate() Future<void>
This function updates the Database Language by running the graphQL <code>mutations</code>.
dispose() void
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
<a href="https:api.flutter.dev/flutter/foundation/ChangeNotifier/addListener.html">addListener</a> will throw after the object is disposed).
<span class="feature">inherited</span>
fetchLocale() Future<void>
This function fetch the language of the user's app.
initialize() Future<void>
noSuchMethod(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
<span class="feature">inherited</span>
notifyListeners() void
Call all the registered listeners.
<span class="feature">inherited</span>
removeListener(VoidCallback listener) void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
<span class="feature">inherited</span>
selectLanguagePress() Future<void>
This function navigate user to <code>/appSettingsPage</code> route if the user is authenticated else navigate to <code>/setUrl</code> route.
setState(ViewState viewState) void
<span class="feature">inherited</span>
toString() String
A string representation of this object.
<span class="feature">inherited</span>
userLanguageQuery(String userId) Future<void>
This function perform graphQL query to check the user's language in the database. The function uses <code>gqlAuthQuery</code> method provided by Database Functions Services.
Operators
operator ==(Object other) bool
The equality operator.
<span class="feature">inherited</span>