본문 바로가기

전체 글

(14)
Flutter-text위젯 Text widget 말 그래로 화면에 text를 보여주는 위젯이다 여러 가지 속성들이 있는데 text 위젯으로 들어가면 사용할 수 있는 속성들이 아래 사진처럼 보인다 너무 속성들이 다양해서 대체적으로 많이 쓰이는 속성 몇가지만 써본다 style 폰트 사이즈, 색상, 폰트, 등등 text의 스타일을 적용 스타일에도 여러가지 속성이 있으니 들어가서 확인하고 써준다 폰트 적용 https://cpcp127-app-dev.tistory.com/6 Flutter - fontFamily 적용 text위젯에서 기본 폰트가 아닌 다른 custom 폰트를 사용하고 싶을땐 textStyle의 속성인 fontFamily를 사용한다 적용하는 법을 알아보자 1. 폰트 다운로드 https://noonnu.cc/ 눈누 - 상업용 ..
Flutter StatelessWidget , StatefulWidget StatelessWidget 말 그대로 상태가 없는 위젯 클래스다 먼저 sample앱에서 카운터 앱을 보여주는 MyHomePage를 stateless로 바꿔서 예제로 본다 class MyHomePage extends StatelessWidget { int count = 0; MyHomePage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text( 'You have pushed the button this many ti..
Flutter sample 앱 분석(counter app) import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); //앱 처음 시작시 아래의 StatelessWidget인 MyApp을 run 한다는 것 } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( //앱의 테마 데이터 //지금은 색생만 기본 색상이 blue로 설정 //다른 색깔로 바꿔서 hot reload 해보자 primarySwatch: ..