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
bb8e82d0
Commit
bb8e82d0
authored
Sep 26, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port address_book to fn3
parent
e5104256
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
43 deletions
+28
-43
main.dart
examples/address_book/lib/main.dart
+28
-43
No files found.
examples/address_book/lib/main.dart
View file @
bb8e82d0
...
...
@@ -3,9 +3,9 @@
// found in the LICENSE file.
import
'package:sky/material.dart'
;
import
'package:sky/
widgets
.dart'
;
import
'package:sky/
src/fn3
.dart'
;
class
Field
extends
Component
{
class
Field
extends
Stateless
Component
{
Field
({
Key
key
,
this
.
inputKey
,
...
...
@@ -17,7 +17,7 @@ class Field extends Component {
final
String
icon
;
final
String
placeholder
;
Widget
build
()
{
Widget
build
(
BuildContext
context
)
{
return
new
Row
([
new
Padding
(
padding:
const
EdgeDims
.
symmetric
(
horizontal:
16.0
),
...
...
@@ -34,19 +34,22 @@ class Field extends Component {
}
}
class
AddressBookApp
extends
App
{
class
AddressBookHome
extends
StatelessComponent
{
AddressBookHome
({
this
.
navigator
});
Widget
buildToolBar
(
Navigator
navigator
)
{
final
NavigatorState
navigator
;
Widget
buildToolBar
(
BuildContext
context
)
{
return
new
ToolBar
(
left:
new
IconButton
(
icon:
"navigation/arrow_back"
),
right:
[
new
IconButton
(
icon:
"navigation/check"
)]
);
}
Widget
buildFloatingActionButton
(
Navigator
navigator
)
{
Widget
buildFloatingActionButton
(
BuildContext
context
)
{
return
new
FloatingActionButton
(
child:
new
Icon
(
type:
'image/photo_camera'
,
size:
24
),
backgroundColor:
Theme
.
of
(
this
).
accentColor
backgroundColor:
Theme
.
of
(
context
).
accentColor
);
}
...
...
@@ -59,7 +62,7 @@ class AddressBookApp extends App {
static
final
GlobalKey
fillKey
=
new
GlobalKey
();
static
final
GlobalKey
emoticonKey
=
new
GlobalKey
();
Widget
buildBody
(
Navigator
navigator
)
{
Widget
buildBody
(
BuildContext
context
)
{
return
new
Material
(
child:
new
Block
([
new
AspectRatio
(
...
...
@@ -78,45 +81,27 @@ class AddressBookApp extends App {
);
}
Widget
build
Main
(
Navigator
navigator
)
{
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
toolbar:
buildToolBar
(
navigator
),
body:
buildBody
(
navigator
),
floatingActionButton:
buildFloatingActionButton
(
navigator
)
);
}
NavigationState
_navigationState
;
void
initState
()
{
_navigationState
=
new
NavigationState
([
new
Route
(
name:
'/'
,
builder:
(
navigator
,
route
)
=>
buildMain
(
navigator
)
),
]);
super
.
initState
();
}
Widget
build
()
{
ThemeData
theme
=
new
ThemeData
(
brightness:
ThemeBrightness
.
light
,
primarySwatch:
Colors
.
teal
,
accentColor:
Colors
.
pinkAccent
[
100
]
);
return
new
Theme
(
data:
theme
,
child:
new
DefaultTextStyle
(
style:
Typography
.
error
,
// if you see this, you've forgotten to correctly configure the text style!
child:
new
Title
(
title:
'Address Book'
,
child:
new
Navigator
(
_navigationState
)
)
)
toolbar:
buildToolBar
(
context
),
body:
buildBody
(
context
),
floatingActionButton:
buildFloatingActionButton
(
context
)
);
}
}
final
ThemeData
theme
=
new
ThemeData
(
brightness:
ThemeBrightness
.
light
,
primarySwatch:
Colors
.
teal
,
accentColor:
Colors
.
pinkAccent
[
100
]
);
void
main
(
)
{
runApp
(
new
AddressBookApp
());
runApp
(
new
App
(
title:
'Address Book'
,
theme:
theme
,
routes:
<
String
,
RouteBuilder
>{
'/'
:
(
NavigatorState
navigator
,
Route
route
)
=>
new
AddressBookHome
(
navigator:
navigator
)
}
));
}
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