Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class _ReviewChangesScreenState extends State<ReviewChangesScreen> {
- final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
- final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
- DocumentSnapshot job;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- key: _scaffoldKey,
- appBar: AppBar(
- title: Text('Review Changes'),
- ),
- body: Column(children: <Widget>[
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: Form(
- key: _formKey,
- child: StreamBuilder(
- stream: Firestore.instance.collection('jobs').snapshots(),
- builder: (BuildContext context,
- AsyncSnapshot<QuerySnapshot> snapshot) {
- if (!snapshot.hasData) return new Text('Loading...');
- return new DropdownButton(
- value: job,
- onChanged: (val) {
- setState(() {
- job = val;
- });
- },
- items: snapshot.data.documents
- .map<DropdownMenuItem<DocumentSnapshot>>(
- (DocumentSnapshot document) {
- return new DropdownMenuItem<DocumentSnapshot>(
- child: Text(document.data['jobCode']),
- value: document,
- );
- }).toList(),
- );
- },
- )),
- ),
- ]));
- }
- }
- I/flutter ( 7320): The following assertion was thrown building StreamBuilder<QuerySnapshot>(dirty, state:
- I/flutter ( 7320): _StreamBuilderBaseState<QuerySnapshot, AsyncSnapshot<QuerySnapshot>>#22b54):
- I/flutter ( 7320): 'package:flutter/src/material/dropdown.dart': Failed assertion: line 609 pos 15: 'items == null ||
- I/flutter ( 7320): items.isEmpty || value == null || items.where((DropdownMenuItem<T> item) => item.value ==
- I/flutter ( 7320): value).length == 1': is not true.
- Doctor summary (to see all details, run flutter doctor -v):
- [√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.529],
- locale en-CA)
- [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
- [√] Android Studio (version 3.3)
- [√] Connected device (1 available)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement