Skip to content

Instantly share code, notes, and snippets.

View hongsw's full-sized avatar
๐Ÿ•น๏ธ
Focusing

Seungwoo hong hongsw

๐Ÿ•น๏ธ
Focusing
View GitHub Profile
@hongsw
hongsw / main.dart
Created November 13, 2024 03:49
์ถ”์ƒํ™” ํด๋ž˜์Šค ์˜ˆ์‹œ Recipe ํด๋ž˜์Šค๋ฅผ ์ผ๋ฐ˜ํ™”ํ•˜๊ณ , FreeRecipe์™€ PaidRecipe ํด๋ž˜์Šค
class Recipe {
String title;
List<String> ingredients;
Recipe(this.title, this.ingredients);
// ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•  ์žฌ๋ฃŒ ๋ชฉ๋ก ๋ฉ”์„œ๋“œ
void getIngredientList() {
print("Ingredients for $title: ${ingredients.join(', ')}");
}
@hongsw
hongsw / main.dart
Created October 23, 2024 02:59
w8-ํŽ˜์ด์ง€ ์ด๋™ with gpt https://chatgpt.com/c/67186524-23bc-8013-a178-c7ce9fece1e8
// ํ•„์ˆ˜ Material Design ์œ„์ ฏ์„ ํฌํ•จํ•˜๋Š” ํŒจํ‚ค์ง€ ์ž„ํฌํŠธ
import 'package:flutter/material.dart';
// ์•ฑ์˜ ์‹œ์ž‘์ 
void main() {
runApp(const MyApp());
}
/// ์•ฑ์˜ ๋ฃจํŠธ ์œ„์ ฏ
/// MaterialApp์„ ๋ฐ˜ํ™˜ํ•˜์—ฌ ๋จธํ‹ฐ๋ฆฌ์–ผ ๋””์ž์ธ ํ…Œ๋งˆ ์ ์šฉ
@hongsw
hongsw / main.dart
Created October 2, 2024 03:25
my_flutter1
import 'package:flutter/material.dart';
void main() async {
runApp(MaterialApp(
initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/': (context) => FirstScreen(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': (context) => QuizPage(),
@hongsw
hongsw / main.dart
Last active September 25, 2024 02:41
Class๋ฅผ ํ™œ์šฉํ•œ ๋„์„œ๊ด€๋ฆฌ ํ”„๋กœ๊ทธ๋žจ (๋ฌธ์ œ)
class Book {
String title;
String? author; // ์ €์ž ์ •๋ณด๋ฅผ ์„ ํƒ์ ์œผ๋กœ ์ถ”๊ฐ€
Book(this.title, [this.author]);
@override
String toString() {
return '$title';
}
void main() {
String str1 = 'h1';
String str2 = 'h1';
print(str1);
}
void main() {
for (int i = 0; i < 10; i++) {
print('hello Hong ${i + 1}');
}
}
@hongsw
hongsw / main.dart
Created November 15, 2023 02:26
riverpod example counter with subpage
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'main.g.dart';
// A Counter example implemented with riverpod
void main() {
runApp(
@hongsw
hongsw / main.dart
Created November 15, 2023 02:25
riverpod example counter
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'main.g.dart';
// A Counter example implemented with riverpod
void main() {
runApp(
@hongsw
hongsw / main.dart
Created November 15, 2023 00:33
Class X Animation
import 'package:flutter/material.dart';
// ์š”๊ตฌ์‚ฌํ•ญ : ์ด๋ก  ์• ๋‹ˆ๋ฉ”์ด์…˜๊ณผ ํด๋ž˜์Šค๋ฅผ ์‘์šฉํ•œ ๊ณผ์ œ๋กœ์จ,
// ๋„ค๋ชจ๋ชจ์–‘์„ ์กฐ์ ˆํ•˜๊ณ  ์ƒ‰์ƒ๋„ ๋ณ€๊ฒฝํ•˜๋Š” ๋ณ„๋„์˜ ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค๊ณ 
// ์ด๋ฅผ ํ•œํ™”๋ฉด์— 2๊ฐœ๋ฅผ ์œ„์•„๋ž˜๋กœ ํ‘œํ˜„ํ•œ๋‹ค.
// ๋งŒ๋“  ํด๋ž˜์Šค์—์„œ ๋„ค์ž„๋””๋“œ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ด์šฉํ•˜์—ฌ
// Tween Animation์˜ ์ตœ์ข… ์‚ฌ์ด์ฆˆ์™€ ์ƒ‰์ƒ์„ ์ง€์ •ํ•˜์—ฌ
// ๋ฒ„ํŠผ์„ ํด๋ฆญํ–ˆ์„๋•Œ ๋™์ž‘๋˜๋„๋ก ํ•œ๋‹ค.
void main() => runApp(const MyApp());