Created
June 20, 2021 17:03
-
-
Save naimurhasan/6c2668228dd331964276fa4a742446e0 to your computer and use it in GitHub Desktop.
Large ListView - Flutter
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
class LatestResultListView extends StatelessWidget{ | |
final List questions; | |
const LatestResultListView({Key key, this.questions}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return CustomScrollView( | |
slivers: <Widget>[ | |
SliverToBoxAdapter( | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Container( | |
alignment: Alignment.center, | |
height: 60, | |
width: double.infinity, | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(20), | |
color: primaryColor, | |
), | |
child: Text( | |
'${questions.length} টি প্রশ্ন পাওয়া গেছে', | |
style: TextStyle(fontSize: 24, color: Colors.white), | |
), | |
), | |
), | |
), | |
...[ | |
SliverList( | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { | |
return QuestionWidget( | |
showAnswer: true, | |
isSubmitted: true, | |
isPractice: false, | |
queIndex: index, | |
question: questions.elementAt(index), | |
); | |
}, | |
childCount: questions.length, | |
), | |
), | |
] | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment