Created
June 6, 2020 07:07
-
-
Save ashishrawat2911/4892e72602204c34fade8b874ca15ede to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamBuilder<Result<List<Prediction>>>( | |
stream: placePredictionSearchBloc.streamController.stream, | |
initialData: Result.idle(), | |
builder: (BuildContext context, | |
AsyncSnapshot<Result<List<Prediction>>> snapshot) { | |
return snapshot.data.when(idle: () { | |
return Container(); | |
}, loading: () { | |
return CircularProgressIndicator(); | |
}, success: (List<AutocompletePrediction> value) { | |
return ListView.builder( | |
shrinkWrap: true, | |
itemCount: value.length, | |
physics: NeverScrollableScrollPhysics(), | |
itemBuilder: (BuildContext context, int index) { | |
return Text( | |
"${value[index].description}", | |
style: TextStyle( | |
fontSize: 16, | |
color: AppColors.color20203E, | |
), | |
); | |
}, | |
); | |
}, failure: (String reason) { | |
return Text(reason); | |
}); | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment