일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- flutter
- file
- Cow
- create
- scaffold
- widget
- vm
- Flutter
- stack growth
- Copy-on-write
- materialapp
- icon button
- pintos
- System call
- BFS
- algorithm
- Today
- Total
목록Flutter (9)
JunHyeok

간단한 Future 예제void main() { print('Before Future'); Future(() { print('running the future'); }).then((_) { print('future is complete'); }); print('after future');} 결괏값Before Futureafter futurerunning the futurefuture is complete 위처럼, Future는 순차적으로 진행되지 않으며, Event Queue 에서 선입 선출로 실행됩니다. Async method메서드를 통해서 나오는 결과들은 future 가 됩니다.await 키워드를 만날때까지 synchronous 방식으로 동작합니다.await 키워드를 만나면, ..

전체 코드 import 'dart:io'; void main() { showData(); } void showData() async { startTask(); String account = await accessData(); fetchData(account); }void startTask() { String info1 = "요청 수행 시작"; print(info1);}Future accessData() async { String account = "3000원"; Duration time = Duration(seconds: 3); if(time.inSeconds > 2) { await Future.delayed(time, (){ account = "700..

로그인 페이지 위와 같이 간단한 로그인 페이지를 만든다고 가정합시다. 해당 버튼을 모두 하나씩 만든다면 유지보수가 어렵겠죠? 따라서, 위와 같이 MyButton 클래스를 만들어 줍니다. _ 언더바를 사용한다는 것 Flutter에서 위와 같이 언더바를 넣는다면, private 하게 선언하는 것 과 같습니다. 즉 해당 파일 내에서만 사용 가능합니다. MyButton class MyButton extends StatelessWidget { const MyButton({super.key, required this.image, required this.text, required this.color, required this.radius, required this.onPressed}); ..

MaterialApp의 initialRoute 와 routes 속성에 주목해보자.class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( // title: 'Multiple Screen', // theme: ThemeData(primarySwatch: Colors.red), initialRoute: "/", routes: { '/' : (_) => screenA(), '/b' : (_) => screenB(), '/c' : (_) => screen..

App bar icon buttonleading : 아이콘 버튼이나 간단한 위젯을 왼쪽에 배치할 때 사용되는 속성!actions : 복수의 아이콘 버튼 등을 오른쪽에 배치할 때onPressed : 함수의 형태로 일반 버튼이나 아이콘 버튼을 터치했을 때 일어나는 이벤트를 정의함. (즉, 함수다!)

MyApp (MaterialApp)class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( debugShowCheckedModeBanner: false, title: "BBRANTO", home: Grade(), ); }} MaterialApp 1. 앱의 진입점:앱 실행의 시작점 역할을 합니다.runApp() 함수를 통해 앱의 루트 위젯으로 설정됩니다.2. 앱 설정:앱 제목 (title) 설정기본 테마 (theme) 설정 (색상, 글꼴 등)앱의 루트 페이지 (home) 설..

body: Padding(...) Body에 Padding을 주고, padding 속성에 EdgeInsets.fromLTRB(0.0,0.0,0.0,0.0) 을 넣으면 위와 같이 UI가 배치됩니다! Column의 mainAxisAlignment 속성을 : MainAxisAlignment.center 로 설정하면 위와 같이 중앙에 위치하며, padding 값을 조절하여 추가적인 UI 변경을 할 수 있습니다. Center body의 속성을 Center로 설정하고 mainAxisAlignment 속성을 주지 않으면 위와 같이 Center로 정렬 됩니다. body의 속성을 Center로 설정하고 MainAxisAlignment.center 로 설정하면 위와 같이 가로 및 세로가 중앙으로 정렬 됩..

플러터 시작하기. 가장 중요한 main.dart! 새로운 Flutter 프로젝트를 생성하면, 기본적으로 버튼을 클릭하면 Counting을 올려주는 앱 코드가 작성되어 있다. 이 것을 모두 삭제하고 차근차근 나아가보자! import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: "Hello World", theme: ThemeData( primary..

Flutter에서의 Widget 이란? Flutter 에서는 모든것이 Widget으로 이루어져 있답니다!🛋️ Widget 🐦Widget은 Flutter 애플리케이션의 기본 구성 요소입니다.모든 것이 Widget으로 표현됩니다: 버튼, 텍스트, 레이아웃 등.주요 특징계층 구조Widget은 트리 구조로 구성됩니다.부모 Widget은 자식 Widget을 포함할 수 있습니다.Flutter는 이 Widget 트리를 사용해 UI를 그립니다.불변성대부분의 Widget은 불변(immutable)입니다.상태 변화가 필요할 때는 새로운 Widget을 생성합니다.두 가지 유형StatelessWidget: 상태가 없는 위젯. 변경되지 않는 고정된 UI를 나타냅니다.StatefulWidget: 상태가 있는 위젯. 내부 상태..