Created with <3 with dartpad.dev.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
for (int i = 1; i <= 100; i++) { | |
String output = ""; | |
var fizz = ["", "Fizz"]; | |
var buzz = ["", "Buzz"]; | |
output += fizz[i % 3 == 0 ? 1 : 0]; | |
output += buzz[i % 5 == 0 ? 1 : 0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// ๋จ๊ณ 1: ๐ + ๐ = ๐๐ | |
String pen = '๐'; | |
print('Pen: $pen'); // ๐ | |
String apple = '๐'; | |
print('Apple: $apple'); // ๐ | |
String ap = apple + pen; | |
print('AP: $ap'); // ๐๐ | |
// ๋จ๊ณ 2: ๐ + ๐ = ๐๐ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var hello = 'Hello, ๐!'; | |
print(hello.toUpperCase()); // Output: "HELLO, ๐!" | |
hello = 'Hello, ๐!'; | |
print(hello.toLowerCase()); // Output: "hello, ๐!" | |
hello = ' Hello, ๐! '; | |
print(hello.trim()); // Output: "Hello, ๐!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/flutter/samples.git | |
cd samples | |
ls | |
git sparse-checkout add game_template | |
git checkout | |
ls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
Future<void> fetchPosts() async { | |
final response = | |
await http.get(Uri.parse('https://content.guardianapis.com/search?show-fields=thumbnail&q=food%20korean&api-key=test')); | |
if (response.statusCode == 200) { | |
// API ์๋ฒ์์ ๋ฐ์ดํฐ๋ฅผ ์ ์์ ์ผ๋ก ๊ฐ์ ธ์์ ๋ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
Future<void> fetchPosts() async { | |
final response = | |
await http.get(Uri.parse('https://jsonplaceholder.typicode.com/posts')); | |
if (response.statusCode == 200) { | |
// API ์๋ฒ์์ ๋ฐ์ดํฐ๋ฅผ ์ ์์ ์ผ๋ก ๊ฐ์ ธ์์ ๋ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
class CounterModel extends ChangeNotifier { | |
int _count = 0; | |
int get count => _count; | |
void increment() { | |
_count++; | |
notifyListeners(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |