๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

๐Ÿ“ฑMobile21

[Swift] SwiftUI Push Notifications(FCM) APN(APNS) ํ‘ธ์‰ฌ์•Œ๋ฆผ ์˜ˆ์ œ Firebase Cloud Messaging/Google Cloud Messaging(FMC/GCM) Google Cloud Messaging(GCM)์ด Firebase Cloud Messaging(FCM)์œผ๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ๋‹ค. 2021๋…„๋ถ€ํ„ฐ ๋ฌด๋ฃŒ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Android, iOS ๋ฐ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์šฉ ๋ฉ”์‹œ์ง€ ๋ฐ ์•Œ๋ฆผ์„ ์œ„ํ•œ ํฌ๋กœ์Šค ํ”Œ๋žซํผ ํด๋ผ์šฐ๋“œ ์†”๋ฃจ์…˜ APN/APNS(Apple Push Notification/Apple Push Notification Service) ํƒ€์‚ฌ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ๊ฐœ๋ฐœ์ž๊ฐ€ Apple ์žฅ์น˜์— ์„ค์น˜๋œ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์œผ๋กœ ์•Œ๋ฆผ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋„๋ก Apple ์—์„œ ๋งŒ๋“  ํ”Œ๋žซํผ ์•Œ๋ฆผ์„œ๋น„์Šค APNs์—์„œ ๋””๋ฐ”์ด์Šค๋กœ ๋ณด๋‚ด๊ธฐ ์›ํ•˜๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›๊ณ , ์ด๊ณณ์—์„œ ๋ฉ”์‹œ์ง€์˜ ์‹ ๋ขฐ๋„๋ฅผ ๊ฒ€์‚ฌํ•ด์„œ d.. 2023. 7. 9.
[Flutter] ํ”Œ๋Ÿฌํ„ฐ http GET, POST ์‚ฌ์šฉํ•˜๊ธฐ, ์š”์ฒญ(Request), ์‘๋‹ต(Response) project/pubspec.yaml http: 0.12.2 ์ถ”๊ฐ€ํ•œ๋‹ค. dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.3 http: 0.12.2//add dev_dependencies: flutter_test: sdk: flutter Session ์ œ์–ด๋ฅผ ์œ„ํ•ด ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค๊ณ  ๊ทธ ์•ˆ์—์„œ ํ—ค๋” ์ฟ ํ‚ค ๋“ฑ ์…‹ํŒ…, ๋ฆฌ์Šคํฐ์Šค์˜ ์‘๋‹ต์„ ๊ฐ ์ƒํƒœ์ฝ”๋“œ์— ๋”ฐ๋ผ์„œ ์–ผ๋Ÿฟ์„ ๋„์šฐ๋Š” ๋“ฑ์˜ ์ž‘์—…๋ถ„๊ธฐ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. Session ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•œ๋‹ค. impor.. 2023. 7. 4.
[Swift] SwiftUI Infinite ScrollView ๋ฌดํ•œ์Šคํฌ๋กค๋ทฐ ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€๋กœ๋“œ trainingApp.swift import SwiftUI @main struct trainingApp: App { var body: some Scene { WindowGroup { ContentView() } } } ContentView.swift import SwiftUI struct ContentView: View { @State var current: Int = 0 @State var maxCnt: Int = 0 @State var itemList: [ItemModel] = [] @State var hasMorePages:Bool = true var body: some View { GeometryReader { geometry in let columns: [GridItem] = [GridItem(.. 2021. 11. 1.
[Swift] SwiftUI TabView(bottom navigation bar) + SideMenubar ์˜ˆ์ œ trainingApp.swift import SwiftUI @main struct trainingApp: App { var body: some Scene { WindowGroup { ContentView() } } } ContentView.swift import SwiftUI struct ContentView: View { @State var showMenu = false var body: some View { ZStack{ GeometryReader { geometry in let width = geometry.size.width let height = geometry.size.height if self.showMenu { MenuView() .frame(width: width / 1.5) .trans.. 2021. 11. 1.
[Swift] SwiftUI KeyChain Service ์˜ˆ์ œ KeyChain Services ํ‚ค์ฒด์ธ ์„œ๋น„์Šค๋ž€? ์‚ฌ์šฉ์ž๋ฅผ ๋Œ€์‹ ํ•˜์—ฌ ์†Œ๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ์ €์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ๋žŒ๋“ค์€ ์ˆ˜๋งŽ์€ ์˜จ๋ผ์ธ ๊ณ„์ •์„ ๊ด€๋ฆฌํ•˜๊ณ , ์ผ๋ฐ˜์ ์œผ๋กœ ์—ฌ๋Ÿฌ ๊ณ„์ •์— ๊ฑธ์ณ ๊ฐ„๋‹จํ•œ ์•”ํ˜ธ๋ฅผ ์žฌํ™œ์šฉํ•˜๊ธฐ์— ์•ˆ์ „ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด์— ๋Œ€์‘ํ•˜์—ฌ ํ‚ค์ฒด์ธ ์„œ๋น„์Šค API๋Š” ์•ฑ์— ํ‚ค์ฒด์ธ์ด๋ผ๋Š” ์•”ํ˜ธํ™”๋œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์‚ฌ์šฉ์ž ๋ฐ์ดํ„ฐ์˜ ์ž‘์€ ๋น„ํŠธ๋ฅผ ์ €์žฅํ•˜๋Š” ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ์ œ๊ณตํ•˜์—ฌ ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š”๋ฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ์•ˆ์ „ํ•˜๊ฒŒ ๊ธฐ์–ต๋˜๋ฉด ์‚ฌ์šฉ์ž๊ฐ€ ๋ณต์žกํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž์œ ๋กญ๊ฒŒ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋น„๋ฐ€๋ฒˆํ˜ธ์— ๊ตญํ•œ๋˜์ง€ ์•Š๊ณ  ์ธ์ฆ์„œ, ํ‚ค ๋ฐ ์‹ ๋ขฐ ์„œ๋น„์Šค๋กœ ๊ด€๋ฆฌํ•˜๋Š” ์•”ํ˜ธํ™” ํ‚ค ๋ฐ ์ธ์ฆ์„œ๋„ ๋ณด๊ด€์ด ๊ฐ€๋Šฅํ•˜๋ฉฐ ์ด๊ฒƒ๋“ค๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋Š” ๋ณด์•ˆ ํ†ต์‹ ์— ์ฐธ์—ฌํ•˜๊ณ  ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž ๋ฐ ์žฅ์น˜์™€ ์‹ ๋ขฐ๋ฅผ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. API Com.. 2021. 10. 30.
[Swift] SwiftUI WebView, WebView + javascript message handler ์˜ˆ์ œ ์•ฑ์˜ ์ข…๋ฅ˜์— ๋”ฐ๋ผ์„œ ํ•„์š”์‹œ ์›น ๋ทฐ๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ์•ฑ๋“ค์ด ์žˆ๋‹ค. ๋‹จ์ˆœํžˆ ๋ณด์—ฌ์ฃผ๋Š” ์šฉ๋„๋„ ๊ฐ€๋Šฅํ•˜๋‚˜ ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ์•ฑ์€ ์›น๊ณผ ์•ฑ์ด ์„œ๋กœ ์ƒํ˜ธ์ž‘์šฉํ•˜๋„๋ก ๊ตฌํ˜„์„ ๋งŽ์ดํ•˜๋Š”๋ฐ ์ผ๋ฐ˜ ์‚ฌ์šฉ์ž๋Š” ์›นํ™”๋ฉด์„ ๋ณด๊ณ ์žˆ๋Š”์ง€ ๋ชจ๋ฅด๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋А๋‚„ ์ˆ˜ ์žˆ๋‹ค. ๋‹จ์ˆœํžˆ ๋ณด์—ฌ์ฃผ๊ธฐ๋งŒ ํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ ์„œ๋กœ ์ƒํ˜ธ์ž‘์šฉ ํ•  ์ˆ˜๋„ ํ•  ์ˆ˜ ์žˆ๋‹ค. 1. WebView WebView.swift import SwiftUI import WebKit struct WebView: UIViewRepresentable { var url: String func makeUIView(context: Context) -> WKWebView { guard let url = URL(string: self.url) else { return WKWebView() } let webView .. 2021. 9. 28.
[Swift] SwiftUI SHA256์„ ์ด์šฉํ•œ ๊ฐ„๋‹จํ•œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„ ์˜ˆ์ œ SHA256์„ ์‚ฌ์šฉํ•˜์—ฌ password๋ผ๋Š” ๋ฌธ์ž์—ด์˜ ํ•ด์‰ฌ๊ฐ’์„ ๋งŒ๋“ ๋‹ค. ํšŒ์›๊ฐ€์ž… ์ ˆ์ฐจ๋Š” ์—†์Œ์œผ๋กœ id๋Š” "kim" ๊ณ ์ •์ด๊ณ  password๋Š” "password" ์œผ๋กœ ๊ณ ์ • ContentView.swift import SwiftUI import CryptoKit struct FieldStyle: ViewModifier { let lightGreyColor = Color(red: 240.0/255.0, green: 240.0/255.0, blue: 240.0/255.0, opacity: 1.0) func body(content: Content) -> some View { return content .padding() .background(lightGreyColor) .cornerRadius(5.0) .padd.. 2021. 9. 28.
[Swift] SwiftUI/StoryBoard LaunchScreen + Sleep ์˜ˆ์ œ ๋Ÿฐ์น˜ ํ™”๋ฉด / ์Šคํ”Œ๋ž˜์‹œ ํ™”๋ฉด์€ ์‚ฌ์šฉ์ž๊ฐ€ ์ œ์ผ ์ฒ˜์Œ ๋งˆ์ฃผํ•˜๋Š” ํ™”๋ฉด์ด๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ๋ฉ”์ธํ™”๋ฉด์„ ๋ณด๊ธฐ์ „์— ํ•˜์–€ ๋นˆ ํ™”๋ฉด์„ ๋งˆ์ฃผํ•˜๊ฒŒ๋œ๋‹ค๋ฉด ํ˜„์žฌ ์‚ฌ์šฉํ•˜๋Š” ์•ฑ์ด ๋ฐ˜์‘์„ฑ์ด ์ข‹์ง€์•Š๋‹ค๋Š” ์ธ์‹์„ ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ด์œ  ๋•Œ๋ฌธ์— ๋Ÿฐ์น˜ ํ™”๋ฉด์„ ๋งŒ๋“ค์–ด์„œ ์•ฑ์ด ์‹คํ–‰๋˜์ž ๋งˆ์ž ๋งˆ์ฃผํ•  ์ˆ˜ ์žˆ๋Š” ํ™”๋ฉด์„ ๋งŒ๋“ค์–ด์•ผํ•œ๋‹ค. ๋Ÿฐ์น˜ ํ™”๋ฉด์—์„œ๋Š” ๋ณดํ†ต ํด๋ผ์ด์–ธํŠธ์—์„œ ์ดˆ๊ธฐ์— ์ฒ˜๋ฆฌํ•ด์•ผ๋  ์ž‘์—…์ด ์žˆ๊ฑฐ๋‚˜, ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ž‘์—…, ๋ถˆ๋Ÿฌ์˜ค๊ณ  ์ฒ˜๋ฆฌํ•˜๋Š” ๊ณผ์ •๋“ค์ด ์žˆ์„ ์ˆ˜ ์žˆ๋Š”๋ฐ ์ด๋Ÿฌํ•œ ์ž‘์—…์„ ํ•˜๋Š” ๋™์•ˆ์— ์œ ์ €์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ์—†๋Š” ์ƒํƒœ์—์„œ ๋ฉ”์ธํ™”๋ฉด์œผ๋กœ ๋„˜์–ด๊ฐ€์ง€ ์•Š๋„๋ก ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ณ ์ •ํ™”๋ฉด๋งŒ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋Š”๋ฐ, ์ƒํƒœ๋ฅผ ๋ณ€ํ™˜ํ•˜์—ฌ ํ‘œ์‹œํ•ด์ฃผ๋Š” ๋ฐฉ๋ฒ•์€ ์ฐพ์ง€ ๋ชปํ•˜์˜€๋‹ค. ์—†๋‹ค๋Š” ์–˜๊ธฐ๋„ ์žˆ๋Š”๊ฒƒ ๊ฐ™์€๋ฐ ํ™•์‹ค์น˜๋Š” ์•Š๋‹ค. LaunchScreen๊ณผ Splash ๋‘ ๊ฐ€์ง€๊ฐ€ .. 2021. 9. 27.
[Flutter] ๊ฐ„๋‹จํ•œ ์•ฑ ๋งŒ๋“ค๊ธฐ (provider pattern, translator(google ๋ฒˆ์—ญ), ChuckNorris(19joke json api), jsontoclass) ChuckNorris ๋ผ๋Š” 19์„ธ ๋†๋‹ด์„ ๋˜์ ธ์ฃผ๋Š” json api๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ rest api๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ™”๋ฉด์— ๋ฟŒ๋ ค์ง€๋Š” ๊ฐ„๋‹จํ•œ ์–ดํ”Œ์„ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์šฐ์„  JSON To Dart Class (JsonToDartClass)๋ฅผ ์„ค์น˜ํ•˜์—ฌ์ค๋‹ˆ๋‹ค. ์ด๋Ÿฐ๊ฒŒ ํ”Œ๋Ÿฌ๊ทธ์ธ์œผ๋กœ ์žˆ๋Š”์ง€ ๋ชฐ๋ž๋Š”๋ฐ.. ๋งค์šฐ ์ข‹์Šต๋‹ˆ๋‹ค!!! ์งฑ์งฑ json ํ˜•์‹์„ dart class ๋กœ ๋ฐ”๊พธ์–ด์ง‘๋‹ˆ๋‹ค. ์›ํ•˜๋Š”๋Œ€๋กœ ๋ฐ”๊พธ์–ด์ง€์ง€ ์•Š์„ ์ˆ˜ ์žˆ์ง€๋งŒ ๋ช‡๊ฐœ๋งŒ ์ถ”๊ฐ€ํ•˜๋ฉด๋˜์„œ ๋ฌด์กฐ๊ฑด ์ด ๋ฐฉ์‹์ด ์ข‹์Šต๋‹ˆ๋‹ค. ๋จผ์ € provider, http, translator ์ด๋ ‡๊ฒŒ 3๊ฐ€์ง€๋ฅผ ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค. provider ํŒจํ„ด์„ ์ด์šฉํ• ๊ฒƒ์ด๊ณ  http๋กœ json response๋ฅผ ๋ฐ›์„๊ฒƒ์ด๊ณ  translator๋กœ ์˜์–ด๋กœ๋œ๊ฒƒ์„ ํ•œ๊ธ€๋กœ ๋ฒˆ์—ญํ• ๊ฒƒ์ž…๋‹ˆ๋‹ค. ํŒŒ์ผํŠธ๋ฆฌ์ž…๋‹ˆ๋‹ค. ์ €๋Š” ์—ฐ์Šต์žฅ .. 2021. 1. 8.
flutter ํ”„๋กœ๊ทธ๋ ˆ์Šค๋ฐ” progress bar circle progress bar example flutter ๊ธฐ๋ณธ ProgressBar๋Š” ๊ตฌ๊ธ€๋งํ•˜๋ฉด ์‰ฝ๊ฒŒ ์ฐพ์„ ์ˆ˜ ์žˆ๋‹ค. ์œ„ ๋‘๊ฐœ์˜ ๊ฒฝ์šฐ ๋งค์šฐ ๊ฐ„๋‹จํ•œ๋ฐ ์‚ฌ์šฉํ• ๋• Stack์— ๋„ฃ์–ด์„œ ๋งจ ์ƒ๋‹จ์— ์Œ“์•„์ฃผ๋ฉด ๋œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ฐ€์ ธ์™€์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋“ค์ด ์žˆ๋‹ค. flutter_spinkit ์„ ์‚ฌ์šฉํ•ด๋ณด๋„๋ก ํ•˜์ž. ๋งค์šฐ ์‰ฝ๊ณ  ๋น ๋ฅด๊ฒŒ ์ ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค. ๋‹จ์ˆœ ํ”„๋กœ๊ทธ๋ ˆ์Šค ์• ๋‹ˆ๋ฉ”์ด์…˜์ธ๋ฐ LIKES๊ฐ€ ์ด๋ ‡๊ฒŒ ๋†’์„ ์ค„์€ ๋ชฐ๋ž๋‹ค. ๋จผ์ € pubspec.yaml์— ์ถ”๊ฐ€ํ•ด์ฃผ์ž. dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertin.. 2021. 1. 8.
flutter secure storage, ์ž๋™๋กœ๊ทธ์ธ, android KeyStore example flutter secure storage๋ฅผ ์‚ฌ์šฉํ•œ ์ž๋™๋กœ๊ทธ์ธ์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค. ๊ณ„์ •์€ ํ•˜๋‚˜๋งŒ ์‚ฌ์šฉํ•˜์ง€์•Š๊ณ  ์—ฌ๋Ÿฌ๊ณ„์ •์„ ์‚ฌ์šฉํ•˜๋„๋ก ํ•˜๊ฒ ๋‹ค. ๋””๋ฒ„๊น…์„ ๋งŽ์ด ํ•ด๋ณด์ง€ ์•Š์•˜๋‹ค. ๋Œ€์ถฉ ์ด๋Ÿฐ ์‹์ด๋‹ค ๋ผ๊ณ ๋งŒ, ์ด๋ ‡๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ์‹์ด๋ผ๋Š”๊ฒƒ๋งŒ ๋Œ€์ถฉ ๋ณด๊ณ  ๋„˜์–ด๊ฐ€๋ฉด ๋ ๊บผ๊ฐ™๋‹ค. flutter secure storage flutter์—์„œ ๊ฐ ํ”Œ๋žซํผ(android, ios)์˜ ๋‚ด๋ถ€์ €์žฅ์†Œ(keychain or keystore)๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋‹ค! iOS์—์„œ๋Š” ์‚ฌ์šฉํ•ด๋ณด์ง€ ์•Š์•˜์ง€๋งŒ Keychain์ด๋ผ๋Š” ๊ฒƒ์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๊ฒƒ ๊ฐ™๋‹ค. android keystore๋Š” ์‚ฌ์šฉํ•ด๋ณธ์ ์ด ์žˆ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ๋Š” ๋ฃจํŒ…ํ•˜๊ธฐ ์‰ฌ์šด ์šด์˜์ฒด์ œ์—ฌ์„œ Shared Preference ๊ฐ™์€ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ด๋ถ€ ์ €์žฅ์†Œ๋“ค์€ ๊ฐ„๋‹จํ•œ ๋ฃจํŒ…๊ณผ์ •๋งŒ ๊ฑฐ์ณ๋„.. 2021. 1. 7.
[Flutter] provider + [Change Notifier] ๋ฅผ ์‚ฌ์šฉํ•œ Provider Pattern example ์ด๋•Œ๊นŒ์ง€ ๋‹ค์–‘ํ•œ BLOC ํŒจํ„ด์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด๋ณด์•˜๋‹ค. ํ•˜์ง€๋งŒ BLOC์˜ ๋กœ์ง ๋ถ„ํ• ์„ ์œ„ํ•œ ๋‹ค์ˆ˜์˜ ํด๋ž˜์Šค ์ƒ์„ฑ์œผ๋กœ ์ธํ•ด ๋ณต์žก์„ฑ ๋ฌธ์ œ๊ฐ€ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— 2019๋…„ Google์—์„œ ์ ๊ทน ์ถ”์ฒœํ•œ Provider Pattern์„ ์‚ฌ์šฉํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค. ๊ตฌ๊ธ€์—์„œ ๋งŒ๋“ ๊ฒƒ์€ ์•„๋‹ˆ๊ณ  ์ปค๋ฎค๋‹ˆํ‹ฐ์—์„œ ์˜ฌ๋ผ์˜จ๊ฒƒ์ด๋ผ๋Š”๋ฐ ๊ตฌ๊ธ€์—์„œ ์ ๊ทน ์ถ”์ฒœ์„ ํ•œ ๊ฒƒ์ด๋ผ๊ณ  ํ•œ๋‹ค. ๋˜ํ•œ BLOC๊ฐ€ ๋‹ค์ˆ˜์˜ ํด๋ž˜์Šค๋กœ ๋ณต์žกํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์•„์— ์“ฐ์ง€ ์•Š๋Š”๊ฒƒ์€ ์•„๋‹ˆ๋‹ค. ์–ด๋А์ •๋„ ๊ทœ๋ชจ๊ฐ€ ์žˆ๋Š” ํ”„๋กœ์ ํŠธ๋Š” BLOCํŒจํ„ด์„ ์‚ฌ์šฉํ•˜์—ฌ ์ •ํ™•ํ•œ ๋กœ์ง๋ถ„๋ฆฌ๋ฅผ ํ•˜๋Š”๊ฒƒ์ด ๋ถ„๋ช…ํžˆ ๋” ์ข‹์„๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค. ์†Œ๊ทœ๋ชจ์— Provider, ์ค‘๊ทœ๋ชจ์— Provider, Bloc, ๋Œ€๊ทœ๋ชจ์— Bloc ๊ฐ€ ๋งž์ง€ ์•Š์„๊นŒ ์‹ถ๋‹ค. ํŠธ๋ฆฌ์ด๋‹ค. main.dart import 'package:flutter/founda.. 2021. 1. 6.
[Flutter] ๊ธฐ์ดˆ๊ฐ€ ๋˜๋Š” StreamBuilder BLOC ํŒจํ„ด, StreamSubscription, yield example ์ €๋ฒˆ์—๋Š” Cubit๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ BLOC ํŒจํ„ด์„ ์ œ์ž‘ํ•ด๋ณด์•˜๋‹ค. ํ›คํ•˜๊ฒŒ ๋ˆˆ์— ์ž˜ ๋ณด์ด๋Š” Cubit๋กœ ํ•„์š” ๋™์ž‘๋งŒ ๊น”๋”ํ•˜๊ฒŒ ์˜ต์ €๋น™ ํ–ˆ์ง€๋งŒ ์—ญ์‹œ๋‚˜ BLOC๋Š” ๋ณต์žกํ•˜๋‹ค. ์ด๋ฒˆ์— ์ž‘์„ฑํ•˜๋Š” StreamBuilder๋ฅผ ์‚ฌ์šฉํ•œ BLOC ํŒจํ„ด ๋˜ํ•œ ๋ณต์žกํ•˜๋‹ค. ๊ฒฐ๊ตญ ํ•˜๋‚˜์˜ ๊ธฐ๋Šฅ์„ ๋งŒ๋“ค๋ ค๋ฉด ํด๋ž˜์Šค๋ฅผ ์ตœ์†Œ 3, 4๊ฐœ๋ฅผ ๋งŒ๋“ค์–ด์•ผํ•˜๋‹ˆ ๋ฌธ์ œ์ด๋‹ค. ํŒŒ์ผํŠธ๋ฆฌ์ด๋‹ค. ๋กœ์ง์„ ๋‚˜๋ˆ„๊ณ , ์ด๋ฒคํŠธ์™€ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•œ๋‹ค. main.dart import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc_with_stream/ticke.. 2021. 1. 6.
[Flutter] Cubit๋ฅผ ์‚ฌ์šฉํ•œ BLOC ํŒจํ„ด, Bloc.observer example CUBIT๋ฅผ ์‚ฌ์šฉํ•œ BLOC ํŒจํ„ด Bloc.observer๋ฅผ BlocObserver๋ฅผ ์ƒ์†ํ•œ class๋กœ ์ดˆ๊ธฐํ™”ํ•ด์„œ onChange๋ฅผ overrideํ•ด์„œ ์ƒํƒœ๊ฐ€ ๋ณ€ํ• ๋•Œ๋งˆ๋‹ค print ํ• ๊ฒƒ์ด๊ณ  navigation push ๋„ ํ•ด๋ณผ ๊ฒƒ ์ž…๋‹ˆ๋‹ค. pubspec.yaml dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 bloc: ^6.1.0 //์ถ”๊ฐ€ flutter_bloc: ^6.1.0 //์ถ”๊ฐ€ counter_observer.dart .. 2021. 1. 4.
[Flutter] fluro package (navigation ์ด๋™, route, transition) sample code fluro ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ route๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. arguments ์ •ํ•˜๋Š”๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๊ณ  transitionType์„ ํ†ตํ•ด ์›ํ•˜๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๋ณด์ด๊ฒŒ, ์•ˆ๋ณด์ด๊ฒŒ ํ•  ์ˆ˜๋„ ์žˆ๋‹ค. pub.dev/packages/fluro fluro | Flutter Package Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions. pub.dev code sample ์ด๋‹ค. import 'package:flutter/material.dart'; import 'package:fluro/fluro.dart'; Handler _TestNativeH.. 2020. 12. 22.
[Swift] Optional ๊ฐœ๋…์ •๋ฆฌ (๋ณ€์ˆ˜๋’ค์— !์™€ ?) optional ์˜ˆ์ œ Optional ๊ฐœ๋…์ •๋ฆฌ ์„ ํƒ์ ์ธ ์ด๋ผ๋Š” ๋œป์„๊ฐ€์ง„ optional ์€ swift์—์„œ ๋ฌด์—‡์ผ๊นŒ์š”? ๋งŒ์•ฝ ์น˜ํ‚จ์„ ๋ฐฐ๋‹ฌ์‹œํ‚ค๋Š” ์ƒํ™ฉ์„ ์ƒ๊ฐํ•ด๋ณผ๊นŒ์š”? ์ผ๋‹จ ์ฝ์–ด๋ณผ๊ฒŒ์š”! ๋ฐฐ๋‹ฌ์–ดํ”Œ์—์„œ XCODE๋ผ๋Š” ์น˜ํ‚จ ๊ฐ€๊ฒŒ๋ฅผ ํด๋ฆญํ•˜๊ณ  ์น˜ํ‚จ ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. [์ฝ”๋“œ์ž‘์„ฑ์ค‘] ์•„์ง์€ ๋ง› ์˜ต์…˜์„ ๊ณ ๋ฅด์ง€ ์•Š์€ ์ƒํƒœ์—ฌ์„œ ๋ง›์€ ์ตœ์†Œ 1๊ฐœ๋ฅผ ๊ณจ๋ผ์ฃผ์„ธ์š”! ๋ผ๋Š” ๊ฒฝ๊ณ ๋ฌธ๊ตฌ๊ฐ€ ๋ณด์ž…๋‹ˆ๋‹ค! [nil ๊ฒฝ๊ณ ] ํ•˜์ง€๋งŒ ๋ง› ์˜ต์…˜์„ ๊ณ ๋ฅด์ง€ ์•Š์•„๋„ ์ฃผ๋ฌธ์€ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๋ง›์˜ต์…˜์„ ๊ณ ๋ฅด์ง€ ์•Š์œผ๋ฉด ๊ฐ€๊ฒŒ์—์„œ๋Š” ์–ด๋–ค ๋ง›์œผ๋กœ ์ค„๊นŒ? ํ˜ธ๊ธฐ์‹ฌ์— ์•„๋ฌด๋ง›๋„ ๊ณ ๋ฅด์ง€ ์•Š๊ณ  ์ฃผ๋ฌธ์„ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. [nil ๊ฒฝ๊ณ ๋ฅผ ๋ณด์•˜์ง€๋งŒ ์‹คํ–‰] ์ฃผ๋ฌธ์„œ๊ฐ€ ๊ฐ€๊ฒŒ๋กœ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค. [์ปดํŒŒ์ผ] ๊ฐ€๊ฒŒ๋Š” ์ฃผ๋ฌธ์„ ๋ฐ›์•˜๊ณ  ์ฃผ๋ฌธ์„œ๋ฅผ ์ฝ๊ณ  ์ˆœ์„œ๋Œ€๋กœ ์กฐ๋ฆฌ๋ฅผ ํ•ฉ๋‹ˆ๋‹ค. [Application ์‹คํ–‰๋จ] ์ˆœ์„œ๋Œ€๋กœ ์กฐ๋ฆฌํ•˜.. 2020. 12. 16.
[Flutter] flutter intro(splash) -> login page timer sample code flutter_example/widgets ํŒจํ‚ค์ง€๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ญ๋‹ˆ๋‹ค. main.dart import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_example/widgets/introPage.dart'; import 'package:flutter_example/widgets/loginPage.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, ti.. 2020. 10. 26.
[Flutter] Flutter ํ”Œ๋žซํผ ์ฑ„๋„์„ ์ด์šฉํ•ด์„œ Android ์ฝ”๋“œ ํ˜ธ์ถœํ•˜๊ธฐ (MethodChannel) ์ƒ์„ฑ์‹œ Paltform channel language ์ฒดํฌ ๋ชจ๋‘ ํ•ด์ œํ•˜๊ธฐ * ํ”Œ๋žซํผ ์ฑ„๋„์„ ์‚ฌ์šฉํ•˜๋Š”๋ฐ ์žˆ์–ด์„œ ์ค‘์š”ํ•œ๊ฒƒ์€ Platform channel language๋ฅผ ์–ด๋–ค๊ฒƒ์„ ์‚ฌ์šฉํ• ๊ฒƒ์ธ์ง€์ด๋‹ค. Include Swift support for iOS code ๋ฅผ ์„ ํƒํ•œ ์ ์ด ์žˆ๋Š”๋ฐ Swift ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์‚ฌ๋žŒ์ด ์—†์–ด์„œ ๋‚ญํŒจ๋ฅผ ๋ณธ ์ ์ด ์žˆ๋‹ค. ํ”Œ๋žซํผ ์ฑ„๋„์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด java, kotlin, Objective-c, swift ๋ชจ๋‘ ์ˆ™์ง€ํ•ด ๋‘์–ด์•ผ ํ•œ๋‹ค. project/lib/main.dart import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class PlatformChannel.. 2020. 10. 25.
[Flutter] Flutter ์ƒ๋ช…์ฃผ๊ธฐ Sample Code main.dart import 'package:flutter/material.dart'; void main() => runApp(TestApp()); class TestApp extends StatelessWidget { TestApp() { print('TestApp TestApp() start'); print('TestApp TestApp() done'); } @override Widget build(BuildContext context) { print('TestApp build() start'); print('TestApp build() done'); return MaterialApp( title: 'StatefulWidget LifecycleApp', home: _FirstStatefulWidge.. 2020. 10. 25.
[Android] altbeacon ์•ˆ๋“œ๋กœ์ด๋“œ ๋น„์ฝ˜ ์—ฐ๋™ํ•˜๊ธฐ ์•ˆ๋“œ๋กœ์ด๋“œ ๋น„์ฝ˜(์•ŒํŠธ๋น„์ฝ˜) ๊ฐ„๋‹จํ•˜๊ฒŒ ์‚ฌ์šฉํ•ด๋ณด๊ธฐ ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๋กœ๋Š” ์ž‘๋™ํ•˜์ง€ ์•Š์œผ๋‹ˆ ๊ผญ ์•ˆ๋“œ๋กœ์ด๋“œ ๊ธฐ๊ธฐ๋ฅผ ์‚ฌ์šฉ ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์ œ์ผ ์ขŒ์ƒ๋‹จ์˜ ํŒจํ‚ค์ง€์ต์Šคํ”Œ๋กœ๋Ÿฌ๋ฅผ Project๋กœ ๋ณ€๊ฒฝ {๋‚˜์˜ project}/app/src/main/AndroidMainfest.xmlํผ๋ฏธ์…˜ ์ž‘์„ฑ ์•ฑ ์ด์šฉ์‹œ ์ด์šฉ์ž์—๊ฒŒ ACCESS-FINE_LOCATION ๊ถŒํ•œ ํ—ˆ๋ฝ์žˆ์–ด์•ผํ•จ android-beacon-library-2.16.2.arr ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œaltbeacon arr ํŒŒ์ผ https://altbeacon.github.io/android-beacon-library/download.htmlAndroid Beacon Libraryaltbeacon.github.io {๋‚˜์˜ project}/app/libs < android-beacon-l.. 2020. 6. 14.
[Android] SQLite, SQL (SQLiteOpenHelper) SQLiteOpenHelper ์„ ์ด์šฉํ•˜์—ฌ ๋งŽ์•„์ง€๋Š” ๋ฐ์ดํ„ฐ๋“ค์„ ์ €์žฅํ•œ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜์—ฌ ์œ ์ง€ํ•˜๊ธฐ๋•Œ๋ฌธ์— ์•ฑ์„ ๊บผ๋„ ๋ฐ์ดํ„ฐ๊ฐ€ ์ง€์›Œ์ง€์ง€์•Š๋Š”๋‹ค. (์•ฑ ์‚ญ์ œ์‹œ๋Š” ์ง€์›Œ์ง„๋‹ค.) package kr.co.hanbit.myapplication2; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annotation.Nullable; import java.util.ArrayList; public class SQLiteHelper { private static.. 2020. 1. 4.
๋ฐ˜์‘ํ˜•