Tugas Pertemuan 4 Mobile Programming
Tugas Pertemuan 4 Mobile Programming
MOBILE PROGRAMMING
Script baris_kolom.dart
import 'package:flutter/material.dart';
@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());
}
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Klinik',
home: BarisKolom(),
);
}
}
Hasil Script