화면 배율 정하기
container로 바로 정할 수 없다.
Flexiable 속성을 이용해야한다.
children:[
Flexible(child: Container(color: Colors.blue,),flex: 2,), //배수로
Flexible(child: Container(color: Colors.lightGreen,),flex: ,),
],
그리고 숙제 다시해보기
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(actions: [Icon(Icons.search),Icon(Icons.menu),Icon(Icons.doorbell),],
title: Text("별내동3로" , style: TextStyle(fontWeight:FontWeight.w600) ),
backgroundColor : Colors.white,
foregroundColor: Colors.black,
leading: IconButton(
icon: Icon(Icons.arrow_drop_down_circle_outlined),
onPressed: () {
print('menu button is clicked');
}
),
), //상단바의 텍스트
body: Container(padding: EdgeInsets.all(10), height: 210,decoration: BoxDecoration(border: Border.all(color:Colors.black12)),
child:Row(
children:[
//사진
Container( margin: EdgeInsets.all(10) ,child: Image.asset("subin.jpg", )),
//오른쪽
Container(
width: 400,
margin: EdgeInsets.all(5) ,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("별내동의 명물!",style: TextStyle(fontSize: 20),),
Row(
children : [
Text("\n별내동" ,)]
),
Text("\n\n10,000,000,000원\n" ,),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(Icons.favorite),
Text('4'),
Text(' '),
Icon(Icons.visibility_rounded),
Text('128'),
],
)
],),
)],),
)
)
);
}
}
listview
body: ListView(
children: [
Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'), Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'),
Text('안녕'), Text('안녕'), Text('안녕'),
Text('안녕'),
Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'),
Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'), Text('안녕'),
'앱개발 > flutter' 카테고리의 다른 글
flutter 공부 4일차 (코딩쉐프 순한 맛 강좌 8 ~) (0) | 2022.04.15 |
---|---|
flutter 공부 2일차(코딩애플 : 쉬운 플러터 4강까지) (0) | 2022.04.06 |
플러터 독학 1일차 (0) | 2022.04.05 |
flutter 플러터 다운로드 및 초기설정 (0) | 2022.04.04 |