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
f989d3b8
Commit
f989d3b8
authored
Feb 19, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tooltip gallery demo
parent
e63bcc2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
3 deletions
+76
-3
tooltip_demo.dart
examples/material_gallery/lib/demo/tooltip_demo.dart
+65
-0
home.dart
examples/material_gallery/lib/gallery/home.dart
+8
-3
icon_button.dart
packages/flutter/lib/src/material/icon_button.dart
+3
-0
No files found.
examples/material_gallery/lib/demo/tooltip_demo.dart
0 → 100644
View file @
f989d3b8
// Copyright 2016 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/material.dart'
;
const
String
_introText
=
"Tooltips are short identifying messages that briefly appear in response to "
"a long press. Tooltip messages are also used by services that make Flutter "
"apps accessible, like screen readers."
;
class
TooltipDemo
extends
StatelessComponent
{
Widget
build
(
BuildContext
context
)
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Tooltip'
)
),
body:
new
Builder
(
builder:
(
BuildContext
context
)
{
return
new
Column
(
alignItems:
FlexAlignItems
.
stretch
,
children:
<
Widget
>[
new
Text
(
_introText
,
style:
theme
.
text
.
subhead
),
new
Row
(
children:
<
Widget
>[
new
Text
(
'Long press the '
,
style:
theme
.
text
.
subhead
),
new
Tooltip
(
message:
'call icon'
,
child:
new
Icon
(
size:
IconSize
.
s18
,
icon:
'communication/call'
,
color:
theme
.
primaryColor
)
),
new
Text
(
' icon'
,
style:
theme
.
text
.
subhead
)
]
),
new
Center
(
child:
new
IconButton
(
size:
IconSize
.
s48
,
icon:
'communication/call'
,
color:
theme
.
primaryColor
,
tooltip:
'place a phone call'
,
onPressed:
()
{
Scaffold
.
of
(
context
).
showSnackBar
(
new
SnackBar
(
content:
new
Text
(
'That was an ordinary tap'
)
));
}
)
)
]
.
map
((
Widget
widget
)
{
return
new
Padding
(
padding:
const
EdgeDims
.
only
(
top:
16.0
,
left:
16.0
,
right:
16.0
),
child:
widget
);
})
.
toList
()
);
}
)
);
}
}
examples/material_gallery/lib/gallery/home.dart
View file @
f989d3b8
...
...
@@ -16,6 +16,7 @@ import '../demo/chip_demo.dart';
import
'../demo/date_picker_demo.dart'
;
import
'../demo/dialog_demo.dart'
;
import
'../demo/drop_down_demo.dart'
;
import
'../demo/fitness_demo.dart'
;
import
'../demo/grid_list_demo.dart'
;
import
'../demo/modal_bottom_sheet_demo.dart'
;
import
'../demo/page_selector_demo.dart'
;
...
...
@@ -28,10 +29,10 @@ import '../demo/snack_bar_demo.dart';
import
'../demo/tabs_demo.dart'
;
import
'../demo/tabs_fab_demo.dart'
;
import
'../demo/time_picker_demo.dart'
;
import
'../demo/tooltip_demo.dart'
;
import
'../demo/two_level_list_demo.dart'
;
import
'../demo/typography_demo.dart'
;
import
'../demo/weathers_demo.dart'
;
import
'../demo/fitness_demo.dart'
;
class
GalleryHome
extends
StatefulComponent
{
GalleryHome
({
Key
key
})
:
super
(
key:
key
);
...
...
@@ -111,7 +112,8 @@ class GalleryHomeState extends State<GalleryHome> {
new
GalleryDemo
(
title:
'Sliders'
,
builder:
()
=>
new
SliderDemo
()),
new
GalleryDemo
(
title:
'SnackBar'
,
builder:
()
=>
new
SnackBarDemo
()),
new
GalleryDemo
(
title:
'Tabs'
,
builder:
()
=>
new
TabsDemo
()),
new
GalleryDemo
(
title:
'Time Picker'
,
builder:
()
=>
new
TimePickerDemo
())
new
GalleryDemo
(
title:
'Time Picker'
,
builder:
()
=>
new
TimePickerDemo
()),
new
GalleryDemo
(
title:
'Tooltips'
,
builder:
()
=>
new
TooltipDemo
())
]
)
]
...
...
@@ -129,7 +131,10 @@ class GalleryHomeState extends State<GalleryHome> {
new
GallerySection
(
title:
'Usability'
,
image:
'assets/section_usability.png'
,
colors:
Colors
.
lightGreen
colors:
Colors
.
lightGreen
,
demos:
<
GalleryDemo
>[
new
GalleryDemo
(
title:
'Tooltips'
,
builder:
()
=>
new
TooltipDemo
())
]
)
]
)
...
...
packages/flutter/lib/src/material/icon_button.dart
View file @
f989d3b8
...
...
@@ -21,6 +21,7 @@ import 'tooltip.dart';
class
IconButton
extends
StatelessComponent
{
const
IconButton
({
Key
key
,
this
.
size
:
IconSize
.
s24
,
this
.
icon
,
this
.
colorTheme
,
this
.
color
,
...
...
@@ -28,6 +29,7 @@ class IconButton extends StatelessComponent {
this
.
tooltip
})
:
super
(
key:
key
);
final
IconSize
size
;
final
String
icon
;
final
IconThemeColor
colorTheme
;
final
Color
color
;
...
...
@@ -42,6 +44,7 @@ class IconButton extends StatelessComponent {
Widget
result
=
new
Padding
(
padding:
const
EdgeDims
.
all
(
8.0
),
child:
new
Icon
(
size:
size
,
icon:
icon
,
colorTheme:
colorTheme
,
color:
color
...
...
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