Projek Mobile Computing Dengan Flutter ke 25
Coding Pada file main.dart
import 'package:flutter/material.dart';
import '../widget/soal_25.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(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
canvasColor: Colors.white,
),
home: Soal25(),
);
}
}
Coding Pada file soal_25.dart
import 'package:flutter/material.dart';
class Soal25 extends StatefulWidget {
const Soal25({Key? key}) : super(key: key);
@override
State<Soal25> createState() => _Soal25State();
}
class _Soal25State extends State<Soal25> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.black,
leading: Icon(Icons.person_2_rounded),
title: Text("Abdul Aziz Nurhakim"),
centerTitle: false,
actions: [
IconButton(
onPressed: () {
print("KLIK MORE");
},
icon: Icon(Icons.arrow_back_ios_new_outlined),
),
],
),
body: Container(
color: Colors.white, // Mengubah warna latar belakang menjadi putih
child: SingleChildScrollView(
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 150,
height: 150,
color: Colors.red,
child: Center(
child: Text(
"1",
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
),
SizedBox(width: 16),
Container(
width: 150,
height: 150,
color: Colors.green,
child: Center(
child: Text(
"2",
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
),
],
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 150,
height: 150,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(90),
),
child: Center(
child: Text(
"3",
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
),
SizedBox(width: 16),
Container(
width: 150,
height: 90,
decoration: BoxDecoration(
color: Colors.yellow,
borderRadius: BorderRadius.circular(40),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.5),
offset: Offset(0, 2),
blurRadius: 4,
),
],
),
child: Center(
child: Text(
"4",
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
),
],
)
],
),
),
),
);
}
}
Hasil Running
Post a Comment