Skip to content

Instantly share code, notes, and snippets.

@duttk
Created December 12, 2020 02:08
Show Gist options
  • Select an option

  • Save duttk/4a5b1dd26692b8accd2d084329bba200 to your computer and use it in GitHub Desktop.

Select an option

Save duttk/4a5b1dd26692b8accd2d084329bba200 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ListView(
children: [
Container(
height: size.height * 0.5,
child: ListView.separated(
padding: const EdgeInsets.all(8),
itemCount: 3,
itemBuilder: (BuildContext context, int index) {
return Container(
height: 50,
color: Colors.black,
);
},
separatorBuilder: (BuildContext context, int index) =>
const Divider(),
),
),
Column(
children: [
Container(
child: Text(
'Text',
),
),
Container(
height: size.height * 0.5,
child: ListView.separated(
padding: const EdgeInsets.all(8),
itemCount: 3,
itemBuilder: (BuildContext context, int index) {
return Container(
height: 50,
color: Colors.black,
);
},
separatorBuilder: (BuildContext context, int index) =>
const Divider(),
),
),
],
)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment