Skip to content

Commit

Permalink
Fixed push with Generic types
Browse files Browse the repository at this point in the history
  • Loading branch information
the-meedu-app authored and the-meedu-app committed Feb 10, 2021
1 parent 05b3e34 commit e72b10f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Add the following to your pubspec.yaml
```yaml
dependencies:
meedu: ^0.5.4
flutter_meedu: ^1.1.1
flutter_meedu: ^1.1.2
```
Now you're ready to use **flutter_meedu**
3 changes: 3 additions & 0 deletions packages/flutter_meedu/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.1.2]
- Fixed push with Generic types.

## [1.1.1]
- Updated meedu: ^0.5.4.

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_meedu/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.1"
version: "1.1.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'transitions/right_to_left.dart';
import 'transition.dart';
import 'transitions/up_to_down.dart';

class MeeduPageRoute extends PageRoute {
class MeeduPageRoute<T> extends PageRoute<T> {
final Duration transitionDuration;
final bool maintainState;
final Color barrierColor;
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_meedu/lib/src/router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Future<T> push<T>(
Duration transitionDuration = const Duration(milliseconds: 300),
bool backGestureEnabled = false,
}) {
return _state.push(
getRoute(
return _state.push<T>(
getRoute<T>(
page,
arguments: arguments,
maintainState: maintainState,
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_meedu/lib/src/router/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'navigator.dart';
import 'transition.dart';

/// get the transition
Route getRoute(
Route<T> getRoute<T>(
Widget page, {
Object arguments,
bool maintainState = true,
Expand All @@ -27,22 +27,22 @@ Route getRoute(

switch (_transition) {
case Transition.material:
return MaterialPageRoute(
return MaterialPageRoute<T>(
builder: (_) => page,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
settings: settings,
);
case Transition.cupertino:
return CupertinoPageRoute(
return CupertinoPageRoute<T>(
builder: (_) => page,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
settings: settings,
);

default:
return MeeduPageRoute(
return MeeduPageRoute<T>(
page,
settings: settings,
maintainState: maintainState,
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_meedu/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_meedu
description: A simple State Managment, Dependency Injection, Reactive programming and Navigation for Flutter apps.
version: 1.1.1
version: 1.1.2
homepage: https://github.com/darwin-morocho/flutter-meedu/tree/master/packages/flutter_meedu
documentation: https://flutter.meedu.app

Expand Down

0 comments on commit e72b10f

Please sign in to comment.