-
[Flutter]
위젯 4개
- 글자위젯: Text('')
- 이미지위젯: Image.asset('이미지 경로')
- 아이콘위젯: Icon(Icons.아이콘이름)
- 박스위젯: Container( width: , height: , color: Colors. )
위젯 안에 위젯 넣기:
위젯( child: 위젯() )
ex) home: Center(
child: Container( width: 50, height: 50, color: Colors.blue ),
)
Scaffold, Icon위젯 등 연습해보기
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('앱임') ), body: Text('안녕'), bottomNavigationBar: BottomAppBar( child: SizedBox( height: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Icon(Icons.phone), Icon(Icons.message), Icon(Icons.contact_page), ], ), ), ), ) ); } }