Created
January 23, 2022 19:11
-
-
Save EArminjon/30f6aa10bc77f3eac679a483335892e1 to your computer and use it in GitHub Desktop.
ListView insde Listview
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
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class Home extends StatefulWidget { | |
const Home({Key? key}) : super(key: key); | |
@override | |
_HomeState createState() => _HomeState(); | |
} | |
class SimpleBloc extends StatelessWidget { | |
const SimpleBloc({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
alignment: Alignment.center, | |
color: Colors.primaries[Random().nextInt(Colors.primaries.length)], | |
width: double.maxFinite, | |
height: 100, | |
); | |
} | |
} | |
class _HomeState extends State<Home> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: ListView( | |
children: [ | |
const SimpleBloc(), | |
const SimpleBloc(), | |
const SimpleBloc(), | |
Padding( | |
padding: const EdgeInsets.all(16), | |
child: ListView( | |
shrinkWrap: true, | |
children: const [ | |
SimpleBloc(), | |
SimpleBloc(), | |
SimpleBloc(), | |
SimpleBloc(), | |
SimpleBloc(), | |
SimpleBloc(), | |
], | |
), | |
), | |
const SimpleBloc(), | |
const SimpleBloc(), | |
const SimpleBloc(), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment