Created
December 28, 2020 18:29
-
-
Save azamsharp/1e9192202800f166fb8becfa847816ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text("Flutter Ratings Widget Demo")), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
Rating((rating) { | |
setState(() { | |
_rating = rating; | |
}); | |
}, 5), | |
SizedBox( | |
height: 44, | |
child: (_rating != null && _rating != 0) | |
? Text("You selected $_rating rating", | |
style: TextStyle(fontSize: 18)) | |
: SizedBox.shrink()) | |
], | |
), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment