Jonny Borges
Committed by GitHub

Fix broken links and empty List

## [2.10.1]
- Fix broken links on pub
- Fix List empty error
## [2.10.0]
- Added SmartManagement, your application's memory is managed intelligently like never before!
- Added Obx, a widget that knows when to rebuild a child, without needing any type.
... ...
<a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" align="right" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
![](get.png)
*Languages: [English](README.md), [Brazilian Portuguese](README.pt-br.md).*
... ... @@ -50,21 +51,22 @@ Flutter's conventional navigation has a lot of unnecessary boilerplate, requires
This library that will change the way you work with the Framework and save your life from boilerplate, increasing your productivity, and provide you with everything that is most modern when it comes to managing states, routes and dependencies.
- **[How to use?](#how-to-use)**
- **[Navigating without named routes](#Navigating-without-named-routes)**
- **[SnackBars](#SnackBars)**
- **[Dialogs](#Dialogs)**
- **[BottomSheets](#BottomSheets)**
- **[Simple State Manager](#Simple-State-Manager)**
- **[Reactive State Manager](#Reactive-State-Manager)**
- **[Bindings](#Bindings)**
- **[Workers](#Workers)**
- **[Navigate with named routes](#Navigate-with-named-routes)**
- **[Send data to named Routes](#Send-data-to-named-Routes)**
- **[Dynamic urls links](#Dynamic-urls-links)**
- **[Middleware](#Middleware)**
- **[Optional Global Settings](#Optional-Global-Settings)**
- **[Other Advanced APIs and Manual configurations](#Other-Advanced-APIs-and-Manual-configurations)**
- **[Nested Navigators](#Nested-Navigators)**
- **[Navigating without named routes](#navigating-without-named-routes)**
- **[SnackBars](#snackBars)**
- **[Dialogs](#dialogs)**
- **[BottomSheets](#bottomsheets)**
- **[Simple State Manager](#simple-state-manager)**
- **[Reactive State Manager](#reactive-state-manager)**
- **[Bindings](#bindings)**
- **[Workers](#workers)**
- **[Navigate with named routes](#navigate-with-named-routes)**
- **[Send data to named Routes](#send-data-to-named-Routes)**
- **[Dynamic urls links](#dynamic-urls-links)**
- **[Middleware](#middleware)**
- **[Optional Global Settings](#optional-global-settings)**
- **[Nested Navigators](#nested-navigators)**
- **[Other Advanced APIs and Manual configurations](#other-advanced-apis-and-manual-configurations)**
#### You can contribute to the project in multiple ways:
... ... @@ -1012,6 +1014,54 @@ Get.config(
defaultTransition = Transitions.cupertino}
```
### Nested Navigators
Get made Flutter's nested navigation even easier.
You don't need the context, and you will find your navigation stack by Id.
- NOTE: Creating parallel navigation stacks can be dangerous. The ideal is not to use NestedNavigators, or to use sparingly. If your project requires it, go ahead, but keep in mind that keeping multiple navigation stacks in memory may not be a good idea for RAM consumption.
See how simple it is:
```dart
Navigator(
key: nestedKey(1), // create a key by index
initialRoute: '/',
onGenerateRoute: (settings) {
if (settings.name == '/') {
return GetRouteBase(
page: Scaffold(
appBar: AppBar(
title: Text("Main"),
),
body: Center(
child: FlatButton(
color: Colors.blue,
onPressed: () {
Get.toNamed('/second', id:1); // navigate by your nested route by index
},
child: Text("Go to second")),
),
),
);
} else if (settings.name == '/second') {
return GetRouteBase(
page: Center(
child: Scaffold(
appBar: AppBar(
title: Text("Main"),
),
body: Center(
child: Text("second")
),
),
),
);
}
}),
```
This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them.
### Other Advanced APIs and Manual configurations
GetMaterialApp configures everything for you, but if you want to configure Get Manually using advanced APIs.
... ... @@ -1067,53 +1117,3 @@ Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in th
```
### Nested Navigators
Get made Flutter's nested navigation even easier.
You don't need the context, and you will find your navigation stack by Id.
- NOTE: Creating parallel navigation stacks can be dangerous. The ideal is not to use NestedNavigators, or to use sparingly. If your project requires it, go ahead, but keep in mind that keeping multiple navigation stacks in memory may not be a good idea for RAM consumption.
See how simple it is:
```dart
Navigator(
key: nestedKey(1), // create a key by index
initialRoute: '/',
onGenerateRoute: (settings) {
if (settings.name == '/') {
return GetRouteBase(
page: Scaffold(
appBar: AppBar(
title: Text("Main"),
),
body: Center(
child: FlatButton(
color: Colors.blue,
onPressed: () {
Get.toNamed('/second', id:1); // navigate by your nested route by index
},
child: Text("Go to second")),
),
),
);
} else if (settings.name == '/second') {
return GetRouteBase(
page: Center(
child: Scaffold(
appBar: AppBar(
title: Text("Main"),
),
body: Center(
child: Text("second")
),
),
),
);
}
}),
```
This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them.
<a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
... ...
... ... @@ -31,6 +31,7 @@ class GetRouteBase<T> extends PageRoute<T> {
this.alignment,
this.parameter,
this.binding,
this.bindings,
this.opaque = true,
this.transitionDuration = const Duration(milliseconds: 400),
this.popGesture,
... ... @@ -46,6 +47,9 @@ class GetRouteBase<T> extends PageRoute<T> {
if (binding != null) {
binding.dependencies();
}
if (bindings != null) {
bindings.forEach((element) => element.dependencies());
}
}
/// Builds the primary contents of the route.
... ... @@ -55,6 +59,8 @@ class GetRouteBase<T> extends PageRoute<T> {
final Bindings binding;
final List<Bindings> bindings;
// final Duration duration;
final Map<String, String> parameter;
... ...
... ... @@ -13,6 +13,7 @@ class GetRoute {
final bool maintainState;
final bool opaque;
final Bindings binding;
final List<Bindings> bindings;
final Widget customTransition;
final Duration transitionDuration;
final bool fullscreenDialog;
... ... @@ -30,6 +31,7 @@ class GetRoute {
this.transitionDuration = const Duration(milliseconds: 400),
this.popGesture,
this.binding,
this.bindings,
this.transition,
this.customTransition,
this.fullscreenDialog = false,
... ...
... ... @@ -78,7 +78,6 @@ class _GetXState<T extends RxController> extends State<GetX<T>> {
if (isCreator || widget.assignId) {
if (widget.autoRemove && Get.isRegistred<T>()) {
print("DISPOSEEER CHAMADOOO");
// controller.onClose();
Get.delete<T>();
}
... ...
... ... @@ -175,7 +175,7 @@ class ListX<E> extends Iterable<E> implements RxInterface<E> {
void addAll(List<E> item) {
_list.addAll(item);
subject.add(Change<E>.insert(item: _list.last, pos: _list.length - 1));
subject.add(Change<E>.insert(item: _list, pos: _list.length - 1));
}
/// Adds only if [item] is not null.
... ... @@ -183,6 +183,11 @@ class ListX<E> extends Iterable<E> implements RxInterface<E> {
if (item != null) add(item);
}
/// Adds only if [item] is not null.
void addAllNonNull(Iterable<E> item) {
if (item != null) addAll(item);
}
void insert(int index, E item) {
_list.insert(index, item);
subject.add(Change<E>.insert(item: item, pos: index));
... ... @@ -591,7 +596,7 @@ extension MapExtension on Map {
extension ListExtension<E> on List<E> {
ListX<E> get obs {
if (this != null)
return ListX<E>([])..assignAll(this);
return ListX<E>([])..addAllNonNull(this);
else
return ListX<E>(null);
}
... ...
... ... @@ -5,7 +5,7 @@ class Change<T> {
/// Value after change
final T $new;
final T item;
final item;
final ListChangeOp op;
... ...
name: get
description: Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
version: 2.10.0
version: 2.10.1
homepage: https://github.com/jonataslaw/get
environment:
... ...
... ... @@ -44,7 +44,7 @@ void main() {
expect(find.text("Double: 0.0"), findsOneWidget);
expect(find.text("String: string"), findsOneWidget);
expect(find.text("Bool: true"), findsOneWidget);
expect(find.text("List: 1"), findsOneWidget);
expect(find.text("List: 0"), findsOneWidget);
expect(find.text("Map: 0"), findsOneWidget);
Controller.to.increment();
... ... @@ -67,7 +67,7 @@ class Controller extends RxController {
var counter = 0.obs;
var doubleNum = 0.0.obs;
var string = "string".obs;
var list = [0].obs;
var list = [].obs;
var map = {}.obs;
var boolean = true.obs;
... ...