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

Commit b3a914e

Browse files
committed
Change theme color to white and more UX updates for dataset list
1 parent 31811fc commit b3a914e

File tree

2 files changed

+112
-60
lines changed

2 files changed

+112
-60
lines changed

flutter-app/lib/datasets_list.dart

Lines changed: 90 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ class DatasetsList extends StatelessWidget {
7070
children: filteredDatasets
7171
.map(
7272
(dataset) => new Container(
73-
decoration: new BoxDecoration(
74-
border: Border(
75-
bottom: BorderSide(color: Colors.grey[300])),
76-
),
77-
height: 80,
78-
child: InkWell(
79-
onTap: () {
80-
Navigator.push(
81-
context,
82-
MaterialPageRoute(
83-
builder: (context) =>
84-
new ListLabelsScreen(dataset),
85-
),
86-
);
87-
},
88-
child: new DatasetActions(
89-
dataset, model, scaffoldKey),
90-
),
91-
),
73+
decoration: new BoxDecoration(
74+
border: Border(
75+
bottom: BorderSide(color: Colors.grey[300])),
76+
),
77+
height: 80,
78+
child: InkWell(
79+
onTap: () {
80+
Navigator.push(
81+
context,
82+
MaterialPageRoute(
83+
builder: (context) =>
84+
new ListLabelsScreen(dataset),
85+
),
86+
);
87+
},
88+
child:
89+
new DatasetActions(dataset, model, scaffoldKey),
90+
),
91+
),
9292
)
9393
.toList());
9494
}
@@ -158,6 +158,18 @@ class DatasetActions extends StatelessWidget {
158158
}
159159
}
160160

161+
String sharingLabel(Dataset dataset) {
162+
if (dataset.isOwner(model)) {
163+
return "Private";
164+
}
165+
if (dataset.isCollaborator(model)) {
166+
return "Shared";
167+
}
168+
if (dataset.isPublic) {
169+
return "Public";
170+
}
171+
}
172+
161173
Color getColor(Dataset dataset) {
162174
if (dataset.isOwner(model)) {
163175
return Colors.teal;
@@ -203,28 +215,44 @@ class DatasetActions extends StatelessWidget {
203215
crossAxisAlignment: CrossAxisAlignment.start,
204216
mainAxisAlignment: MainAxisAlignment.center,
205217
children: <Widget>[
206-
new Text(
207-
dataset.name.toUpperCase(),
208-
style: TextStyle(
209-
fontSize: 14,
210-
letterSpacing: 1.1,
211-
fontWeight: FontWeight.bold,
212-
),
218+
Row(
219+
children: <Widget>[
220+
Icon(
221+
getIcon(dataset),
222+
size: 14,
223+
color: Colors.black54,
224+
),
225+
SizedBox(width: 4),
226+
new Text(
227+
dataset.name.toUpperCase(),
228+
style: TextStyle(
229+
fontSize: 14,
230+
letterSpacing: 1.4,
231+
fontWeight: FontWeight.bold,
232+
),
233+
),
234+
],
213235
),
214236
Padding(
215237
padding: const EdgeInsets.symmetric(vertical: 4.0),
216238
child: Row(
217239
children: <Widget>[
218-
Icon(
219-
getIcon(dataset),
220-
size: 16,
221-
color: Colors.black54,
222-
),
223-
SizedBox(width: 4),
224240
new Text(
225241
dataset.description,
226242
style: TextStyle(color: Colors.black54),
227243
),
244+
new Text(
245+
'\u00B7',
246+
style: TextStyle(
247+
color: Colors.black54,
248+
fontWeight: FontWeight.bold,
249+
fontSize: 20,
250+
),
251+
),
252+
new Text(
253+
sharingLabel(dataset),
254+
style: TextStyle(color: Colors.black54),
255+
),
228256
],
229257
),
230258
),
@@ -241,7 +269,7 @@ class DatasetActions extends StatelessWidget {
241269
if (modelExists)
242270
Container(
243271
child: IconButton(
244-
color: Colors.blueGrey,
272+
color: Colors.deepPurple,
245273
icon: Icon(Icons.center_focus_weak),
246274
tooltip: 'Run inference on an image',
247275
onPressed: () async {
@@ -463,13 +491,36 @@ class ModelStatusInfo extends StatelessWidget {
463491
}
464492
}
465493

466-
return new Row(
494+
return Row(
467495
children: <Widget>[
468-
Icon(modelIcon, size: 16),
469-
SizedBox(width: 4),
470-
new Text(
471-
statusText,
472-
style: TextStyle(color: Colors.black54),
496+
Container(
497+
decoration: new BoxDecoration(
498+
color:
499+
doesModelExist ? Color(0x80B2DFDB) : Colors.grey.shade300,
500+
borderRadius: new BorderRadius.circular(4.0),
501+
),
502+
child: Padding(
503+
padding:
504+
const EdgeInsets.symmetric(vertical: 2.0, horizontal: 4),
505+
child: new Row(
506+
mainAxisAlignment: MainAxisAlignment.start,
507+
children: <Widget>[
508+
Icon(
509+
modelIcon,
510+
size: 16,
511+
color: doesModelExist ? Colors.teal : Colors.black54,
512+
),
513+
SizedBox(width: 4),
514+
new Text(
515+
statusText,
516+
style: TextStyle(
517+
fontWeight: FontWeight.bold,
518+
color:
519+
doesModelExist ? Colors.teal : Colors.black54),
520+
),
521+
],
522+
),
523+
),
473524
),
474525
],
475526
);

flutter-app/lib/main.dart

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class MyApp extends StatelessWidget {
6060
child: new MaterialApp(
6161
title: 'Custom Image Classifier',
6262
theme: new ThemeData(
63-
primarySwatch: Colors.deepPurple,
63+
primaryColor: Colors.white,
64+
accentColor: Colors.deepPurple,
6465
dividerColor: Colors.black12,
6566
),
6667
initialRoute: MyHomePage.routeName,
@@ -138,28 +139,28 @@ class _MyHomePageState extends State<MyHomePage> {
138139
},
139140
itemBuilder: (BuildContext context) =>
140141
<PopupMenuItem<MainAction>>[
141-
PopupMenuItem<MainAction>(
142-
child: Text.rich(
142+
PopupMenuItem<MainAction>(
143+
child: Text.rich(
144+
TextSpan(
145+
text: 'Logout',
146+
children: [
143147
TextSpan(
144-
text: 'Logout',
145-
children: [
146-
TextSpan(
147-
text: " (${model.user.displayName})",
148-
style: TextStyle(
149-
color: Colors.black38,
150-
fontStyle: FontStyle.italic,
151-
),
152-
)
153-
],
154-
),
155-
),
156-
value: MainAction.logout,
148+
text: " (${model.user.displayName})",
149+
style: TextStyle(
150+
color: Colors.black38,
151+
fontStyle: FontStyle.italic,
152+
),
153+
)
154+
],
157155
),
158-
const PopupMenuItem<MainAction>(
159-
child: Text('View Tutorial'),
160-
value: MainAction.viewTutorial,
161-
)
162-
],
156+
),
157+
value: MainAction.logout,
158+
),
159+
const PopupMenuItem<MainAction>(
160+
child: Text('View Tutorial'),
161+
value: MainAction.viewTutorial,
162+
)
163+
],
163164
)
164165
: Container()
165166
],

0 commit comments

Comments
 (0)