Skip to content

Commit

Permalink
update to 3.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataslaw committed Aug 10, 2020
1 parent 54e5ddc commit 8d84630
Show file tree
Hide file tree
Showing 21 changed files with 153 additions and 120 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [3.4.4]
- Fix exception 'isInit called null' when tags are used in conjunction with dependencies. (@djade007)

## [3.4.3]
- Fix onInit fired only first time
- Fix language callback(@lundin)
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@
# About Get

- GetX is an extra-light and powerful solution for Flutter. It combines high performance state management, intelligent dependency injection, and route management in a quick and practical way.
- GetX is not for everyone, its focus is (performance) on the minimum consumption of resources ([look the benchmarks](https://github.com/jonataslaw/benchmarks)), (productivity) using an easy and pleasant syntax and (organization) allowing the total decoupling of the View from the business logic.
- GetX will save hours of development, and will extract the maximum performance that your application can deliver, being easy for beginners, and accurate for experts.
- 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.
- GetX is not `bloated`. It has a multitude of features that allow you to start programming without worrying about anything, but each of these features are in separate containers, and are only started after use. If you only use State Management, only State Management will be compiled. If you only use routes, nothing from the state management will be compiled. You can compile the benchmark repository, and you will see that using only Get state management, the application compiled with Get has become smaller than all other applications that have only the state management of other packages, because nothing that is not used will be compiled into your code, and each GetX solution was designed to be extra lightweight. The merit here also comes from Flutter's AOT which is incredible, and manages to eliminate unused resources like no other framework does.

**GetX makes your development productive, but want to make it even more productive? Add the extension [GetX extension](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) to your VSCode**. Not available in other IDEs for now.

- GetX has 3 basic principles, this means that this is the priority for all resources in the library
**PERFORMANCE:** GetX is focused on performance and minimum consumption of resources. Benchmarks are almost always not important in the real world, but if you want, there is a consumption indicator here([benchmarks](https://github.com/jonataslaw/benchmarks)), where GetX does better than other state management approaches, for example. The difference is not large, but it shows our concern not to waste its resources.
**PRODUCTIVITY:** GetX uses an easy and pleasant syntax.
**ORGANIZATION:** GetX allows total decoupling of the View from the business logic.


- GetX will save hours of development, and will extract the maximum performance that your application can deliver, being easy for beginners, and accurate for experts. 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.


- GetX is not a bloated. It has a multitude of features that allow you to start programming without worrying about anything, but each of these features are in separate containers, and are only started after use. If you only use State Management, only State Management will be compiled. If you only use routes, nothing from the state management will be compiled. You can compile the benchmark repository, and you will see that using only Get state management, the application compiled with Get has become smaller than all other applications that have only the state management of other packages, because nothing that is not used will be compiled into your code, and each GetX solution was designed to be extra lightweight. The merit here also comes from Flutter's tree shaking which is incredible, and manages to eliminate unused resources like no other framework does.

**GetX makes your development productive, but want to make it even more productive? Add the extension [GetX extension to VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) to your VSCode**

# Installing

Expand Down
12 changes: 6 additions & 6 deletions benchmark/state_managers/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0-nullsafety"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -140,7 +140,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0-nullsafety"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -311,7 +311,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -512,7 +512,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0-nullsafety"
uuid:
dependency: "direct main"
description:
Expand All @@ -526,7 +526,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety"
watcher:
dependency: transitive
description:
Expand All @@ -549,5 +549,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.9.0-18.0 <2.9.0"
flutter: ">=1.16.0"
14 changes: 8 additions & 6 deletions example/lib/home/bindings/home_binding.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import 'package:dio/dio.dart';
import 'package:get/get.dart';
import 'package:get_state/home/controllers/home_controller.dart';
import 'package:get_state/home/data/home_provider.dart';
import 'package:get_state/home/data/home_repository.dart';
import '../controllers/home_controller.dart';
import '../data/home_provider.dart';
import '../data/home_repository.dart';

class HomeBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut<HomeController>(() {
final homeProvider = HomeProvider();
final homeRepository = HomeRepository(homeProvider);
return HomeController(homeRepository);
Get.put(Dio());
Get.put(HomeProvider(dio: Get.find()));
Get.put(HomeRepository(homeProvider: Get.find()));
return HomeController(homeRepository: Get.find());
});
}
}
6 changes: 3 additions & 3 deletions example/lib/home/controllers/home_controller.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:get/get.dart';
import 'package:get_state/home/data/home_model.dart';
import 'package:get_state/home/data/home_repository.dart';
import '../data/home_model.dart';
import '../data/home_repository.dart';

class HomeController extends GetxController {
HomeController(this.homeRepository);
HomeController({this.homeRepository});
final HomeRepository homeRepository;

Rx<ApiModel> data = Rx<ApiModel>();
Expand Down
35 changes: 31 additions & 4 deletions example/lib/home/data/home_provider.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
import 'package:dio/dio.dart';
import 'package:get_state/home/data/home_model.dart';
import 'package:flutter/foundation.dart';
import 'home_model.dart';

class HomeProvider {
Future<ApiModel> fetchData() async {
abstract class IHomeProvider {
Future<ApiModel> get();
Future<ApiModel> post(Map<String, dynamic> data);
Future<ApiModel> put(Map<String, dynamic> data);
Future<ApiModel> delete(int id);
}

class HomeProvider implements IHomeProvider {
final Dio dio;

HomeProvider({@required this.dio});

Future<ApiModel> get() async {
try {
final response = await Dio().get("https://api.covid19api.com/summary");
final response = await dio.get("https://api.covid19api.com/summary");
return ApiModel.fromJson(response.data);
} catch (e) {
print(e.toString());
return null;
}
}

@override
Future<ApiModel> post(Map<String, dynamic> data) {
throw UnimplementedError();
}

@override
Future<ApiModel> put(Map<String, dynamic> data) {
throw UnimplementedError();
}

@override
Future<ApiModel> delete(int id) {
throw UnimplementedError();
}
}
8 changes: 4 additions & 4 deletions example/lib/home/data/home_repository.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:get_state/home/data/home_provider.dart';
import 'package:get_state/home/data/home_model.dart';
import 'home_model.dart';
import 'home_provider.dart';

class HomeRepository {
HomeRepository(this.homeProvider);
HomeRepository({this.homeProvider});
final HomeProvider homeProvider;

Future<ApiModel> getData() async {
return homeProvider.fetchData();
return homeProvider.get();
}
}
20 changes: 10 additions & 10 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.2"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,7 +21,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0-nullsafety"
charcode:
dependency: transitive
description:
Expand All @@ -42,14 +42,14 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0-nullsafety"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.9"
version: "3.0.10"
fake_async:
dependency: transitive
description:
Expand All @@ -73,7 +73,7 @@ packages:
name: get
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.2"
version: "3.4.3"
http_parser:
dependency: transitive
description:
Expand All @@ -94,7 +94,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety"
path:
dependency: transitive
description:
Expand All @@ -120,7 +120,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.9.5"
stream_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -155,13 +155,13 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0-nullsafety"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.9.0-18.0 <2.9.0"
2 changes: 1 addition & 1 deletion lib/route_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export 'src/navigation/root/root_widget.dart';
export 'src/navigation/snackbar/snack_route.dart';
export 'src/navigation/bottomsheet/bottomsheet.dart';
export 'src/navigation/snackbar/snack.dart';
export 'src/get_main.dart';
export 'src/core/get_main.dart';
export 'src/navigation/routes/default_route.dart';
export 'src/navigation/root/smart_management.dart';
export 'src/navigation/extension_navigation.dart';
12 changes: 6 additions & 6 deletions lib/src/get_interface.dart → lib/src/core/get_interface.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'navigation/root/parse_route.dart';
import 'navigation/root/root_controller.dart';
import 'navigation/routes/custom_transition.dart';
import 'navigation/routes/observers/route_observer.dart';
import 'navigation/routes/transitions_type.dart';
import '../utils.dart';
import '../navigation/root/parse_route.dart';
import '../navigation/root/root_controller.dart';
import '../navigation/routes/custom_transition.dart';
import '../navigation/routes/observers/route_observer.dart';
import '../navigation/routes/transitions_type.dart';
import '../../utils.dart';

///Use Get.to instead of Navigator.push, Get.off instead of Navigator.pushReplacement,
///Get.offAll instead of Navigator.pushAndRemoveUntil. For named routes just add "named"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/get_main.dart → lib/src/core/get_main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:get/src/get_interface.dart';
import 'package:get/src/core/get_interface.dart';

///Use to instead of Navigator.push, off instead of Navigator.pushReplacement,
///offAll instead of Navigator.pushAndRemoveUntil. For named routes just add "named"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/instance/extension_instance.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:get/src/get_interface.dart';
import 'package:get/src/core/get_interface.dart';
import 'get_instance.dart';

extension Inst on GetInterface {
Expand Down
Loading

0 comments on commit 8d84630

Please sign in to comment.