Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5a17c2bc
Commit
5a17c2bc
authored
Dec 05, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #754 from abarth/radial_reaction
Remove outdated radial_reaction.dart
parents
b6cf053e
40bc9e65
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
92 deletions
+0
-92
material.dart
packages/flutter/lib/material.dart
+0
-1
radial_reaction.dart
packages/flutter/lib/src/material/radial_reaction.dart
+0
-91
No files found.
packages/flutter/lib/material.dart
View file @
5a17c2bc
...
...
@@ -39,7 +39,6 @@ export 'src/material/page.dart';
export
'src/material/popup_menu.dart'
;
export
'src/material/popup_menu_item.dart'
;
export
'src/material/progress_indicator.dart'
;
export
'src/material/radial_reaction.dart'
;
export
'src/material/radio.dart'
;
export
'src/material/raised_button.dart'
;
export
'src/material/scaffold.dart'
;
...
...
packages/flutter/lib/src/material/radial_reaction.dart
deleted
100644 → 0
View file @
b6cf053e
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
const
Duration
_kShowDuration
=
const
Duration
(
milliseconds:
300
);
const
Duration
_kHideDuration
=
const
Duration
(
milliseconds:
200
);
const
Color
_kOuterColor
=
const
Color
(
0xFFFFFFFF
);
const
Color
_kInnerColor
=
const
Color
(
0xFFFFFFFF
);
const
double
_kMaxOpacity
=
0.2
;
int
_roundOpacity
(
double
opacity
)
{
return
(
255
*
opacity
).
round
();
}
/// A material design radial ink reaction
///
/// See [https://www.google.com/design/spec/animation/responsive-interaction.html#responsive-interaction-radial-action]
class
RadialReaction
{
RadialReaction
({
this
.
center
,
this
.
radius
,
Point
startPosition
})
{
_outerOpacity
=
new
AnimatedValue
<
double
>(
0.0
,
end:
_kMaxOpacity
,
curve:
Curves
.
easeOut
);
_innerCenter
=
new
AnimatedValue
<
Point
>(
startPosition
,
end:
center
,
curve:
Curves
.
easeOut
);
_innerRadius
=
new
AnimatedValue
<
double
>(
0.0
,
end:
radius
,
curve:
Curves
.
easeOut
);
_showPerformance
=
new
Performance
(
duration:
_kShowDuration
)
..
addListener
(()
{
_showPerformance
.
updateVariable
(
_outerOpacity
);
_showPerformance
.
updateVariable
(
_innerCenter
);
_showPerformance
.
updateVariable
(
_innerRadius
);
});
_fade
=
new
ValuePerformance
<
double
>(
variable:
new
AnimatedValue
<
double
>(
1.0
,
end:
0.0
,
curve:
Curves
.
easeIn
),
duration:
_kHideDuration
);
}
/// The center of the circle in which the reaction occurs
final
Point
center
;
/// The radius of the circle in which the reaction occurs
final
double
radius
;
Performance
_showPerformance
;
AnimatedValue
<
double
>
_outerOpacity
;
AnimatedValue
<
Point
>
_innerCenter
;
AnimatedValue
<
double
>
_innerRadius
;
Future
_showComplete
;
ValuePerformance
<
double
>
_fade
;
/// Show the reaction
///
/// Returns a future that resolves when the reaction is completely revealed.
Future
show
()
{
return
_showComplete
=
_showPerformance
.
forward
();
}
/// Hide the reaction
///
/// Returns a future that resolves when the reaction is completely hidden.
Future
hide
()
async
{
await
_showComplete
;
await
_fade
.
forward
();
}
/// Call listener whenever the visual appearance of the reaction changes
void
addListener
(
Function
listener
)
{
_showPerformance
.
addListener
(
listener
);
_fade
.
addListener
(
listener
);
}
final
Paint
_outerPaint
=
new
Paint
();
final
Paint
_innerPaint
=
new
Paint
();
/// Paint the reaction onto the given canvas at the given offset
void
paint
(
Canvas
canvas
,
Offset
offset
)
{
_outerPaint
.
color
=
_kOuterColor
.
withAlpha
(
_roundOpacity
(
_outerOpacity
.
value
*
_fade
.
value
));
canvas
.
drawCircle
(
center
+
offset
,
radius
,
_outerPaint
);
_innerPaint
.
color
=
_kInnerColor
.
withAlpha
(
_roundOpacity
(
_kMaxOpacity
*
_fade
.
value
));
canvas
.
drawCircle
(
_innerCenter
.
value
+
offset
,
_innerRadius
.
value
,
_innerPaint
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment