Skip to content

Instantly share code, notes, and snippets.

@naimurhasan
Created June 20, 2021 17:03
Show Gist options
  • Save naimurhasan/6c2668228dd331964276fa4a742446e0 to your computer and use it in GitHub Desktop.
Save naimurhasan/6c2668228dd331964276fa4a742446e0 to your computer and use it in GitHub Desktop.
Large ListView - Flutter
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