queen library

Classes

App
app facade
AppAssetsLoader
  • to load lang files from 'assets/lang/'
  • AppLang
    facilitate controlling the localization process
    BaseAppConfig
    Contains
    checks if the input does contain the provided value;
    ContainsAny
    check if the value contain at lest one of String form the provided list
    DependencyManager<S>
    EndsWith
    FactoryManager<S>
    IsArabicNum
    checks if the input is a valid integer
    IsBool
    IsDate
    IsDateAfter
    IsDateMillis
    checks if the input is a valid date to parse by DateTime.fromMillisecondsSinceEpoch factory
    IsEgyptianPhone
    IsEmail
    checks if the input is a valid email address
    IsEmpty
    IsFacebookUrl
    IsHexColor
    checks if the input is valid hex color
    IsHindiNum
    checks if the input is a valid integer
    IsIn
    checks if the input is in provided List;
    IsInstagramUrl
    ISKsaPhone
    IsLtrLanguage
    IsNotIn
    checks if the input is NOT in provided List;
    IsNumber
    checks if the input is a valid integer
    IsOptional
    allows you to skip the errors if the input is null
    IsPort
    checks if the input is a valid port
    IsRequired
    IsRTLLanguage
    IsUrl
    IsYoutubeUrl
    LangBuilder
  • listen and rebuild when locale changes
  • LangConfig
    contains the localization config
    LangLauncher
    initialize nations package
    Launch
    TODO :: SHOULD BE IN other PACKAGE
    Launcher
    gets called before runApp() to register or bootstrap other classes
    LazySingletonManager<S>
    Locale
    An identifier used to select a user's language and formatting preferences.
    LocatorsContainer
    LogEvent
    Match
    checks if the input is match other string
    MaxLength
    checks if the input characters length is smaller than the min field
    MaxValue
    MinLength
    checks if the input characters length is bigger than the min field
    MinValue
    NationsAssetsLoader
  • to load lang files from 'assets/lang/'
  • NationsLoader
  • loads translation form assets or any source
  • extend it to build you custom loader if none of the existing
  • fits your needs
  • NotContains
    checks if input does not contain the provided value;
    NotContainsAny
    check if the value does not contain any item from the provided list
    PackageAssetsLoader
  • to load lang files from 'assets/lang/'
  • PrefsLauncher
    QEvent
    QRule
    QThemeBuilderState
    QueenBuilder
  • listen and rebuild when
  • RegExpRule
    allow using a regular expression as validation rule
    RootLauncher
    SingletonManger<S>
    StartsWith
    TextValidationRule
    interface for the queen validation rules extend it and implement : isValid to override the validation logic translatedError return translated message from nations nationsKey return key to use with nations
    TransNotifier
    nations base class
    WebViewConfiguration
    Additional configuration options for LaunchMode.inAppWebView.

    Enums

    Gender
  • model gender enum
  • LaunchMode
    The desired mode to launch a URL.

    Extensions

    NationsLocaleX on Locale
    helper extension for the locale features
    NationsTrans on String
    string translation extension
    RBool on bool
    RContext on BuildContext
    RContextColors on BuildContext
    RContextLocalization on BuildContext
  • Localization shortcuts
  • RContextMediaQuery on BuildContext
  • MediaQuery shortcuts
  • RContextNavigator on BuildContext
    RContextTextTheme on BuildContext
    RContextTheme on BuildContext
    RDateTime on DateTime
    RDateTimeF on DateTime
    RIterable on Iterable<T>
    RIterable
    RIterableNull on List<T?>
  • RIterableString on Iterable<String>
    RLocale on Locale
    extensions on the locale
    RLocaleIsChecker on Locale
    RMap on Map<K, V>
    RNumList on Iterable<num>
    list readableX
    RString on String
    RStringConvert on String
    convert string to different types
    RTimeOfDay on TimeOfDay

    Properties

    Locators LocatorsContainer
    final

    Functions

    bootLaunchers(List<Launcher> launchers) Future<void>
    boots series launchers then boots all parallel launchers
    canLaunch(String urlString) Future<bool>
    Checks whether the specified URL can be handled by some app installed on the device.
    canLaunchUrl(Uri url) Future<bool>
    Checks whether the specified URL can be handled by some app installed on the device.
    capitalizeFirstChar(String str) String
    takes foo return Foo takes foo bar return Foo bar
    capitalizeFirstCharForEachWord(String str) String
    takes foo return Foo takes foo bar return Foo Bar takes foo bar zee return Foo Bar Zee
    closeInAppWebView() Future<void>
    Closes the current in-app web view, if one was previously opened by launchUrl.
    closeWebView() Future<void>
    Closes the current WebView, if one was previously opened via a call to launch.
    containsAny(String v, List<String> list, {bool caseSensitive = false, bool trim = true}) bool
    convertToArabicNumbers(String str) String
    arabic numbers are 0123456789 convert numbers to arabic format 0123456789 becomes ٠١٢٣٤٥٦٧٨٩
    convertToHindiNumbers(String str) String
    arabic numbers are ٠١٢٣٤٥٦٧٨٩
    eightSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:8));
    find<T>({String? tag}) → T
    findInMap(String path, Map<Object?, Object?> map, {String splitOperator = '.'}) Object?
    can dig deeper into the Map if the key is not nested return the value if the key is not nested go deep until find the value
    fiveSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:5));
    flatMapKeys(Map<String, Object?> map) List<String>
    takes a Map and return the flat keys to the map Example map :
    forSeconds<T>(int seconds) Future<T>
    instead of await Future.delayed(const Duration(seconds:1)); do await forSeconds(x)
    fourSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:4));
    isArabicNum(String input) bool
    isBool(Object? input) bool
    isDate(String? v) bool
    checks if the input is a valid date to parse by Dart DateTime class
    isDateAfter(Object? input, DateTime date) bool
    isDateMills(String v, {bool isUtc = false}) bool
    checks if the input is a valid date to parse by DateTime.fromMillisecondsSinceEpoch factory
    isEgyptianNumber(String str) bool
    isEmail(String? email) bool
    checks if the value can be well formatted email address
    isEmpty(String? input) bool
    trim the string then checks if isEmpty if string is empty it will returns true
    isFacebookUrlValid(String url) bool
    isHexColor(String? input) bool
    can starts with or without# must contains
    isHindiNum(String input) bool
    isIn(Object v, List<Object> list) bool
    check if string is in List<String>
    isInstgramUrlValid(String url) bool
    isKsaPhone(String input) bool
    isLtrLanguage(String languageCode) bool
    isNotEmpty(String? string) bool
    trim the string then checks if isNotEmpty
    isNotIn(Object v, List<Object> list) bool
    check if value is NOT in List
    isNumber(String? input) bool
    isPort(Object? input) bool
    isRtlLanguage(String languageCode) bool
    isUrlValid(String url) bool
    isYoutubeUrLValid(String url) bool
    launch(String urlString, {bool? forceSafariVC, bool forceWebView = false, bool enableJavaScript = false, bool enableDomStorage = false, bool universalLinksOnly = false, Map<String, String> headers = const <String, String>{}, Brightness? statusBarBrightness, String? webOnlyWindowName}) Future<bool>
    Parses the specified URL string and delegates handling of it to the underlying platform.
    launchUrl(Uri url, {LaunchMode mode = LaunchMode.platformDefault, WebViewConfiguration webViewConfiguration = const WebViewConfiguration(), String? webOnlyWindowName}) Future<bool>
    Passes url to the underlying platform for handling.
    match(Object? input, Object? other) bool
    checks if two Strings are the same
    maxValue(Object? value, num max) bool
    mergeTwoMaps(Map<String, Object?>? a, Map<String, Object?>? b) Map<String, Object?>?
  • merges to maps into single one
  • if the key found in both maps it will use the one from the second map
  • minLength(String? input, int min) bool
    minValue(Object? value, num min) bool
    nineSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:9));
    notContainsAny(String v, List<String> list) bool
    numberToLocale(String str, Locale locale) String
    localize numbers base on locale if none provided it will use the app locale Nations.locale Make sure you know the difference between arabic and hindi numbers
    oneSecond() Future<void>
    instead of await Future.delayed(const Duration(seconds:1));
    qValidator(List<TextValidationRule> rules, {OnFailureCallBack? onFail, bool useNations = true}) String? Function(String?)
    ? build and return String Function(String value) ? which triggers the provided validation rules
    replaceArgsOf(String data, Map<String, Object?> args) String
  • replace args of map
  • in your assets the arg must starts with : to be identified as variable
  • to replace it
  • sevenSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:7));
    sixSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:6));
    supportsCloseForLaunchMode(LaunchMode mode) Future<bool>
    Returns true if closeInAppWebView is supported for mode in the current platform implementation.
    supportsLaunchMode(LaunchMode mode) Future<bool>
    Returns true if mode is supported by the current platform implementation.
    tenSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:10));
    threeSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:3));
    twoSeconds() Future<void>
    instead of await Future.delayed(const Duration(seconds:2));

    Typedefs

    OnFailureCallBack = void Function(String? input, List<TextValidationRule> rules, TextValidationRule failedRule)