Skip to content

Commit 59ae6f9

Browse files
committed
Update tfserving-flutter
1 parent b0e7284 commit 59ae6f9

File tree

5 files changed

+71
-88
lines changed

5 files changed

+71
-88
lines changed

tfserving-flutter/codelab2/finished/lib/main.dart

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,33 +78,29 @@ class _TFServingDemoState extends State<TFServingDemo> {
7878
hintText: 'Enter a sentence here',
7979
),
8080
),
81-
Column(
82-
children: <Widget>[
83-
ListTile(
84-
title: const Text('gRPC'),
85-
leading: Radio<ConnectionModeType>(
86-
value: ConnectionModeType.grpc,
87-
groupValue: _connectionMode,
88-
onChanged: (value) {
89-
setState(() {
90-
_connectionMode = value;
91-
});
92-
},
81+
RadioGroup<ConnectionModeType>(
82+
groupValue: _connectionMode,
83+
onChanged: (value) {
84+
setState(() {
85+
_connectionMode = value;
86+
});
87+
},
88+
child: Column(
89+
children: <Widget>[
90+
ListTile(
91+
title: const Text('gRPC'),
92+
leading: Radio<ConnectionModeType>(
93+
value: ConnectionModeType.grpc,
94+
),
9395
),
94-
),
95-
ListTile(
96-
title: const Text('REST'),
97-
leading: Radio<ConnectionModeType>(
98-
value: ConnectionModeType.rest,
99-
groupValue: _connectionMode,
100-
onChanged: (value) {
101-
setState(() {
102-
_connectionMode = value;
103-
});
104-
},
96+
ListTile(
97+
title: const Text('REST'),
98+
leading: Radio<ConnectionModeType>(
99+
value: ConnectionModeType.rest,
100+
),
105101
),
106-
),
107-
],
102+
],
103+
),
108104
),
109105
Row(
110106
mainAxisAlignment: MainAxisAlignment.spaceEvenly,

tfserving-flutter/codelab2/finished/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies:
3434
# The following adds the Cupertino Icons font to your application.
3535
# Use with the CupertinoIcons class for iOS style icons.
3636
cupertino_icons: ^1.0.8
37-
http: ^1.4.0
37+
http: ^1.5.0
3838
protobuf: ^4.1.1
3939
grpc: ^4.1.0
4040
fixnum: ^1.1.1

tfserving-flutter/codelab2/starter/lib/main.dart

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,33 +78,29 @@ class _TFServingDemoState extends State<TFServingDemo> {
7878
hintText: 'Enter a sentence here',
7979
),
8080
),
81-
Column(
82-
children: <Widget>[
83-
ListTile(
84-
title: const Text('gRPC'),
85-
leading: Radio<ConnectionModeType>(
86-
value: ConnectionModeType.grpc,
87-
groupValue: _connectionMode,
88-
onChanged: (value) {
89-
setState(() {
90-
_connectionMode = value;
91-
});
92-
},
81+
RadioGroup<ConnectionModeType>(
82+
groupValue: _connectionMode,
83+
onChanged: (value) {
84+
setState(() {
85+
_connectionMode = value;
86+
});
87+
},
88+
child: Column(
89+
children: <Widget>[
90+
ListTile(
91+
title: const Text('gRPC'),
92+
leading: Radio<ConnectionModeType>(
93+
value: ConnectionModeType.grpc,
94+
),
9395
),
94-
),
95-
ListTile(
96-
title: const Text('REST'),
97-
leading: Radio<ConnectionModeType>(
98-
value: ConnectionModeType.rest,
99-
groupValue: _connectionMode,
100-
onChanged: (value) {
101-
setState(() {
102-
_connectionMode = value;
103-
});
104-
},
96+
ListTile(
97+
title: const Text('REST'),
98+
leading: Radio<ConnectionModeType>(
99+
value: ConnectionModeType.rest,
100+
),
105101
),
106-
),
107-
],
102+
],
103+
),
108104
),
109105
Row(
110106
mainAxisAlignment: MainAxisAlignment.spaceEvenly,

tfserving-flutter/codelab2/starter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies:
3434
# The following adds the Cupertino Icons font to your application.
3535
# Use with the CupertinoIcons class for iOS style icons.
3636
cupertino_icons: ^1.0.8
37-
http: ^1.4.0
37+
http: ^1.5.0
3838
protobuf: ^4.1.1
3939
grpc: ^4.1.0
4040
fixnum: ^1.1.1

tfserving-flutter/codelab_rebuild.yaml

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -527,33 +527,29 @@ steps:
527527
hintText: 'Enter a sentence here',
528528
),
529529
),
530-
Column(
531-
children: <Widget>[
532-
ListTile(
533-
title: const Text('gRPC'),
534-
leading: Radio<ConnectionModeType>(
535-
value: ConnectionModeType.grpc,
536-
groupValue: _connectionMode,
537-
onChanged: (value) {
538-
setState(() {
539-
_connectionMode = value;
540-
});
541-
},
530+
RadioGroup<ConnectionModeType>(
531+
groupValue: _connectionMode,
532+
onChanged: (value) {
533+
setState(() {
534+
_connectionMode = value;
535+
});
536+
},
537+
child: Column(
538+
children: <Widget>[
539+
ListTile(
540+
title: const Text('gRPC'),
541+
leading: Radio<ConnectionModeType>(
542+
value: ConnectionModeType.grpc,
543+
),
542544
),
543-
),
544-
ListTile(
545-
title: const Text('REST'),
546-
leading: Radio<ConnectionModeType>(
547-
value: ConnectionModeType.rest,
548-
groupValue: _connectionMode,
549-
onChanged: (value) {
550-
setState(() {
551-
_connectionMode = value;
552-
});
553-
},
545+
ListTile(
546+
title: const Text('REST'),
547+
leading: Radio<ConnectionModeType>(
548+
value: ConnectionModeType.rest,
549+
),
554550
),
555-
),
556-
],
551+
],
552+
),
557553
),
558554
Row(
559555
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@@ -3908,7 +3904,6 @@ steps:
39083904
// Unique auto-generated name of the object.
39093905
string object_name = 2;
39103906
}
3911-
39123907
- name: Mkdir lib/proto/generated
39133908
path: codelab2/tfserving_flutter
39143909
mkdir: lib/proto/generated
@@ -3952,7 +3947,6 @@ steps:
39523947
protoc:
39533948
proto: ./tensorflow_serving/apis/classification.proto
39543949
output: grpc:./generated
3955-
39563950
- name: Generate from ./tensorflow/core/framework/graph.proto
39573951
path: codelab2/tfserving_flutter/lib/proto
39583952
protoc:
@@ -4048,7 +4042,6 @@ steps:
40484042
protoc:
40494043
proto: ./tensorflow/core/protobuf/saved_object_graph.proto
40504044
output: grpc:./generated
4051-
40524045
- name: Generate from ./google/protobuf/any.proto
40534046
path: codelab2/tfserving_flutter/lib/proto
40544047
protoc:
@@ -4059,11 +4052,9 @@ steps:
40594052
protoc:
40604053
proto: ./google/protobuf/wrappers.proto
40614054
output: grpc:./generated
4062-
40634055
- name: Dart format
40644056
path: codelab2/tfserving_flutter/lib/proto
40654057
dart: format .
4066-
40674058
- name: Copy codelab2/starter
40684059
copydir:
40694060
from: codelab2/tfserving_flutter
@@ -4090,16 +4081,12 @@ steps:
40904081
40914082
linter:
40924083
rules:
4093-
- name: Copy codelab2/finished
4094-
copydir:
4095-
from: codelab2/tfserving_flutter
4096-
to: codelab2/finished
40974084
- name: Patch lib/main.dart
4098-
path: codelab2/finished/lib/main.dart
4085+
path: codelab2/tfserving_flutter/lib/main.dart
40994086
patch-u: |
41004087
--- b/tfserving-flutter/codelab2/finished/lib/main.dart
41014088
+++ a/tfserving-flutter/codelab2/finished/lib/main.dart
4102-
@@ -164,21 +164,107 @@ class _TFServingDemoState extends State<TFServingDemo> {
4089+
@@ -160,21 +160,107 @@ class _TFServingDemoState extends State<TFServingDemo> {
41034090
// For iOS emulator, desktop and web platforms
41044091
_server = '127.0.0.1';
41054092
}
@@ -4215,6 +4202,10 @@ steps:
42154202
- return '';
42164203
}
42174204
}
4205+
- name: Copy codelab2/finished
4206+
copydir:
4207+
from: codelab2/tfserving_flutter
4208+
to: codelab2/finished
42184209
- name: Flutter clean
42194210
path: codelab2/finished
42204211
flutter: clean

0 commit comments

Comments
 (0)