質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -150,4 +150,109 @@
|
|
150
150
|
|
151
151
|
何が間違っているのかエラー見ても不明です。
|
152
152
|
どなたかアドバイスいただけませんでしょうか。
|
153
|
-
よろしくお願いいたします。
|
153
|
+
よろしくお願いいたします。
|
154
|
+
|
155
|
+
## 追記
|
156
|
+
```ここに言語を入力
|
157
|
+
//入力画面
|
158
|
+
import 'package:flutter/material.dart';
|
159
|
+
|
160
|
+
void main() {
|
161
|
+
runApp(MyApp());
|
162
|
+
}
|
163
|
+
|
164
|
+
// ignore: must_be_immutable
|
165
|
+
class MyApp extends StatefulWidget {
|
166
|
+
String name;
|
167
|
+
String phone;
|
168
|
+
|
169
|
+
MyApp({Key key, this.name, this.phone}) : super(key: key);
|
170
|
+
|
171
|
+
@override
|
172
|
+
MyAppState createState() => MyAppState();
|
173
|
+
}
|
174
|
+
class MyAppState extends State<MyApp> {
|
175
|
+
Widget build(BuildContext context) {
|
176
|
+
return MaterialApp(
|
177
|
+
theme: ThemeData(
|
178
|
+
primarySwatch: Colors.blue,
|
179
|
+
visualDensity: VisualDensity.adaptivePlatformDensity,
|
180
|
+
),
|
181
|
+
home: Scaffold(
|
182
|
+
appBar: AppBar(
|
183
|
+
title: Text('入力画面'),
|
184
|
+
),
|
185
|
+
body: Center(
|
186
|
+
child: Column(
|
187
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
188
|
+
children: [
|
189
|
+
TextField(
|
190
|
+
onChanged: (value) {
|
191
|
+
setState((){
|
192
|
+
name = value;
|
193
|
+
});
|
194
|
+
},
|
195
|
+
decoration: InputDecoration(
|
196
|
+
hintText: 'ここに入力した値を次の画面に渡したい'
|
197
|
+
),
|
198
|
+
),
|
199
|
+
TextField(
|
200
|
+
decoration: InputDecoration(
|
201
|
+
hintText: 'ここに入力した値を次の画面に渡したい'
|
202
|
+
),
|
203
|
+
),
|
204
|
+
RaisedButton(
|
205
|
+
child: Text('確認画面へ'),
|
206
|
+
onPressed: (){
|
207
|
+
Navigator.push(
|
208
|
+
context,
|
209
|
+
MaterialPageRoute(builder: (context) => NextPage()),
|
210
|
+
);
|
211
|
+
}
|
212
|
+
),
|
213
|
+
],
|
214
|
+
),
|
215
|
+
),
|
216
|
+
)
|
217
|
+
);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
//確認画面
|
222
|
+
class NextPage extends StatefulWidget{
|
223
|
+
|
224
|
+
@override
|
225
|
+
Widget build(BuildContext context) {
|
226
|
+
return MaterialApp(
|
227
|
+
theme: ThemeData(
|
228
|
+
primarySwatch: Colors.blue,
|
229
|
+
visualDensity: VisualDensity.adaptivePlatformDensity,
|
230
|
+
),
|
231
|
+
home: NextPage2(),
|
232
|
+
);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
class NextPage2 extends StatefulWidget{
|
237
|
+
NextPage2({this.name});
|
238
|
+
final String name;
|
239
|
+
|
240
|
+
@override
|
241
|
+
Widget build(BuildContext context){
|
242
|
+
return Scaffold(
|
243
|
+
appBar: AppBar(
|
244
|
+
title: Text('確認画面'),
|
245
|
+
),
|
246
|
+
body: Center(
|
247
|
+
child: Column(
|
248
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
249
|
+
children: [
|
250
|
+
Text(name),
|
251
|
+
Text(name),
|
252
|
+
],
|
253
|
+
),
|
254
|
+
),
|
255
|
+
);
|
256
|
+
}
|
257
|
+
}
|
258
|
+
```
|