404: Something's gone wrong :-(
- -You've tried to visit a page that doesn't exist. Luckily this site - has other pages.
-If you were looking for something specific, try searching: -
- - -diff --git a/docs/__404error.html b/docs/__404error.html deleted file mode 100644 index 6abebdc..0000000 --- a/docs/__404error.html +++ /dev/null @@ -1,106 +0,0 @@ - - -
- - - - - -You've tried to visit a page that doesn't exist. Luckily this site - has other pages.
-If you were looking for something specific, try searching: -
- - -const Duration(milliseconds: 100)
- const Duration(milliseconds: 200)
- const Duration(milliseconds: 300)
- const Duration(milliseconds: 400)
- const Duration(milliseconds: 500)
- const Duration(milliseconds: 600)
- const Duration(milliseconds: 700)
- const Duration(milliseconds: 800)
- static const Duration ms = Duration(milliseconds: 100)
-
-
- static const Duration ms2 = Duration(milliseconds: 200)
-
-
- static const Duration ms3 = Duration(milliseconds: 300)
-
-
- static const Duration ms4 = Duration(milliseconds: 400)
-
-
- static const Duration ms5 = Duration(milliseconds: 500)
-
-
- static const Duration ms6 = Duration(milliseconds: 600)
-
-
- static const Duration ms7 = Duration(milliseconds: 700)
-
-
- static const Duration ms8 = Duration(milliseconds: 800)
-
-
- 8.0
- x * 2
- x * 3
- x * 4
- x * 5
- x * 6
- x * 7
- x * 8
- static const double x2 = x * 2
-
-
- static const double x3 = x * 3
-
-
- static const double x4 = x * 4
-
-
- static const double x5 = x * 5
-
-
- static const double x6 = x * 6
-
-
- static const double x7 = x * 7
-
-
- static const double x8 = x * 8
-
-
- Return yes
if the boolean is true, otherwise return no
When no
is not specified, it will return null
or
-return SizedBox
if yes
is a Widget
Example usage:
-Widget buildText(BuildContext context, bool shouldGreet) {
- return shouldGreet.ifTrue(
- Text("Hello"),
- );
-}
-
- ifTrue(yes, [no]) {
- if (yes is Widget && this == false) {
- return no ?? SizedBox();
- }
- return this ? yes : no;
-}
- FocusScopeNode
of the FocusScope
that most tightly
-encloses the given context
.
- Theme
instance that encloses the given
-context. [...]
- Returns the FocusScopeNode
of the FocusScope
that most tightly
-encloses the given context
.
FocusScopeNode get focus {
- return FocusScope.of(this);
-}
- Hide the soft keyboard off the screen.
-Deprecated. Will be removed in the next version.
-Should use context.focus.hideKeyboard()
instead.
@deprecated
-void hideKeyboard() {
- this.focus.hideKeyboard();
-}
- The state from the closest instance of this class that encloses the given -context.
-Typical usage is as follows:
-context.navigator
- ..pop()
- ..pop()
- ..pushNamed('/settings');
-
-If rootNavigator
is set to true, the state from the furthest instance of
-this class is given instead. Useful for pushing contents above all subsequent
-instances of Navigator
.
NavigatorState get navigator {
- return Navigator.of(this);
-}
- Pop the top-most route off the navigator.
-Deprecated
. Will be removed in the next version.
-Should call BuildContext.navigator.pop()
instead.
@deprecated
-T pop<T>([T result]) {
- Navigator.of(this).pop(result);
- return result;
-}
- Contains information about the current media.
-For example, the MediaQueryData.size
property contains the width and
-height of the current window.
MediaQueryData get query {
- return MediaQuery.of(this);
-}
- Show a simple dialog with title, message and a close button.
-Example usage:
-void _showUploadSuccessDialog(BuildContext context) {
- context.showDialog(
- message: "Uploaded successful!",
- );
-}
-
- Future showAlertDialog({
- String title,
- @required String message,
- closeButtonTitle = "OK",
-}) {
- return showDialog<void>(
- context: this,
- builder: (BuildContext context) {
- return AlertDialog(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(FludaX.x3),
- ),
- title: (title != null).ifTrue(
- Text(
- title ?? "",
- style: context.theme.textTheme.headline5,
- ),
- ),
- content: Text(
- message ?? "",
- style: context.theme.textTheme.headline6,
- ),
- actions: <Widget>[
- FlatButton(
- child: Text(
- closeButtonTitle,
- style: context.theme.textTheme.button,
- ),
- onPressed: () => this.navigator.pop(),
- ),
- ],
- );
- },
- );
-}
- Text with a color that contrasts with the card and canvas colors.
-Deprecated
. Will be removed in the next version.
-There are other text theme such as context.theme.primaryTextTheme
or
-context.theme.accentTextTheme
that are also useful.
-Should call context.theme.textTheme
instead.
@deprecated
-TextTheme get textTheme {
- return theme.textTheme;
-}
- The data from the closest Theme
instance that encloses the given
-context.
Typical usage is as follows:
-return Text(
- "Hello World!",
- style: context.theme.textTheme.headline6,
-);
-
- ThemeData get theme {
- return Theme.of(this);
-}
- Hide the soft keyboard off the screen.
-void hideKeyboard() {
- if (!this.hasPrimaryFocus) {
- this.unfocus();
- }
-}
- Return an Iterable
which generates its elements dynamically
-begin from this
number to end
number
Iterable<int> to(int end, {int step = 1}) {
- if (step < 1) {
- throw ArgumentError(
- 'Invalid step size: $step. Step size must be greater than 0');
- }
- final count = ((end - this).abs() / step).ceil();
- // Explicit type declaration required for function argument.
- final int Function(int) generator = (this >= end).ifTrue(
- (index) => this - (step * index),
- (index) => this + (step * index),
- );
- return Iterable<int>.generate(count, generator);
-}
- true
if the number this
is even
- true
if the number this
is a negative number
- true
if the number this
is odd
- true
if the number this
is a positive number
- Returns true
if the number this
is even
bool get isEven => this % 2 == 0;
- Returns true
if the number this
is a negative number
bool get isNegative => this < 0;
- Returns true
if the number this
is odd
bool get isOdd => this % 2 != 0;
- Returns true
if the number this
is a positive number
bool get isPositive => this > 0;
- Animates the controlled PageView from the current page to the given page.
-The animation lasts for the 200 ms and follows the Curves.easeOut. -The returned Future resolves when the animation completes.
-Animates the position from its current value to the given value.
-Any active animation is canceled. If the user is currently scrolling, that -action is canceled.
-The animation lasts for the 200 ms and follows the Curves.easeOut.
-The returned Future will complete when the animation ends, whether it -completed successfully or whether it was interrupted prematurely.
-true
if the string this
is null
or empty
- this
string as an double literal and return its value.
-
-this
string as a, possibly signed, integer literal
-and return its value.
-
-pattern
-has a match in this
string. [...]
-
-this
string is a valid email address
-
-Return true
if the string this
is null
or empty
bool get isEmptyOrNull => this == null || isEmpty;
- Parses the specified URL string and delegates handling of it to the -underlying platform.
-forceSafariVC
is only used in iOS with iOS version >= 9.0. By default (when unset), the launcher
-opens web URLs in the Safari View Controller, anything else is opened
-using the default handler on the platform. If set to true, it opens the
-URL in the Safari View Controller. If false, the URL is opened in the
-default browser of the phone. Note that to work with universal links on iOS,
-this must be set to false to let the platform's system handle the URL.
-Set this to false if you want to use the cookies/context of the main browser
-of the app (such as SSO flows). This setting will nullify universalLinksOnly
-and will always launch a web content in the built-in Safari View Controller regardless
-if the url is a universal link or not.
universalLinksOnly
is only used in iOS with iOS version >= 10.0. This setting is only validated
-when forceSafariVC
is set to false. The default value of this setting is false.
-By default (when unset), the launcher will either launch the url in a browser (when the
-url is not a universal link), or launch the respective native app content (when
-the url is a universal link). When set to true, the launcher will only launch
-the content if the url is a universal link and the respective app for the universal
-link is installed on the user's device; otherwise throw a PlatformException
.
forceWebView
is an Android only setting. If null or false, the URL is
-always launched with the default browser on device. If set to true, the URL
-is launched in a WebView. Unlike iOS, browser context is shared across
-WebViews.
-enableJavaScript
is an Android only setting. If true, WebView enable
-javascript.
-enableDomStorage
is an Android only setting. If true, WebView enable
-DOM storage.
-headers
is an Android only setting that adds headers to the WebView.
Note that if any of the above are set to true but the URL is not a web URL,
-this will throw a PlatformException
.
statusBarBrightness
Sets the status bar brightness of the application
-after opening a link on iOS. Does nothing if no value is passed. This does
-not handle resetting the previous status bar style.
Returns true
if launch url is successful; false
is returned if
-the URLs is invalid or the schemes cannot be handled
-Also return false
when universalLinksOnly
is set to true and
-the universal link failed to launch
Future<bool> launch({
- bool forceSafariVC,
- bool forceWebView,
- bool enableJavaScript,
- bool enableDomStorage,
- bool universalLinksOnly,
- Map<String, String> headers,
- Brightness statusBarBrightness,
-}) async {
- if (await url.canLaunch(this)) {
- return url.launch(
- this,
- forceSafariVC: forceSafariVC,
- forceWebView: forceWebView,
- enableJavaScript: enableJavaScript,
- enableDomStorage: enableDomStorage,
- universalLinksOnly: universalLinksOnly,
- headers: headers,
- );
- }
- return false;
-}
- Parse this
string as an double literal and return its value.
double toDouble() {
- return double.parse(this);
-}
- Parse this
string as a, possibly signed, integer literal
-and return its value.
int toInt() {
- return int.parse(this);
-}
- Returns whether the regular expression pattern
-has a match in this
string.
For some pre-defined regular expressions, check out RegexUtils
Example usage
-final String greetings = "Hello World";
-
-if (greetings.validate(RegexUtils.name)) {
- return "Hello Mr $greetings";
-} else {
- return "$greetings is not a name";
-}
-
- bool validate(Pattern pattern) {
- return RegexUtils.check(this, pattern);
-}
- Returns whether this
string is a valid email address
bool validateEmail() {
- return RegexUtils.check(this, RegexUtils.email);
-}
- text
-
-Select all the text
void selectAll() {
- this.selection = TextSelection(
- baseOffset: 0,
- extentOffset: this.text.length,
- );
-}
- Widget center() {
- return Center(
- child: this,
- );
-}
- Widget expand([flex = 1]) {
- return Expanded(
- flex: flex,
- child: this,
- );
-}
- Widget flex([flex = 1, fit = FlexFit.loose]) {
- return Flexible(
- flex: flex,
- fit: fit,
- child: this,
- );
-}
- Widget tappable({
- GestureTapCallback onTap,
- GestureTapCallback onDoubleTap,
- GestureLongPressCallback onLongPress,
- GestureTapDownCallback onTapDown,
- GestureTapCancelCallback onTapCancel,
-}) {
- return Tappable(
- child: this,
- onTap: onTap,
- onDoubleTap: onDoubleTap,
- onLongPress: onLongPress,
- onTapDown: onTapDown,
- onTapCancel: onTapCancel,
- );
-}
- Widget wrapHero(String tag) {
- return Hero(
- tag: tag,
- flightShuttleBuilder: (BuildContext flightContext,
- Animation<double> animation,
- HeroFlightDirection flightDirection,
- BuildContext fromHeroContext,
- BuildContext toHeroContext) {
- return Material(
- child: toHeroContext.widget,
- );
- },
- child: this,
- );
-}
- function
and ignore all the errors. [...]
-
-function
and ignore all the errors. [...]
-
-Fluda is a library which makes Flutter application development faster and easier. It makes your code clean and easy to read.
-Note: Fluda is still under development. -Feedback and Pull Requests are most welcome!
-Check the example project's README.md for some example usages.
-Please file Fluda specific issues, bugs, or feature requests in our issue tracker.
-Plugin issues that are not specific to Fluda can be filed in the Flutter issue tracker.
-If you wish to contribute a change to any of the existing plugins in this repo, -please review our contribution guide, -and send a pull request.
-Note: This documentation hasn't been finished yet. There may be some part of the instruction is missing. Please stay tuned.
+Extension | +Example Usage | +Original Equivalent | +
---|---|---|
MediaQueryData get query |
+context.query |
+MediaQuery.of(context) |
+
FocusScopeNode get focus |
+context.focus |
+FocusScope.of(context) |
+
ThemeData get theme |
+context.theme |
+Theme.of(context) |
+
NavigatorState get navigator |
+context.navigator |
+Navigator.of(context) |
+
Future showAlertDialog({String title, @required String message, closeButtonTitle = "OK"}) |
+context.showDialog(message: "Fluda" ) |
+Check out the code | +
Extension | +Example Usage | +Original Equivalent | +
---|---|---|
hideKeyboard() |
+context.focus.hideKeyboard() |
+if (!FocusScope.of(context).hasPrimaryFocus) FocusScope.of(context).unfocus() |
+
Extension | +Example Usage | +Original Equivalent | +
---|---|---|
ifTrue(yes, [no]) |
+someBool.ifTrue(Text("Hello")) |
+someBool ? Text("Hello") : SizedBox() |
+
+ | someBool.ifTrue(firstVariable, secondVariable) |
+someBool ? firstVariable : secondVariable |
+
Extension | +Example Usage | +Original Equivalent | +
---|---|---|
bool get isEven |
+5.isEven |
+(5 % 2 == 0) |
+
bool get isOdd |
+5.isOdd |
+(5 % 2 != 0) |
+
bool get isPositive |
+5.isPositive |
+(5 > 0) |
+
bool get isNegative |
+5.isNegative |
+(5 < 0) |
+
Iterable<int> to(int end, {int step = 1}) |
+2.to(5) |
+[2, 3, 4, 5] |
+
Extension | +Example Usage | +Original Equivalent | +
---|---|---|
bool get isEmptyOrNull |
+"Hello".isEmptyOrNull |
+"Hello" == null ⎮⎮ "Hello".isEmpty |
+
bool get isNotEmptyOrNull |
+"Hello".isNotEmptyOrNull |
+"Hello" != null && "Hello".isNotEmpty |
+
int toInt() |
+"23".toInt() |
+int.parse("23") |
+
double toDouble() |
+"23.3".toDouble() |
+double.parse("23.3") |
+
bool validate() |
+"Simon Pham".validate(RegexUtils.name) |
+RegExp(nameRegex).hasMatch("Simon Pham") |
+
bool validateEmail() |
+"email@email.com".validateEmail() |
+RegExp(emailRegex).hasMatch("email@email.com") |
+
Future launch() |
+"https://some.url".launch() |
+if (await url.canLaunch("https://some.url")) url.launch("https://some.url") |
+
Future dial() |
+"0987654321".dial() |
+if (await url.canLaunch("tel:0987654321")) url.launch("tel:0987654321") |
+
Future sendMail() |
+"me@email.com".sendMail() |
+if (await url.canLaunch("mailto:me@email.com")) url.launch("mailto:me@email.com") |
+
Extension | +Example Usage | +Description | +
---|---|---|
Future<void> goTo(int page) |
+pageController.goTo(2) |
+Animate PageView to page index 2 smoothly |
+
Extension | +Example Usage | +Description | +
---|---|---|
Future<void> goTo(double position) |
+scrollController.goTo(233.99) |
+Animate Scroll widget to position 233.99 smoothly |
+
Extension | +Example Usage | +Description | +
---|---|---|
void selectAll() |
+textEditingController.selectAll() |
+Select all text in the text field | +
Extension | +Example Usage | +Description | +
---|---|---|
// TODO: complete documentation |
++ |
Constant | +Value | +
---|---|
// TODO: complete documentation |
+
Function | +Example Usage | +Description | +
---|---|---|
// TODO: complete documentation |
++ | + |