Created
April 12, 2022 03:42
-
-
Save triyono777/56346ebec6fb81aafc6b464f4b6c2321 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
import 'package:projek_kel_1/counter_screen.dart'; | |
import 'package:projek_kel_1/home_screen.dart'; | |
class ListScreen extends StatefulWidget { | |
const ListScreen({Key? key}) : super(key: key); | |
@override | |
State<ListScreen> createState() => _ListScreenState(); | |
} | |
class _ListScreenState extends State<ListScreen> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('List Screen'), | |
), | |
body: ListView( | |
children: [ | |
GestureDetector( | |
onTap: () { | |
Navigator.of(context).push( | |
MaterialPageRoute(builder: (_) => HomeScreen()), | |
); | |
}, | |
child: Card( | |
child: ListTile( | |
title: Text('Home Screen'), | |
), | |
), | |
), | |
GestureDetector( | |
onTap: () { | |
Navigator.of(context).push( | |
MaterialPageRoute(builder: (_) => CounterScreen()), | |
); | |
}, | |
child: Card( | |
child: ListTile( | |
title: Text('Counter Screen'), | |
), | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment