Jonny Borges
Committed by GitHub

Bump to version 2.6

## [2.6.0]
- Added bindings.
You can now add bindings from your controllers to your routes, to prepare GetBuilder or GetX to create a dependency already declared in a Binding class. This feature is in an experimental phase, and will not be documented until the end of the tests.
## [2.5.10]
- Removed remnants of previousArgs on routeObserver.
This feature had been deprecated in previous updates, and was removed in version 2.5.8. Some remaining references on the routeObserver were causing exceptions in version 2.5.9, and were removed completely in version 2.5.10.
... ...
![](get.png)
# Get
Get is an extra-light and powerful library for Flutter that will give you superpowers and increase your productivity. Navigate without context, open dialogs, snackbars or bottomsheets from anywhere in your code, Manage states and inject dependencies in an easy and practical way! Get is secure, stable, up-to-date, and offers a huge range of APIs that are not present on default framework.
... ...

69.9 KB

... ... @@ -13,6 +13,7 @@ export 'src/rx/rx_getbuilder.dart';
export 'src/root/root_widget.dart';
export 'src/routes/default_route.dart';
export 'src/routes/get_route.dart';
export 'src/routes/get_route.dart';
export 'src/routes/observers/route_observer.dart';
export 'src/routes/transitions_type.dart';
export 'src/platform/platform.dart';
... ...
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:get/src/routes/bindings_interface.dart';
import 'bottomsheet/bottomsheet.dart';
import 'platform/platform.dart';
import 'root/root_controller.dart';
... ... @@ -52,6 +53,7 @@ class Get {
int id,
bool fullscreenDialog = false,
Object arguments,
Bindings binding,
bool popGesture}) {
return _get.global(id).currentState.push(GetRouteBase(
opaque: opaque ?? true,
... ... @@ -61,6 +63,7 @@ class Get {
popGesture: popGesture ?? _get._defaultPopGesture,
transition: transition ?? _get._defaultTransition,
fullscreenDialog: fullscreenDialog,
binding: binding,
transitionDuration: duration ?? _get._defaultDurationTransition));
}
... ... @@ -165,11 +168,13 @@ class Get {
bool popGesture,
int id,
Object arguments,
Bindings binding,
bool fullscreenDialog = false,
Duration duration}) {
return _get.global(id).currentState.pushReplacement(GetRouteBase(
opaque: opaque ?? true,
page: page,
binding: binding,
settings: RouteSettings(
name: '/' + page.toString().toLowerCase(), arguments: arguments),
fullscreenDialog: fullscreenDialog,
... ... @@ -185,6 +190,7 @@ class Get {
bool popGesture,
int id,
Object arguments,
Bindings binding,
bool fullscreenDialog = false,
Transition transition}) {
var route = (Route<dynamic> rota) => false;
... ... @@ -194,6 +200,7 @@ class Get {
opaque: opaque ?? true,
popGesture: popGesture ?? _get._defaultPopGesture,
page: page,
binding: binding,
settings: RouteSettings(
name: '/' + page.toString().toLowerCase(), arguments: arguments),
fullscreenDialog: fullscreenDialog,
... ...
abstract class Bindings {
void dependencies();
}
// abstract class INavigation {}
// typedef Snack = Function();
// typedef Modal = Function();
// typedef Route = Function();
... ...
... ... @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:get/src/get_main.dart';
import 'package:get/src/routes/bindings_interface.dart';
import '../platform/platform.dart';
import 'transitions_type.dart';
... ... @@ -29,6 +30,7 @@ class GetRouteBase<T> extends PageRoute<T> {
this.curve = Curves.linear,
this.alignment,
this.parameter,
this.binding,
this.opaque = true,
this.transitionDuration = const Duration(milliseconds: 400),
this.popGesture,
... ... @@ -46,6 +48,8 @@ class GetRouteBase<T> extends PageRoute<T> {
final bool popGesture;
final Bindings binding;
// final Duration duration;
final Map<String, String> parameter;
... ... @@ -464,6 +468,11 @@ class GetRouteBase<T> extends PageRoute<T> {
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
/// prebuild dependencies
if (binding != null) {
binding.dependencies();
}
return buildPageTransitions<T>(
this,
context,
... ...
import 'package:flutter/widgets.dart';
import 'package:get/src/routes/bindings_interface.dart';
import 'transitions_type.dart';
class GetRoute {
... ... @@ -12,6 +12,7 @@ class GetRoute {
final Alignment alignment;
final bool maintainState;
final bool opaque;
final Bindings bindings;
final Widget customTransition;
final Duration transitionDuration;
final bool fullscreenDialog;
... ... @@ -28,6 +29,7 @@ class GetRoute {
this.opaque = true,
this.transitionDuration = const Duration(milliseconds: 400),
this.popGesture,
this.bindings,
this.transition,
this.customTransition,
this.fullscreenDialog = false,
... ...
... ... @@ -38,7 +38,7 @@ class GetObserver extends NavigatorObserver {
String current;
String previous;
Object args;
// String previousArgs;
// String previousArgs;
String removed;
@override
... ... @@ -59,7 +59,7 @@ class GetObserver extends NavigatorObserver {
current = '${route?.settings?.name}';
previous = '${previousRoute?.settings?.name}';
args = route?.settings?.arguments;
// previousArgs = previousRoute?.settings?.arguments;
// previousArgs = previousRoute?.settings?.arguments;
final routeSend = Routing(
removed: null,
... ... @@ -102,7 +102,7 @@ class GetObserver extends NavigatorObserver {
current = '${previousRoute?.settings?.name}';
previous = '${route?.settings?.name}';
args = previousRoute?.settings?.arguments;
// previousArgs = route?.settings?.arguments;
// previousArgs = route?.settings?.arguments;
final routeSend = Routing(
removed: null,
... ...
... ... @@ -10,5 +10,5 @@ enum Transition {
rightToLeftWithFade,
leftToRightWithFade,
cupertino,
custom
// custom
}
... ...
name: get
description: Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
version: 2.5.10
version: 2.6.0
homepage: https://github.com/jonataslaw/get
environment:
... ...