diff --git a/Gemfile b/Gemfile index 3be9c3cd812e..b1e0ab8856c0 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,6 @@ source "https://rubygems.org" gemspec + +gem "csv", "~> 3.3" + +gem "base64", "~> 0.2.0" diff --git a/_config.yml b/_config.yml index af7d57221b02..47e3864bda6f 100644 --- a/_config.yml +++ b/_config.yml @@ -12,23 +12,24 @@ # theme : "minimal-mistakes-jekyll" # remote_theme : "mmistakes/minimal-mistakes" -minimal_mistakes_skin : "default" # "air", "aqua", "contrast", "dark", "dirt", "neon", "mint", "plum", "sunrise" +minimal_mistakes_skin : "dirt" # "air", "aqua", "contrast", "dark", "dirt", "neon", "mint", "plum", "sunrise" # Site Settings -locale : "en-US" +future : true +locale : "ko-KR" rtl : # true, false (default) # turns direction of the page into right to left for RTL languages -title : "Site Title" -title_separator : "-" -subtitle : # site tagline that appears below site title in masthead -name : "Your Name" -description : "An amazing website." -url : # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" +title : "어제보다 오늘 더 성장합니다." +title_separator : "|" +subtitle : "" +name : "강영미" +description : "안녕하세요! Flutter 앱 개발자가 되고 싶은 강영미입니다. 현재 Flutter 개발을 위한 Dart와 Kotlin을 활용한 Android 앱 개발에 대해 공부 중입니다." +url : "https://youngmi-k.github.io" baseurl : # the subpath of your site, e.g. "/blog" repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png" logo : # path of logo image to display in the masthead, e.g. "/assets/images/88x88.png" masthead_title : # overrides the website title displayed in the masthead, use " " for no title -breadcrumbs : # true, false (default) +breadcrumbs : true # true, false (default) words_per_minute : 200 enable_copy_code_button : # true, false (default) copyright : # "copyright" name, defaults to site.title @@ -113,10 +114,10 @@ analytics: # Site Author author: - name : "Your Name" + name : "강영미" avatar : # path of avatar image, e.g. "/assets/images/bio-photo.jpg" - bio : "I am an **amazing** person." - location : "Somewhere" + bio : "Flutter 개발 공부를 기록하는 블로그입니다." + location : "South Korea" email : links: - label: "Email" @@ -290,16 +291,16 @@ tag_archive: type: liquid path: /tags/ # https://github.com/jekyll/jekyll-archives -# jekyll-archives: -# enabled: -# - categories -# - tags -# layouts: -# category: archive-taxonomy -# tag: archive-taxonomy -# permalinks: -# category: /categories/:name/ -# tag: /tags/:name/ +jekyll-archives: + enabled: + - categories + - tags + layouts: + category: archive-taxonomy + tag: archive-taxonomy + permalinks: + category: /categories/:name/ + tag: /tags/:name/ # HTML Compression @@ -323,3 +324,6 @@ defaults: comments: # true share: true related: true + show_date: true + +date_format: "%Y-%m-%d" diff --git a/_data/navigation.yml b/_data/navigation.yml index 6f30866f3bed..48fd65fa00a5 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -1,7 +1,7 @@ # main links main: - - title: "Quick-Start Guide" - url: https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/ + - title: "Category" + url: /categories/ # - title: "About" # url: https://mmistakes.github.io/minimal-mistakes/about/ # - title: "Sample Posts" diff --git a/_pages/category-archive.md b/_pages/category-archive.md new file mode 100644 index 000000000000..3cd6f6e06761 --- /dev/null +++ b/_pages/category-archive.md @@ -0,0 +1,7 @@ +--- +title: "Category" +layout: categories +permalink: /categories/ +author_profile: true +sidebar_main: true +--- \ No newline at end of file diff --git a/_posts/2025-01-08-Dart_1.md b/_posts/2025-01-08-Dart_1.md new file mode 100644 index 000000000000..be371c0f2b91 --- /dev/null +++ b/_posts/2025-01-08-Dart_1.md @@ -0,0 +1,136 @@ +--- + +layout: single + +title: "Dart의 변수와 타입" + +categories: Dart + +date: 2025-01-08 + +published: true + +--- + + + +안녕하세요. 아직 닉네임을 정하지 못했지만, 저는 Flutter와 Dart언어 공부를 하면서 스스로 헷갈렸던 부분들을 잘 기록해놓고자 블로그를 시작하게 되었습니다. 앞으로 열심히 공부하고 열심히 기록하겠습니다 :) + + + +오늘은 가장 기본적인 **Dart의 변수와 타입**에 대해서 알아보고자 합니다. + + + + + +# 변수와 타입이란 무엇일까요? + +**변수**란 프로그래밍을 할 때 **가장 기본이 되는 단위**로, **특정한 값(데이터)을 담아두는 그릇**이라고 이해하면 쉽습니다. + +그리고 **데이터의 유형**을 **타입**이라고 합니다. + +**기본형** 타입에는 **bool(참/거짓형), int(정수형), double(실수형), String(문자열형), null(Null형)**이 있고, **자료형** 타입에는 **List, Set, Map**이 있습니다. + +```dart +// 참/거짓형 bool +bool isTrue = true; + +// 정수형 int +int num1 = 100; +int num2 = 3.14; // int형 변수에 실수를 할당하면 error 발생 + +// 실수형 double +double num3 = 3.14; +double num4 = 3; // double형 변수에 정수를 할당하면 실수(3.0)로 저장됨 + +// 문자열형 String +String string = 'Hello World'; +String errString = Hello World; //문자열을 큰따옴표("") 혹은 작은따옴표('')로 감싸주지 않으면 error 발생 + +// Null형 null +Null thisIsNull = null; +``` + +**Dart**는 파이썬과 다르게 **변수를 선언 혹은 저장**할 때 `int num = 100;`과 같이 **타입을 정의**해야 합니다. 타입을 정의하지 않고 `num = 100;`과 같이 사용하게 된다면 error가 발생하게 됩니다. + + + + + +# 타입은 꼭 정의 해야 할까요? + +하지만 타입을 반드시 정의할 필요는 없습니다. + +**가변형 타입**인 **var**와 **Dynamic**을 이용하여 타입 정의 없이 변수를 선언할 수 있습니다. + + + +- **var**: **최초** 한번 **부여된 타입**이 **고정**적으로 사용 +- **dynamic**: **타입**이 코드 진행 중에라도 **언제든지 변환 가능** + +```dart +// 가변형 var +var value = 1; // 가변형 var 타입으로 value 변수 선언하고 int형 데이터 1 할당 +value = 2; // 같은 int형 데이터를 할당시 error 발생하지 않음 +value = 'is Error?' // int형이 아닌 다른 타입의 데이터를 할당시 error 발생 + +// 가변형 dynamic +dynamic dynamicValue = 100; // 가변형 dynamic 타입으로 변수 선언 및 int형 데이터 할당 +dynamicValue = 'is not Error?' // 변수 선언시 최초 부여된 타입과 다른 타입의 데이터를 할당해도 error 발생하지 않음 +``` + +하지만 프로그래밍 특성 상, 주고 받는 타입에 대한 정의가 명확해야 추후 코드를 관리하고 다른 사람과 협업하는데 큰 도움이 되기 때문에 **되도록 타입을 명확히 정의해두는 것이 좋습니다** :) + + + + + +# 상수는 어떻게 선언하나요? + +변수는 한번 할당한 값을 여러번 수정할 수 있는 것이 특징입니다. 하지만 프로그래밍을 하다보면 특정한 상황에 할당한 값을 바꾸고 싶지 않은 경우가 있습니다. 그럴 때 변수 대신 상수를 선언하게 됩니다. + +| 변수 | 상수 | +| -------------------------------------- | --------------------------------- | +| 한번 할당한 값을 여러번 수정할 수 있음 | 값을 한번 할당하면 수정할 수 없음 | + +Dart에는 상수를 선언하는 방법이 두가지가 존재합니다. + +- **const**** + - **compile 시점**에 상수 처리 될 경우에 활용 + - compile 시점에 값을 반드시 알 수 있어야 함 + - 런타임에 값을 변경할 수 없음 + - 불변 객체를 정의할 때 주로 사용됩니다. +- **final** + - **프로그램 진행 중**에 상수 처리 될 경우에 활용 + - **런타임에 한 번만 값을 설정**할 수 있습니다. + - compile 시점에 값을 알 필요는 없음 + + + +이때 **const 키워드**를 사용하면 **불변 객체(Immutable Object)를 생성**할 수 있습니다. 불변객체는 객체의 내용이 고정되고 변경되지 않도록 보장합니다. + +```dart +const List numbers = [1, 2, 3]; +// numbers.add(4); // 오류 발생: 불변 리스트이므로 변경 불가 + +final List finalNumbers = [1, 2, 3]; +finalNumbers.add(4); // 가능: final은 참조 자체만 고정, 내부 데이터는 변경 가능 + +print(numbers); // 출력: [1, 2, 3] +print(finalNumbers); // 출력: [1, 2, 3, 4] +``` + + + +------ + + + +오늘은 Dart의 변수와 타입에 대해서 알아보았습니다. 자료형 타입에 대해 설명이 누락된 부분은 추후에 업데이트 할 예정입니다! + +저는 가변형 타입인 var/dynamic 그리고 상수 선언시 사용하는 const/final 키워드가 많이 헷갈려서 오늘 이렇게 블로그에 기록을 남기게 되었습니다. + +앞으로도 헷갈리는 부분들을 오늘처럼 기록하며 다시 복습하고 재학습할 수 있는 유익한 블로그가 될 수 있도록 열심히 하겠습니다! + +감사합니다. \ No newline at end of file diff --git a/images/2025-01-05-first/KakaoTalk_20240216_105820995_01.jpg b/images/2025-01-05-first/KakaoTalk_20240216_105820995_01.jpg new file mode 100644 index 000000000000..b18521fd832f Binary files /dev/null and b/images/2025-01-05-first/KakaoTalk_20240216_105820995_01.jpg differ diff --git a/images/2025-01-05-first/KakaoTalk_20241105_145207980.jpg b/images/2025-01-05-first/KakaoTalk_20241105_145207980.jpg new file mode 100644 index 000000000000..3d39c6fd7012 Binary files /dev/null and b/images/2025-01-05-first/KakaoTalk_20241105_145207980.jpg differ diff --git a/index.html b/index.html index b95bb1f56f4c..9b023163086a 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ --- layout: home author_profile: true ---- +---