I have developed an app in which users will enter text in text field. These text fields are located under the class HomeScreen(homescreen.dart);
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue)
),
labelText: 'EMO Sicil No',
prefixIcon: const Icon(Icons.person, color: Colors.blue,),
hintText: "EMO Sicil No Giriniz",
),
),
),
I will use controller here. But I want to use the value of Emo Sicil No under Uploader class inside DocUpload.dart
class Uploader extends StatefulWidget {
final File file;
Uploader({Key key, this.file}) : super(key: key);
createState() => _UploaderState();
}
class _UploaderState extends State<Uploader> {
final FirebaseStorage _storage =
FirebaseStorage(storageBucket: 'gs://emo-is0.appspot.com');
StorageUploadTask _uploadTask;
_startUpload() async {
String filePath = 'foyler/${DateTime.now()}.png';
// I want to use Emo Sicil No here. The structure of the filePath will be ;
String filePath = 'emosicilno/foyler/${DateTime.now()}.png';
This emo sicil no will come from texfield under homescreen.dart
StorageUploadTask _uploadTask =
_storage.ref().child(filePath).putFile(widget.file);
I am not sure how I can handle such. I need to get the value of text field inside homescreen.dart and use this inside docupload.dart class uploader
Please advice!