Projek Mobile Computing Dengan Flutter ke 23
Coding Pada file main.dart
import 'package:flutter/material.dart';
import '../widget/soal_23.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: Soal23(),
);
}
}
Coding Pada file soal_23.dart
import 'package:flutter/material.dart';
class Soal23 extends StatelessWidget {
const Soal23({
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: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Stack(
alignment: Alignment.center,
children: [
ClipOval(
child: Container(
width: 268,
height: 268,
color: Color(0xFF0D47A1),
),
),
Container(
width: 250,
height: 250,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(250 / 2),
border: Border.all(
color: Colors.white,
width: 5,
),
color: Colors.grey[300],
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage("https://picsum.photos/500/500"),
),
),
),
],
),
SizedBox(height: 50),
Text(
"Hello World",
style: TextStyle(
fontSize: 35,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
decoration: TextDecoration.underline,
),
),
],
),
),
);
}
}
Hasil Running
Post a Comment