Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 31811fc

Browse files
committed
Use a pill instead of chip for showing label image count
1 parent 73e0fa2 commit 31811fc

File tree

1 file changed

+53
-42
lines changed

1 file changed

+53
-42
lines changed

flutter-app/lib/labelscreen.dart

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -235,38 +235,38 @@ class _ListLabelsScreenState extends State<ListLabelsScreen> {
235235
return PopupMenuButton<Actions>(
236236
onSelected: onPopupMenuItemClicked,
237237
itemBuilder: (BuildContext context) => <PopupMenuEntry<Actions>>[
238-
const PopupMenuItem(
239-
child: Text('Train model'),
240-
value: Actions.trainModel,
241-
),
242-
const PopupMenuItem(
243-
child: Text('View Collaborators'),
244-
value: Actions.viewCollaborators,
245-
),
246-
const PopupMenuItem(
247-
child: Text('View Past Operations'),
248-
value: Actions.viewPastOperations,
249-
),
250-
PopupMenuItem(
251-
child: widget.dataset.isPublic
252-
? Text('Make private')
253-
: Text('Make public'),
254-
value: Actions.changeVisiblity,
255-
),
256-
const PopupMenuItem(
257-
child: Text('Export to Firebase'),
258-
value: Actions.exportToFirebase,
259-
),
260-
const PopupMenuItem(
261-
child: Text('Show bucket path'),
262-
value: Actions.copyGCSPath,
263-
),
264-
const PopupMenuDivider(),
265-
const PopupMenuItem(
266-
child: Text('Delete Dataset'),
267-
value: Actions.deleteDataset,
268-
),
269-
],
238+
const PopupMenuItem(
239+
child: Text('Train model'),
240+
value: Actions.trainModel,
241+
),
242+
const PopupMenuItem(
243+
child: Text('View Collaborators'),
244+
value: Actions.viewCollaborators,
245+
),
246+
const PopupMenuItem(
247+
child: Text('View Past Operations'),
248+
value: Actions.viewPastOperations,
249+
),
250+
PopupMenuItem(
251+
child: widget.dataset.isPublic
252+
? Text('Make private')
253+
: Text('Make public'),
254+
value: Actions.changeVisiblity,
255+
),
256+
const PopupMenuItem(
257+
child: Text('Export to Firebase'),
258+
value: Actions.exportToFirebase,
259+
),
260+
const PopupMenuItem(
261+
child: Text('Show bucket path'),
262+
value: Actions.copyGCSPath,
263+
),
264+
const PopupMenuDivider(),
265+
const PopupMenuItem(
266+
child: Text('Delete Dataset'),
267+
value: Actions.deleteDataset,
268+
),
269+
],
270270
);
271271
}
272272

@@ -482,10 +482,10 @@ class LabelEntry extends StatelessWidget {
482482
context,
483483
MaterialPageRoute(
484484
builder: (context) => new ListLabelSamples(
485-
dataset,
486-
labelKey,
487-
labelName,
488-
),
485+
dataset,
486+
labelKey,
487+
labelName,
488+
),
489489
),
490490
);
491491
}
@@ -498,13 +498,24 @@ class LabelEntry extends StatelessWidget {
498498
if (_canEdit(model))
499499
new Row(
500500
children: [
501-
Chip(
502-
avatar: CircleAvatar(
503-
backgroundColor: Colors.grey.shade800,
504-
child: Text('$totalImages'),
501+
Container(
502+
decoration: new BoxDecoration(
503+
color: Colors.grey.shade300,
504+
borderRadius: new BorderRadius.circular(20.0),
505+
),
506+
child: Padding(
507+
padding: EdgeInsets.symmetric(
508+
vertical: 4, horizontal: 12),
509+
child: Text(
510+
totalImages == 1
511+
? 'One image'
512+
: '$totalImages images',
513+
style: TextStyle(
514+
fontSize: 14,
515+
fontWeight: FontWeight.bold,
516+
),
517+
),
505518
),
506-
label: Text(totalImages == 1 ? 'image' : 'images'),
507-
backgroundColor: Colors.white24,
508519
),
509520
const Icon(Icons.navigate_next),
510521
],

0 commit comments

Comments
 (0)