xsoulspace_foundation library
Classes
- AppStoreUtils
- AppStoreUtilsI
- Defines the contract for App Store utility classes.
- DeviceRuntimeType
- A utility class for determining the current device runtime type.
- Disposable
- An abstract class representing objects that can be disposed.
-
FieldContainer<
T> - A container for field values, including error and loading states.
- HeavyComputation
- A marker class indicating that a function contains heavy computation.
- IdCreator
- A utility class for generating unique identifiers.
- Loadable
- An abstract class representing objects that can be loaded asynchronously.
-
LoadableContainer<
T> - A container for loadable state, providing a clean way to represent loading states without null checks.
- LocalDbI
- An interface defining the contract for local database operations.
- PrefsDb
- An implementation of LocalDbI using SharedPreferences for local storage.
- Randomizer
- A utility class for generating random numbers and boolean values.
- SoftKeyboard
- A utility class for controlling the soft keyboard.
- StateDistributor
- A marker class indicating that a class contains state but should not contain any business logic.
- Stateless
- A marker class indicating that a class should not contain any state.
Enums
- InstallPlatformTarget
- Specifies the target store for which the app is built.
- InstallSource
- Represents the source from which the application was installed.
Extensions
- XSBuildContextX on BuildContext
- Extension methods for BuildContext to simplify access to theme data.
-
XSIterableX
on Iterable<
E> - Extension methods for Iterable to provide additional functionality.
-
XSListExtension
on List<
E> - Extension methods for List to provide additional functionality.
- XSStringX on String
- Extension methods for String to provide additional functionality.
- XSWidgetX on Widget
- Extension methods for Widget to provide additional functionality.
Constants
- heavyComputation → const HeavyComputation
- A marker class indicating that a function contains heavy computation.
- stateDistributor → const StateDistributor
- A marker class indicating that a class contains state but should not contain any business logic.
- stateless → const Stateless
- Flags a class which should not contain any state.
Functions
-
closeKeyboard(
{required BuildContext context}) → void - Closes the soft keyboard if it's currently open.
-
dateTimeFromMilisecondsSinceEpoch(
int? millisecondsSinceEpoch) → DateTime? - Converts milliseconds since epoch to a DateTime object.
-
dateTimeNowUtc(
) → DateTime - Provides utility functions for working with DateTime objects.
-
dateTimeToMilisecondsSinceEpoch(
DateTime? dateTime) → int? - Converts a DateTime object to milliseconds since epoch.
-
doubleFromJson(
dynamic value) → double - Converts a dynamic value to a double.
-
doubleNullableFromJson(
dynamic value) → double? - Converts a dynamic value to a nullable double.
-
doubleToJson(
double value) → dynamic - Converts a double to a dynamic value for JSON encoding.
-
extractIntFromString(
String input) → int - Extracts the first integer found in a string.
-
intFromJson(
dynamic value) → int - Converts a dynamic value to an int.
-
intNullableFromJson(
dynamic value) → int? - Converts a dynamic value to a nullable int.
-
intToJson(
int value) → dynamic - Converts an int to a dynamic value for JSON encoding.
-
jsonDecodeList(
String jsonString) → List - Decodes a JSON string into a List<dynamic>, always returning a list.
-
jsonDecodeMap(
String jsonString) → Map< String, dynamic> - Decodes a JSON string into a Map<String, dynamic>, always returning a map.
-
jsonDecodeNullableMap(
String jsonString) → Map< String, dynamic> ? - Decodes a JSON string into a non-empty Map<String, dynamic> or null.
-
jsonDecodeThrowableMap(
String jsonString) → Map< String, dynamic> - Decodes a JSON string into a Map<String, dynamic>, throwing errors for invalid input.
-
stringFromJson(
dynamic value) → String - Converts a dynamic value to a String.
-
stringToJson(
String value) → String - Identity function for String values in JSON encoding.
-
verifyListDecodability(
String jsonString) → bool - Checks if a string is potentially decodable as a JSON array.
-
verifyMapDecodability(
String jsonString) → bool - Checks if a string is potentially decodable as a JSON object.
Typedefs
-
IterableConverter<
TOld, TNew> = Future< TNew> Function(TOld item)