Projek Mobile Computing Dengan Flutter ke 21
Coding Pada file main.dart
import 'package:flutter/material.dart';
import '../widget/soal_21.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: Soal21(),
);
}
}
Coding Pada file soal_21.dart
import 'package:flutter/material.dart';
class Soal21 extends StatelessWidget {
const Soal21({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: FlutterLogo(),
title: Text("Text Judul"),
centerTitle: false,
actions: [
IconButton(
onPressed: () {
print("KLIK MORE");
},
icon: Icon(Icons.more_vert),
),
],
),
body: Center(
child: Stack(
alignment: Alignment.center,
children: [
Container(
width: 250,
height: 250,
color: Colors.green,
),
Container(
width: 225,
height: 225,
color: Colors.red,
),
Container(
width: 200,
height: 200,
color: Colors.purple,
),
Container(
width: 175,
height: 175,
color: Colors.amber,
),
Container(
width: 150,
height: 150,
color: Colors.blue,
),
],
),
),
);
}
}
Hasil Running
Post a Comment