0% found this document useful (0 votes)
17 views

Tugas Pertemuan 4 Mobile Programming

This document contains code for a Flutter application that displays text in rows and columns. It includes the code for the baris_kolom.dart file which contains the widget that builds the rows and columns. It also includes the code for the main.dart file which sets up the MaterialApp and home page.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Tugas Pertemuan 4 Mobile Programming

This document contains code for a Flutter application that displays text in rows and columns. It includes the code for the baris_kolom.dart file which contains the widget that builds the rows and columns. It also includes the code for the main.dart file which sets up the MaterialApp and home page.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

TUGAS PERTEMUAN 4

MOBILE PROGRAMMING

NAMA : Afifah Ibnu Ridwan


NIM : 19221008
NO. ABSEN : 25
KELAS : 19.4A.37

Script baris_kolom.dart
import 'package:flutter/material.dart';

class BarisKolom extends StatelessWidget {


const BarisKolom({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Baris dan Kolom"),
backgroundColor: Colors.yellow,
),
body: Column(
// value ini akan memberikan space atau jarak yang sama baik pada
bagian kiri, kanan, maupun di antara widget.
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
//SizedBox(height: 20), => untuk mengatur batasan ukuran pada widget
anak
Row(
children: [
Text(" Baris 1, kolom 1"),
SizedBox(width: 20),
Text("Baris 1, kolom 2"),
SizedBox(width: 20),
Text("Baris 1, kolom 3"),
],
),
Row(
children: [
Text(" Baris 2, kolom 1"),
SizedBox(width: 20),
Text("Baris 2, kolom 2"),
SizedBox(width: 20),
Text("Baris 2, kolom 3"),
],
),
Row(
children: [
Text(" Baris 3, kolom 1"),
SizedBox(width: 20),
Text("Baris 3, kolom 2"),
SizedBox(width: 20),
Text("Baris 3, kolom 3"),
],
),
Row(
children: [
Text(" Baris 3, kolom 1"),
SizedBox(width: 20),
Text("Baris 3, kolom 2"),
SizedBox(width: 20),
Text("Baris 3, kolom 3"),
],
),
],
),
);
}
}

Script main.dart
import 'package:flutter/material.dart';
import 'package:flutter_application_2/baris_kolom.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {


const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Klinik',
home: BarisKolom(),
);
}
}

Hasil Script

You might also like