Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This directory contains resources that the Flutter team uses during
the development of packages.

## Luci builder file
`try_builders.json` contains the supported luci try builders
for packages. It follows format:
```json
{
"builders":[
{
"name":"yyy",
"repo":"packages",
"enabled":true
}
]
}
```
This file will be mainly used in [`flutter/cocoon`](https://github.com/flutter/cocoon)
to trigger/update pre-submit luci tasks.
9 changes: 9 additions & 0 deletions dev/try_builders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"builders":[
{
"name":"fuchsia_ctl",
"repo":"packages",
"enabled":true
}
]
}
4 changes: 4 additions & 0 deletions packages/animations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [1.1.2] - July 28, 2020

* Fixes for upcoming changes to the flutter framework.

## [1.1.1] - June 19, 2020

* Hide implementation of `DualTransitionBuilder` as the widget has been implemented in the Flutter framework.
Expand Down
3 changes: 3 additions & 0 deletions packages/animations/example/lib/fade_through_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ class _FadeThroughTransitionDemoState extends State<FadeThroughTransitionDemo> {
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.photo_library),
// ignore: deprecated_member_use
title: Text('Albums'),
),
BottomNavigationBarItem(
icon: Icon(Icons.photo),
// ignore: deprecated_member_use
title: Text('Photos'),
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
// ignore: deprecated_member_use
title: Text('Search'),
),
],
Expand Down
6 changes: 4 additions & 2 deletions packages/animations/lib/src/fade_scale_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter/material.dart'
hide decelerateEasing; // ignore: undefined_hidden_name
// TODO(goderbauer): Remove implementation import when material properly exports the file.
import 'package:flutter/src/material/curves.dart'; // ignore: implementation_imports

// TODO(shihaohong): Remove DualTransitionBuilder once flutter/flutter's `stable`
// branch contains DualTransitionBuilder.
import 'dual_transition_builder.dart' as dual_transition_builder;
import 'modal.dart';
import 'utils/curves.dart';

/// The modal transition configuration for a Material fade transition.
///
Expand Down
15 changes: 12 additions & 3 deletions packages/animations/lib/src/open_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class OpenContainer<T extends Object> extends StatefulWidget {
this.transitionDuration = const Duration(milliseconds: 300),
this.transitionType = ContainerTransitionType.fade,
this.useRootNavigator = false,
this.opaque = true,
}) : assert(closedColor != null),
assert(openColor != null),
assert(closedElevation != null),
Expand All @@ -107,6 +108,7 @@ class OpenContainer<T extends Object> extends StatefulWidget {
assert(tappable != null),
assert(transitionType != null),
assert(useRootNavigator != null),
assert(opaque != null),
super(key: key);

/// Background color of the container while it is closed.
Expand Down Expand Up @@ -246,6 +248,11 @@ class OpenContainer<T extends Object> extends StatefulWidget {
/// to the nearest navigator.
final bool useRootNavigator;

/// Whether the route obscures previous routes when the transition is complete.
/// When [opaque] is true, the route obscures previous routes.
/// By default, [opaque] is true.
final bool opaque;

@override
_OpenContainerState<T> createState() => _OpenContainerState<T>();
}
Expand Down Expand Up @@ -281,6 +288,7 @@ class _OpenContainerState<T> extends State<OpenContainer<T>> {
transitionDuration: widget.transitionDuration,
transitionType: widget.transitionType,
useRootNavigator: widget.useRootNavigator,
opaque: widget.opaque,
));
if (widget.onClosed != null) {
widget.onClosed(data);
Expand Down Expand Up @@ -394,6 +402,7 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
@required this.transitionDuration,
@required this.transitionType,
@required this.useRootNavigator,
this.opaque = true,
}) : assert(closedColor != null),
assert(openColor != null),
assert(closedElevation != null),
Expand All @@ -405,6 +414,7 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
assert(closedBuilderKey != null),
assert(transitionType != null),
assert(useRootNavigator != null),
assert(opaque != null),
_elevationTween = Tween<double>(
begin: closedElevation,
end: openElevation,
Expand Down Expand Up @@ -546,6 +556,8 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {

@override
final Duration transitionDuration;
@override
final bool opaque;
final ContainerTransitionType transitionType;

final bool useRootNavigator;
Expand Down Expand Up @@ -848,9 +860,6 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
@override
Color get barrierColor => null;

@override
bool get opaque => true;

@override
bool get barrierDismissible => false;

Expand Down
29 changes: 26 additions & 3 deletions packages/animations/lib/src/shared_axis_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

import 'package:flutter/animation.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart'
hide
decelerateEasing, // ignore: undefined_hidden_name
standardEasing, // ignore: undefined_hidden_name
accelerateEasing; // ignore: undefined_hidden_name
// TODO(goderbauer): Remove implementation import when material properly exports the file.
import 'package:flutter/src/material/curves.dart'; // ignore: implementation_imports
import 'package:flutter/widgets.dart';

// TODO(shihaohong): Remove DualTransitionBuilder once flutter/flutter's `stable`
// branch contains DualTransitionBuilder.
import 'dual_transition_builder.dart' as dual_transition_builder;
import 'utils/curves.dart';

/// Determines which type of shared axis transition is used.
enum SharedAxisTransitionType {
Expand Down Expand Up @@ -398,7 +403,7 @@ class _ExitTransition extends StatelessWidget {
final Color fillColor;
final Widget child;

static final Animatable<double> _fadeOutTransition = FlippedCurveTween(
static final Animatable<double> _fadeOutTransition = _FlippedCurveTween(
curve: accelerateEasing,
).chain(CurveTween(curve: const Interval(0.0, 0.3)));

Expand Down Expand Up @@ -478,3 +483,21 @@ class _ExitTransition extends StatelessWidget {
return null; // unreachable
}
}

/// Enables creating a flipped [CurveTween].
///
/// This creates a [CurveTween] that evaluates to a result that flips the
/// tween vertically.
///
/// This tween sequence assumes that the evaluated result has to be a double
/// between 0.0 and 1.0.
class _FlippedCurveTween extends CurveTween {
/// Creates a vertically flipped [CurveTween].
_FlippedCurveTween({
@required Curve curve,
}) : assert(curve != null),
super(curve: curve);

@override
double transform(double t) => 1.0 - super.transform(t);
}
66 changes: 0 additions & 66 deletions packages/animations/lib/src/utils/curves.dart

This file was deleted.

2 changes: 1 addition & 1 deletion packages/animations/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: animations
description: Fancy pre-built animations that can easily be integrated into any Flutter application.
version: 1.1.1
version: 1.1.2
homepage: https://github.com/flutter/packages/tree/master/packages/animations

environment:
Expand Down
3 changes: 3 additions & 0 deletions packages/imitation_game/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* Initial version (TBD).
27 changes: 27 additions & 0 deletions packages/imitation_game/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2019 The Chromium Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading