added cupertino native transition check. bump docs. prepare for release.

This commit is contained in:
Luke Freeman 2019-06-20 09:28:28 +10:00
parent bf5de991ad
commit 3d5a90de0d
19 changed files with 54 additions and 36 deletions

View File

@ -1,3 +1,8 @@
# 1.5.0
- Native transitions will now use the Cupertino page route on iOS and Material page route on android. This will enable swipe gestures on iOS.
- Added cupertino specific transition types.
- **You should not be using Cupertino types on non-iOS platforms. It's up to you, but it's bad design**.
# 1.4.0
- Added the ability to define a transition at the point of route definition. Route transitions are optional and any transition defined a "push" will override the route definition.

View File

@ -3,7 +3,7 @@ Fluro
Created by Yakka
https://theyakka.com
Copyright (c) 2018 Yakka LLC.
Copyright (c) 2019 Yakka LLC.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -3,7 +3,7 @@
The brightest, hippest, coolest router for Flutter.
[![Version](https://img.shields.io/badge/version-1.4.0-blue.svg)](https://pub.dartlang.org/packages/fluro)
[![Version](https://img.shields.io/badge/version-1.5.0-blue.svg)](https://pub.dartlang.org/packages/fluro)
[![Build Status](https://travis-ci.org/theyakka/fluro.svg?branch=master)](https://travis-ci.org/theyakka/fluro)
[![Coverage](https://codecov.io/gh/theyakka/fluro/branch/master/graph/badge.svg)](https://codecov.io/gh/theyakka/fluro)
@ -25,7 +25,7 @@ See CHANGELOG for all breaking (and non-breaking) changes.
You should ensure that you add the router as a dependency in your flutter project.
```yaml
dependencies:
fluro: "^1.4.0"
fluro: "^1.5.0"
```
You can also reference the git repo directly if you want:

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import '../../config/application.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'package:flutter/material.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'package:flutter/material.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import '../../helpers/color_helpers.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'dart:async';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'package:fluro/fluro.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import '../helpers/color_helpers.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'package:fluro/fluro.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'package:flutter/material.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'components/app/app_component.dart';

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
library fluro;

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/

View File

@ -3,11 +3,12 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/
import 'dart:async';
import 'dart:io';
import 'package:fluro/fluro.dart';
import 'package:fluro/src/common.dart';
@ -124,20 +125,31 @@ class Router {
(RouteSettings routeSettings, Map<String, List<String>> parameters) {
bool isNativeTransition = (transition == TransitionType.native ||
transition == TransitionType.nativeModal);
if (transition == TransitionType.cupertino || transition == TransitionType.cupertinoFullScreenDialog) {
return new CupertinoPageRoute<dynamic>(
settings: routeSettings,
fullscreenDialog: transition == TransitionType.cupertinoFullScreenDialog,
builder: (BuildContext context) {
return handler.handlerFunc(context, parameters);
});
} else if (isNativeTransition) {
return new MaterialPageRoute<dynamic>(
settings: routeSettings,
fullscreenDialog: transition == TransitionType.nativeModal,
builder: (BuildContext context) {
return handler.handlerFunc(context, parameters);
});
if (isNativeTransition) {
if (Platform.isIOS) {
return new CupertinoPageRoute<dynamic>(
settings: routeSettings,
fullscreenDialog: transition == TransitionType.nativeModal,
builder: (BuildContext context) {
return handler.handlerFunc(context, parameters);
});
} else if (transition == TransitionType.cupertino ||
transition == TransitionType.cupertinoFullScreenDialog) {
return new CupertinoPageRoute<dynamic>(
settings: routeSettings,
fullscreenDialog:
transition == TransitionType.cupertinoFullScreenDialog,
builder: (BuildContext context) {
return handler.handlerFunc(context, parameters);
});
} else {
return new MaterialPageRoute<dynamic>(
settings: routeSettings,
fullscreenDialog: transition == TransitionType.nativeModal,
builder: (BuildContext context) {
return handler.handlerFunc(context, parameters);
});
}
} else {
var routeTransitionsBuilder;
if (transition == TransitionType.custom) {

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/

View File

@ -2,12 +2,13 @@ name: fluro
description: >
Fluro is a Flutter routing library that adds flexible routing options like wildcards, named
parameters and clear route definitions.
version: 1.4.0
author: Yakka, LLC <flutter@theyakka.com>
version: 1.5.0
author: Yakka, LLC <apps@theyakka.com>
homepage: https://github.com/theyakka/fluro
environment:
sdk: ">=2.0.0-dev.58.0 <3.0.0"
sdk: ">=2.1.0 <3.0.0"
flutter: ">=1.2.0"
dependencies:
flutter:
@ -16,7 +17,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
test: "^1.3.3"
test: ^1.6.0
flutter:
uses-material-design: false

View File

@ -3,7 +3,7 @@
* Created by Yakka
* https://theyakka.com
*
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
* Copyright (c) 2019 Yakka, LLC. All rights reserved.
* See LICENSE for distribution and usage details.
*/