From dbe16043299a20608d3ddf50b43b9762ba48769b Mon Sep 17 00:00:00 2001 From: Varakh Date: Fri, 7 May 2021 19:45:08 +0200 Subject: [PATCH] Adapt README, Switch to Stacked instead of outdated provider_architecture, Update dependencies --- README.md | 3 +-- lib/app.dart | 2 -- lib/core/services/api.dart | 2 +- lib/core/services/link_service.dart | 2 +- lib/ui/views/startup_view.dart | 4 ++-- pubspec.yaml | 28 ++++++++++++++-------------- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 5ddd2f7..75bce79 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,7 @@ Start by installing dependencies and generating entities! ### Working versions for SDK ``` -[✓] Flutter (Channel stable, 2.0.4, on Linux, locale de_DE.UTF-8) -[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) +[✓] Flutter (Channel stable, 2.0.6, on Linux, locale de_DE.UTF-8) ``` ## Dependencies diff --git a/lib/app.dart b/lib/app.dart index 4d89eb1..38a5739 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_translate/flutter_translate.dart'; -import 'package:flutter_translate/localization_provider.dart'; -import 'package:flutter_translate/localized_app.dart'; import 'package:provider/provider.dart'; import 'core/enums/refresh_event.dart'; diff --git a/lib/core/services/api.dart b/lib/core/services/api.dart index 4aaa1e9..5f9c577 100644 --- a/lib/core/services/api.dart +++ b/lib/core/services/api.dart @@ -31,7 +31,7 @@ class Api implements ApiErrorConverter { try { _logger .d("Requesting GET API endpoint '${_url + route}' with headers '$_headers' and maximum timeout '$_timeout'"); - var response = await http.get(_url + route, headers: _headers).timeout(_timeout); + var response = await http.get(Uri.parse(_url + route), headers: _headers).timeout(_timeout); handleRestErrors(response); return response; } on TimeoutException { diff --git a/lib/core/services/link_service.dart b/lib/core/services/link_service.dart index 5bbeff1..4c75c56 100644 --- a/lib/core/services/link_service.dart +++ b/lib/core/services/link_service.dart @@ -1,4 +1,4 @@ -import 'package:flutter_translate/global.dart'; +import 'package:flutter_translate/flutter_translate.dart'; import 'package:logger/logger.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/ui/views/startup_view.dart b/lib/ui/views/startup_view.dart index b087ad9..39b478e 100644 --- a/lib/ui/views/startup_view.dart +++ b/lib/ui/views/startup_view.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:provider_architecture/provider_architecture.dart'; +import 'package:stacked/stacked.dart'; import '../../core/enums/viewstate.dart'; import '../../core/viewmodels/startup_model.dart'; @@ -10,7 +10,7 @@ class StartUpView extends StatelessWidget { @override Widget build(BuildContext context) { - return ViewModelProvider.withConsumer( + return ViewModelBuilder.reactive( viewModelBuilder: () => StartUpViewModel(), onModelReady: (model) => model.handleStartUpLogic(), builder: (context, model, child) => Scaffold( diff --git a/pubspec.yaml b/pubspec.yaml index 10f2148..d15408c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,28 +19,28 @@ environment: dependencies: flutter: sdk: flutter - cupertino_icons: 1.0.2 + cupertino_icons: 1.0.3 flutter_localizations: sdk: flutter - flutter_translate: 1.6.0 - provider: 4.3.3 - provider_architecture: 1.1.1+1 - get_it: 3.1.0 # major changes > 3 + flutter_translate: 3.0.0 + provider: 5.0.0 + stacked: 2.1.1 + get_it: 6.1.1 # major changes > 7 logger: 1.0.0 shared_preferences: 2.0.5 - http: 0.12.2 - json_annotation: 3.1.1 - validators: 2.0.1 - flutter_linkify: 4.1.0 - url_launcher: 5.7.10 - expandable: 4.1.4 - share: 0.6.5+4 - file_picker: 2.1.7 + http: 0.13.3 + validators: 3.0.0 + flutter_linkify: 5.0.2 + url_launcher: 6.0.3 + expandable: 5.0.1 + share: 2.0.1 + file_picker: 3.0.1 clipboard: 0.1.3 receive_sharing_intent: 1.4.5 - permission_handler: 5.1.0+2 + permission_handler: 7.1.0 package_info: 2.0.0 simple_gesture_detector: 0.2.0 + json_annotation: 3.1.1 dev_dependencies: flutter_test: