Projek Mobile Computing Dengan Flutter ke 02
Coding Pada file main.dart
import 'package:flutter/material.dart';
import '../widget/soal_2.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: Soal2(),
);
}
}
Coding Pada file soal_2.dart
import 'package:flutter/material.dart';
class Soal2 extends StatelessWidget {
const Soal2({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: FlutterLogo(),
title: Text("soal 2"),
centerTitle: false,
actions: [
IconButton(
onPressed: () {
print("KLIK MORE");
},
icon: Icon(Icons.more_vert),
),
],
),
body: Center(
child: Text(
"Hello World",
style: TextStyle(
fontSize: 50,
fontStyle: FontStyle.italic,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
),
),
),
);
}
}
Hasil Running
Post a Comment