π AppBarλ μ± μλ¨μ μμΉνλ λΆλΆμ λ§νλ€. μ£Όλ‘ λ©λ΄ λ²νΌμ΄λ μ λͺ©μ νμνλ μ©λ λ±μΌλ‘ λ§μ΄ μ¬μ©νλ€.
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
Widget build(BuildContext context) {
return MaterialApp(
title: 'my first app',
home: Scaffold(
appBar: AppBar(
centerTitle: true, // title κ°μ΄λ° μ λ ¬
backgroundColor: const Color(0xffc9c9c9), // λ°°κ²½ μ μ§μ
// leading : μ’μΈ‘ μλ¨ Icon μ€μ
leading: IconButton(
icon: const Icon(Icons.menu, color: Colors.black),
onPressed: () {},
),
title: const Text("ν
μ€νΈ", style: TextStyle(color: Colors.black)),
// actions : μ°μΈ‘ μλ¨ Iconλ€ μ€μ
actions: [
IconButton(
icon: Image.asset("assets/smile.png"),
onPressed: () {
// ν΄λ¦ μ΄λ²€νΈ
},
)
],
),
));
}
}