Created with <3 with dartpad.dev.
This file contains 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( | |
theme: ThemeData( | |
primarySwatch: Colors.blue, |
This file contains 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 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'; | |
// 참고 : https://docs.flutter.dev/cookbook/navigation/navigation-basics | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
This file contains 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'; | |
// 참조 : https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.3 | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
This file contains 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 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 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 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 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 서버에서 데이터를 정상적으로 가져왔을 때 |