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
c0f068ce
Commit
c0f068ce
authored
Dec 08, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #814 from abarth/rm_event_recorder
Remove unused EventRecorder
parents
56818d18
a45b85c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
66 deletions
+0
-66
event_recorder.dart
packages/flutter/lib/src/widgets/event_recorder.dart
+0
-65
widgets.dart
packages/flutter/lib/widgets.dart
+0
-1
No files found.
packages/flutter/lib/src/widgets/event_recorder.dart
deleted
100644 → 0
View file @
56818d18
// 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
'package:flutter/gestures.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
enum
EventRecorderMode
{
stop
,
record
}
typedef
void
EventsReadyCallback
(
Iterable
<
PointerEvent
>
events
);
/// EventRecorder is a utility widget that allows input events occurring
/// on the child to be recorded. The widget is initially in the "stop" state
/// by default. When in the "record" state, all pointer input events
/// occurring on the child are recorded into a buffer. When the "stop" state
/// is entered again, the onEventsReady callback is invoked with a list of
/// the recorded events.
class
EventRecorder
extends
StatefulComponent
{
EventRecorder
({
Key
key
,
this
.
child
,
this
.
mode
:
EventRecorderMode
.
stop
,
this
.
onEventsReady
});
final
Widget
child
;
final
EventRecorderMode
mode
;
final
EventsReadyCallback
onEventsReady
;
_EventRecorderState
createState
()
=>
new
_EventRecorderState
();
}
class
_EventRecorderState
extends
State
<
EventRecorder
>
{
final
List
<
PointerEvent
>
_events
=
<
PointerEvent
>[];
void
didUpdateConfig
(
EventRecorder
oldConfig
)
{
if
(
oldConfig
.
mode
==
EventRecorderMode
.
record
&&
config
.
mode
==
EventRecorderMode
.
stop
)
{
config
.
onEventsReady
(
_events
);
_events
.
clear
();
}
}
void
_recordEvent
(
PointerEvent
event
)
{
if
(
config
.
mode
==
EventRecorderMode
.
record
)
_events
.
add
(
event
);
}
Widget
build
(
BuildContext
context
)
{
return
new
Listener
(
onPointerDown:
_recordEvent
,
onPointerMove:
_recordEvent
,
onPointerUp:
_recordEvent
,
onPointerCancel:
_recordEvent
,
child:
config
.
child
);
}
}
packages/flutter/lib/widgets.dart
View file @
c0f068ce
...
...
@@ -12,7 +12,6 @@ export 'src/widgets/dismissable.dart';
export
'src/widgets/drag_target.dart'
;
export
'src/widgets/editable_text.dart'
;
export
'src/widgets/enter_exit_transition.dart'
;
export
'src/widgets/event_recorder.dart'
;
export
'src/widgets/focus.dart'
;
export
'src/widgets/framework.dart'
;
export
'src/widgets/gesture_detector.dart'
;
...
...
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