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
9edd6550
Commit
9edd6550
authored
Sep 24, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1330 from abarth/date_picker_example
Port Date Picker example to fn3
parents
b9489678
cefbfa3b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
22 deletions
+28
-22
container.dart
examples/widgets/container.dart
+4
-4
date_picker.dart
examples/widgets/date_picker.dart
+9
-6
button_state.dart
packages/flutter/lib/src/fn3/button_state.dart
+1
-1
material_button.dart
packages/flutter/lib/src/fn3/material_button.dart
+4
-2
raised_button.dart
packages/flutter/lib/src/fn3/raised_button.dart
+3
-1
scaffold.dart
packages/flutter/lib/src/fn3/scaffold.dart
+3
-2
scrollable.dart
packages/flutter/lib/src/fn3/scrollable.dart
+4
-6
No files found.
examples/widgets/container.dart
View file @
9edd6550
...
...
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:sky/
widgets
.dart'
;
import
'package:sky/
src/fn3
.dart'
;
class
ContainerApp
extends
App
{
Widget
build
()
{
class
ContainerApp
extends
StatelessComponent
{
Widget
build
(
BuildContext
context
)
{
return
new
Column
([
new
Container
(
padding:
new
EdgeDims
.
all
(
10.0
),
margin:
new
EdgeDims
.
all
(
10.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFCCCCCC
)),
child:
new
NetworkImage
(
src:
"https://
www.dartlang.org/logo
s/dart-logo.png"
,
src:
"https://
raw.githubusercontent.com/dart-lang/logos/master/logos_and_wordmark
s/dart-logo.png"
,
width:
300.0
,
height:
300.0
)
...
...
examples/widgets/date_picker.dart
View file @
9edd6550
...
...
@@ -2,27 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:sky/
widgets
.dart'
;
import
'package:sky/
src/fn3
.dart'
;
import
'package:sky/material.dart'
;
void
main
(
)
=>
runApp
(
new
DatePickerDemo
());
class
DatePickerDemo
extends
App
{
DateTime
_dateTime
;
class
DatePickerDemo
extends
StatefulComponent
{
DatePickerDemoState
createState
()
=>
new
DatePickerDemoState
(
this
);
}
void
initState
()
{
class
DatePickerDemoState
extends
ComponentState
<
DatePickerDemo
>
{
DatePickerDemoState
(
DatePickerDemo
config
)
:
super
(
config
)
{
DateTime
now
=
new
DateTime
.
now
();
_dateTime
=
new
DateTime
(
now
.
year
,
now
.
month
,
now
.
day
);
}
DateTime
_dateTime
;
void
_handleDateChanged
(
DateTime
dateTime
)
{
setState
(()
{
_dateTime
=
dateTime
;
});
}
Widget
build
()
{
Widget
build
(
BuildContext
context
)
{
return
new
Theme
(
data:
new
ThemeData
(
brightness:
ThemeBrightness
.
light
,
...
...
packages/flutter/lib/src/fn3/button_state.dart
View file @
9edd6550
...
...
@@ -8,7 +8,7 @@ import 'package:sky/src/fn3/framework.dart';
abstract
class
ButtonState
<
T
extends
StatefulComponent
>
extends
ComponentState
<
T
>
{
ButtonState
(
T
config
)
:
super
(
config
);
bool
highlight
;
bool
highlight
=
false
;
void
_handlePointerDown
(
_
)
{
setState
(()
{
...
...
packages/flutter/lib/src/fn3/material_button.dart
View file @
9edd6550
...
...
@@ -11,12 +11,14 @@ import 'package:sky/src/fn3/material.dart';
// Rather than using this class directly, please use FlatButton or RaisedButton.
abstract
class
MaterialButton
extends
StatefulComponent
{
const
MaterialButton
({
MaterialButton
({
Key
key
,
this
.
child
,
this
.
enabled
:
true
,
this
.
onPressed
})
:
super
(
key:
key
);
})
:
super
(
key:
key
)
{
assert
(
enabled
!=
null
);
}
final
Widget
child
;
final
bool
enabled
;
...
...
packages/flutter/lib/src/fn3/raised_button.dart
View file @
9edd6550
...
...
@@ -17,7 +17,9 @@ class RaisedButton extends MaterialButton {
})
:
super
(
key:
key
,
child:
child
,
enabled:
enabled
,
onPressed:
onPressed
);
onPressed:
onPressed
)
{
assert
(
enabled
!=
null
);
}
RaisedButtonState
createState
()
=>
new
RaisedButtonState
(
this
);
}
...
...
packages/flutter/lib/src/fn3/scaffold.dart
View file @
9edd6550
...
...
@@ -218,8 +218,9 @@ class ScaffoldElement extends RenderObjectElement<Scaffold> {
super
.
mount
(
parent
,
newSlot
);
_children
=
new
Map
<
ScaffoldSlots
,
Element
>();
for
(
ScaffoldSlots
slot
in
ScaffoldSlots
.
values
)
{
_children
[
slot
]
=
widget
.
_children
[
slot
].
createElement
()
..
mount
(
this
,
slot
);
Element
newChild
=
widget
.
_children
[
slot
]?.
createElement
();
_children
[
slot
]
=
newChild
;
newChild
?.
mount
(
this
,
slot
);
}
}
...
...
packages/flutter/lib/src/fn3/scrollable.dart
View file @
9edd6550
...
...
@@ -40,12 +40,7 @@ abstract class Scrollable extends StatefulComponent {
}
abstract
class
ScrollableState
<
T
extends
Scrollable
>
extends
ComponentState
<
T
>
{
ScrollableState
(
T
config
)
:
super
(
config
);
AnimatedSimulation
_toEndAnimation
;
// See _startToEndAnimation()
ValueAnimation
<
double
>
_toOffsetAnimation
;
// Started by scrollTo()
void
initState
(
BuildContext
context
)
{
ScrollableState
(
T
config
)
:
super
(
config
)
{
if
(
config
.
initialScrollOffset
is
double
)
_scrollOffset
=
config
.
initialScrollOffset
;
_toEndAnimation
=
new
AnimatedSimulation
(
_setScrollOffset
);
...
...
@@ -56,6 +51,9 @@ abstract class ScrollableState<T extends Scrollable> extends ComponentState<T> {
});
}
AnimatedSimulation
_toEndAnimation
;
// See _startToEndAnimation()
ValueAnimation
<
double
>
_toOffsetAnimation
;
// Started by scrollTo()
double
_scrollOffset
=
0.0
;
double
get
scrollOffset
=>
_scrollOffset
;
...
...
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