project 폴더에서 아래와 같이 dart doc 라고 입력을 하면, 프로젝트 밑에 문서가 생성됩니다.
$ dart doc
문서 위치는 아래와 같습니다.
$ ~/[myporject]/doc/api
문서에 설명을 다는 방법은 /// 로 주석을 달아주는 방식입니다.
아래 몇가지 예시를 포함 하였습니다.
/// This is a brief description of the library or package.
library my_library;
/// This is a brief description of the MyClass class.////// Optionally, additional details about the class can be provided.classMyClass{
/// This is a constructor for MyClass.
MyClass();
}
/// This is a brief description of the function.////// It takes [param1] and [param2] as parameters and returns a String.StringmyFunction(int param1, String param2) {
// …
}
/// This is a brief description of the field.
int myField;
/// This is a brief description of the function.////// It takes [param1] and [param2] as parameters and returns a String.////// Additional details can be added, including:/// - List items/// - [Links to other elements]/// - _Italic_ or **bold** text.StringmyFunction(int param1, String param2) {
// …
}
/// This is a brief description of the function.////// It takes [param1] and [param2] as parameters and returns a String.////// - `param1`: Description of parameter 1./// - `param2`: Description of parameter 2.////// Returns a String representing the result.StringmyFunction(int param1, String param2) {
// …
}
/// This is a brief description of the MyEnum enum.
enum MyEnum {
/// Description of EnumValue1.
EnumValue1,
/// Description of EnumValue2.
EnumValue2,
}
/// Represents a user in the system.classUser{
// …
}
/// Returns the sum of two integers.////// Example:/// ```dart/// int result = add(2, 3); // result will be 5/// ```
int add(int a, int b) {
return a + b;
}
/// Calculates the area of a rectangle.////// [length]: Length of the rectangle./// [width]: Width of the rectangle.////// Returns the area as a double.
double calculateArea(double length, double width) {
return length * width;
}
/// Finds the maximum value in the given list.////// [numbers]: List of integers.////// Returns the maximum value in the list. Returns null if the list is empty.////// Throws [ArgumentError] if [numbers] is null.
int? findMax(List<int> numbers) {
// Implementation
}
/// Represents a configuration for the application.////// See {@link User} for user-related settings.////// For more details, visit the {@linkplain <https://example.com/docs}> documentation.classAppConfig{
// ...
}
이 애플리케이션은 "아내가 집에서 입는 옷을 어떻게 하면 쉽게 관리하고 매칭해서 입을까?"라는 질문에서 시작했습니다.
처음 아이디어가 나왔을때는, "사진찍어서 바로 올리고", "계절별 매칭도 해주고", "집에 있는 옷장이 한눈에 보이고" 듣기에 그럴듯해보이는 것 같았습니다. 프로젝트를 구상하기 시작한지 몇일 지나자 초기의 옷 정리를 위한 앱의 정체성과 니즈에 대해서 복잡한 고민을 하기 시작했습니다. "사진을 찍어봤는데 별로 안이쁜데?", "옷 매칭을 하려면 옷을 잘 찍어놔야하고 또 배경도 없애고, 모델도 필요한거 아닌가?", "옷을 종류별 계절별로 나눠보니 몇벌 안나오네?" 등등등... 뭔가 상상과 현실이 안맞는 그런 상황에서의 고민이었죠.
그러다 그 시점에 Chat GPT가 뜨면서 Chat GPT 앱이 되어버렸습니다. (^^;; 역시 제대로 된 기획이 없으니 산으로 가는.. 쿨럭)
그래서 이런 애플리케이션이 되었습니다.
Dali-E 같은 경우는 원래 영어로 입력해야 이미지를 만들어주는데, 좀 불편해서 한글을 영어로 자동 번역해서 처리되도록 해봤습니다.
그리고 2024년을 기념하여, 새해 계획들을 많이 세우는데 사실 실천이 어렵죠... 와이프의 생활패턴을 보니 계획 실천하는데 매일 Todo를 적고 하나씩 해나가는 것이 좀 인상적이었습니다. (본인은 잊어먹지 않고 하려고 적는다고 한다고 하는데, 나이가 들고 보니 무척 좋은 습관인 것 같네요.)
한동안 따로 개선하지 않다가 드디어 할 일?? 이 생겼습니다. ^^ 아무튼 저는 개발자이니 이것을 개발자스럽게 해결해 보고자 앱에 TODO 기능을 넣었습니다.
짜잔.
날짜 별로 할 일을 추가할 수 있습니다. 운동이나 약 먹기 같은 매일 하고자 하는 루틴의 경우에는 매일 할 일을 체크 해두면 매일 해야 할 일로 나옵니다. 그리고 할 일을 일정시간 동안 투자 해야 하는 경우라면 간혹 타이머가 필요한데, 그래서 타이머를 이렇게 만들어 놨습니다.
이렇게 해서 간단한 할 일 기능이 추가되었답니다. + 사용하다 보니, 이전할 일들 중에서 아직 완료하지 못한 것들을 어떻게 표현하면 좋을까? 고민하고 있는데 했는데 무작정 이전에 완료 안된 일들을 남겨 놓는 것도 아닌 것 같고, 이 부분은 좀 아이디어를 찾아봐야 할 것 같습니다.
animated_text_kit : intro(splash) 쪽이 너무 밋밋하여 뭔가 포인트를 주기 위해서 이용했습니다. - 생각보다 이쁘게 나와서 chat에서 waiting시에... 에 대한 animation에도 사용했는데요. 높이 조절이 잘 안 되고 너무 튀어서 customizing을 따로 했습니다.
objectbox: todo를 추가하다 보니 database가 필요해져서 nosql로 간단하게 사용할 것을 찾다가 이를 이용했습니다. - 설명에는 경량이고 추후 cloud sync 연동도 가능하다고 되어있어서 사용해 보게 되었습니다.
package_info_plus: package version 정보를 보여주기 위해서 사용 flex_color_scheme: 유튜브에서 theme을 쉽게 사용할 수 있다고 하여 한번 사용해 봤습니다. - 생각보다 이쁘게 안 나와서 실망 ㅠ_ㅠ , 역시 디자이너의 손길이 필요합니다. upgrader: 스토어에 최신 버전이 있는지를 확인할 수 있는 기능이 필요해서 사용하였습니다. - 기능상으로 보면, google play store가 아니라 개인 서버에 package 정보를 올려서 사용할 수 도 있다고 되어있습니다. - 나중에 store에 올리지 않고 webstite에서 관리를 하려면 이를 이용하는 것도 좋은 방법일 것 같더군요.
플러터로 android 용 앱을 개발하다가 앱이 좀 괜찮으면 iOS로 확장하고 싶은 욕구가 생기겠죠?
그런데 처음부터 iOS를 염두해두고 프로젝트를 만들지 않았다면, 확장을 어떻게 해야 하나 할겁니다.
간단하게 확장하는 방법 정리 해봤습니다.
먼저 빌드할 플랫폼을 선택합니다.
terminal에서 다음과 같이 입력하면 되는데요.
$ flutter config --enable-<platform>
ios 의 경우에는 flutter config --enable-ios 라고 입력 합니다.
그리고 나서 프로젝트를 재 생성 합니다.
$ flutter create .
을 입력하면 다시 프로젝트가 재 생성됩니다.
사용 예 )
~/$ flutter config --enable-ios
Setting"enable-ios" value to "true".
You may need to restart any open editors for them to read new settings.
~/github/arbot_care (karzia)$ flutter create .
⣟Recreating project ....
windows/runner/flutter_window.cpp (created)
windows/runner/utils.h (created)
windows/runner/utils.cpp (created)
windows/runner/runner.exe.manifest (created)
windows/runner/CMakeLists.txt (created)
windows/runner/win32_window.h (created)
windows/runner/Runner.rc (created)
windows/runner/win32_window.cpp (created)
windows/runner/resources/app_icon.ico (created)
windows/runner/main.cpp (created)
windows/runner/resource.h (created)
windows/runner/flutter_window.h (created)
windows/flutter/CMakeLists.txt (created)
windows/.gitignore (created)
windows/CMakeLists.txt (created)
arbot_care.iml (created)
web/favicon.png (created)
web/index.html (created)
web/manifest.json (created)
web/icons/Icon-maskable-512.png (created)
web/icons/Icon-192.png (created)
web/icons/Icon-maskable-192.png (created)
web/icons/Icon-512.png (created)
android/app/src/main/res/mipmap-mdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-hdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (created)
android/app/src/main/kotlin/io/netplant/arbot_care/MainActivity.kt (created)
android/arbot_care_android.iml (created)
ios/RunnerTests/RunnerTests.swift (created)
.idea/runConfigurations/main_dart.xml (created)
.idea/libraries/KotlinJavaRuntime.xml (created)
linux/main.cc (created)
linux/my_application.h (created)
linux/my_application.cc (created)
linux/flutter/CMakeLists.txt (created)
linux/.gitignore (created)
linux/CMakeLists.txt (created)
Resolving dependencies...Got dependencies.
Wrote42 files.
All done!You can find general documentation forFlutter at: https://docs.flutter.dev/DetailedAPI documentation is available at: https://api.flutter.dev/If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev
참고로 지원 되는 플랫폼 목록은 다음과 같습니다.
--enable-web
Enable Flutter for web. This setting will take effect on the master, dev, beta, and stable channels
--no-enable-web
Disable Flutter for web. This setting will take effect on the master, dev, beta, and stable channels
--enable-linux-desktop
Enable beta-quality support for desktop on Linux. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--no-enable-linux-desktop
Disable beta-quality support for desktop on Linux. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--enable-macos-desktop
Enable beta-quality support for desktop on macOS. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--no-enable-macos-desktop
Disable beta-quality support for desktop on macOS. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--enable-windows-desktop
Enable beta-quality support for desktop on Windows. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--no-enable-windows-desktop
Disable beta-quality support for desktop on Windows. This setting will take effect on the master, dev, beta, and stable channels. Newer beta versions are available on the beta channel
--enable-android
Enable Flutter for Android. This setting will take effect on the master, dev, beta, and stable channels
--no-enable-android
Disable Flutter for Android. This setting will take effect on the master, dev, beta, and stable channels
--enable-ios
Enable Flutter for iOS. This setting will take effect on the master, dev, beta, and stable channels
--no-enable-ios
Disable Flutter for iOS. This setting will take effect on the master, dev, beta, and stable channels
--enable-fuchsia
Enable Flutter for Fuchsia. This setting will take effect on the master channel
--no-enable-fuchsia
Disable Flutter for Fuchsia. This setting will take effect on the master channel
enable 시킬때는 --enable-<platform> 을 사용하고 disable 시킬때는 --no-enable-<platform> 을 이용합니다.