Skip to content

Instantly share code, notes, and snippets.

@cristianfb1989
Created February 26, 2020 13:50
Show Gist options
  • Save cristianfb1989/d3d62d83e01058e9f89f6158d9177feb to your computer and use it in GitHub Desktop.
Save cristianfb1989/d3d62d83e01058e9f89f6158d9177feb to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class ListFirstPage extends StatefulWidget {
@override
_ListFirstPageState createState() => _ListFirstPageState();
}
class _ListFirstPageState extends State<ListFirstPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('First Page'),
),
body: Column(
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ListSecondPage()));
},
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
side: BorderSide(color: Colors.black, width: 2)),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * .1,
child: Center(
child: Text('List 1',
style: TextStyle(fontSize: 28, color: Colors.black)),
),
),
),
),
GestureDetector(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ListSecondPage()));
},
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
side: BorderSide(color: Colors.black, width: 2)),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * .1,
child: Center(
child: Text('List 2',
style: TextStyle(fontSize: 28, color: Colors.black)),
),
),
),
),
GestureDetector(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ListSecondPage()));
},
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
side: BorderSide(color: Colors.black, width: 2)),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * .1,
child: Center(
child: Text('List 3',
style: TextStyle(fontSize: 28, color: Colors.black)),
),
),
),
),
],
),
);
}
}
class ListSecondPage extends StatefulWidget {
@override
_ListSecondPageState createState() => _ListSecondPageState();
}
class _ListSecondPageState extends State<ListSecondPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Second Page'),
),
body: Column(
children: <Widget>[
Expanded(
child: SizedBox(
height: 500,
child: ListView(
children: <Widget>[
Center(
child: Text('List 1'),
),
ListTile(
title: Text('Item 1'),
),
ListTile(
title: Text('Item 2'),
)
],
)),
),
Expanded(
child: SizedBox(
height: 500,
child: ListView(
children: <Widget>[
Center(
child: Text('List 2'),
),
ListTile(
title: Text('Item 3'),
),
ListTile(
title: Text('Item 4'),
)
],
)),
),
Expanded(
child: SizedBox(
height: 500,
child: ListView(
children: <Widget>[
Center(
child: Text('List 3'),
),
ListTile(
title: Text('Item 5'),
),
ListTile(
title: Text('Item 6'),
)
],
)),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment