Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(const MyApp());
- }
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Quiz UI Flutter',
- theme: ThemeData(
- colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
- useMaterial3: true,
- ),
- home: const MyHomePage(title: 'Quiz UI Flutter'),
- );
- }
- }
- class MyHomePage extends StatefulWidget {
- const MyHomePage({super.key, required this.title});
- final String title;
- @override
- State<MyHomePage> createState() => _MyHomePageState();
- }
- class _MyHomePageState extends State<MyHomePage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- title: Text(widget.title),
- ),
- body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- children: <Widget>[
- const Text(
- 'Nomor Kelompok: [isi no kelompok]',
- ),
- const Text(
- 'Mhs 1: [isi nim, nama]',
- ),
- const Text(
- 'Mhs 2: [isi nim, nama]',
- ),
- Container(
- margin: const EdgeInsets.all(10),
- child: ElevatedButton(
- onPressed: () {
- Navigator.of(context)
- .push(MaterialPageRoute(builder: (context) {
- return soalNo1();
- }));
- },
- child: const Text(' Jawaban No 1 '),
- ),
- ),
- Container(
- margin: const EdgeInsets.all(10),
- child: ElevatedButton(
- onPressed: () {
- Navigator.of(context)
- .push(MaterialPageRoute(builder: (context) {
- return soalNo2();
- }));
- },
- child: const Text(' Jawaban No 2 '),
- ),
- ),
- ],
- ),
- ),
- );
- }
- //jaawaban no 1
- Widget soalNo1() {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- ),
- body: const Text("ini jawaban no 1"));
- }
- //jaawaban no 2
- Widget soalNo2() {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- ),
- body: const Text("ini jawaban no 2"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement