Projek Mobile Computing Dengan Flutter ke 07
Coding Pada file main.dart
import 'package:flutter/material.dart';
import '../widget/soal_7.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: Soal7(),
);
}
}
Coding Pada file soal_7.dart
import 'package:flutter/material.dart';
class Soal7 extends StatelessWidget {
const Soal7({
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: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width: 150,
height: 150,
color: Colors.blue,
child: Center(
child: Text(
"Hello",
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
),
SizedBox(width: 20),
Container(
width: 150,
height: 150,
color: Colors.amber,
child: Center(
child: Text(
"Hello",
style: TextStyle(
fontSize: 25,
color: Colors.black,
),
),
),
)
],
),
);
}
}
Hasil Running
Post a Comment