전체 글343 [Flutter] Navigation Flutter supports navigation in a similar way to web development. Register Routes First, let's see the main application. // lib/main.dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Navigation Example', theme.. 2022. 3. 30. [Flutter] How to Use Tab Bar Widget Tab bar is a widely used widget when we make a mobile application. It can help to navigation between pages. Creating Pages First, create pages to navigate. // lib/tab_pages/first_page.dart import 'package:flutter/material.dart'; class FirstPage extends StatelessWidget { @override Widget build(BuildContext context) { return const Scaffold(body: Center(child: Text('This is a first page.'))); } } /.. 2022. 3. 27. [Flutter] Adding Fonts to Flutter Application Adding fonts to the Flutter application is quite simple. Configuration Create a fonts folder in the project and push the font file that you want to use. Let's add the fonts to the project's configuration file. # pubspec.yaml ... # The following section is specific to Flutter. flutter: ... # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry.. 2022. 3. 26. [Flutter] Adding Image to Flutter Application Let's learn about how to add images to the Flutter application. Configuration Let's create an images folder in the project and push the prepared images. Now, open the project configuration file. Adding configurations by referring to the comments. # pubspec.yaml ... # The following section is specific to Flutter. flutter: ... # To add assets to your application, add an assets section, like this: .. 2022. 3. 26. [Flutter] Life Cycle The only stateful widget has a 10-step life cycle. The stateless widget doesn't have a life cycle because it can't be updated once it is created. 1. createState() A class to inherit StatefulWidget class should call createState() function. This function returns State class that contains other life cycle functions. In other words, you can understand it as a function creating a state of a widget. 2.. 2022. 3. 23. [Dart] Data Communication with Stream The Stream can guarantee the order of the data. Stream acts like a queue. Stream Example Let's take a look at a simple example. import 'dart:async'; void main() async { var stream = streamSend(10); var sum = await streamReceive(stream); print('Sum: $sum'); } Stream streamSend(int to) async* { for (int i = 1; i print('first: $value')); // 1 stream = Stream.fromIterable([1, 2, 3, 4, 5]); stream.la.. 2022. 3. 20. [Dart] Handling JSON Dart supports handling JSON. You need to import convert library. Decoding JSON String jsonDecode() method converts JSON string into List that is dynamic type. import 'dart:convert'; void main() { var jsonString = ''' [{"key1": "value1"}, {"key2": "value2"}] '''; var decodedString = jsonDecode(jsonString); print(decodedString is List); // true print(decodedString[0]); // {key1: value1} print(deco.. 2022. 3. 12. [Windows] Hibernate 켜기 윈도우를 사용하게 되면 기본적으로 sleep만 사용 가능하고, hibernate 기능은 꺼져 있죠. 그런데, sleep 같은 경우는 이런저런 이유로 강제로 wake up 되는 경우가 자주 발생을 하더라고요. 그래서, sleep 보단 hibernate를 선호합니다. 하지만, 기본적으로는 off 상태라 사용을 하려면 몇 가지 작업을 해줘야 합니다. PowerShell을 administrator권한으로 실행을 시키고, 다음 명령어를 입력해 줍니다. $ powercfg /H ON Command Prompt에서도 동일하게 하시면 되요. 다음으로, Windows Settings 메뉴에서 System -> Power & sleep 메뉴로 갑니다. 여기서 Additional power settings 메뉴를 선택합니다.. 2022. 3. 8. [Flutter] Getting Started on Android Studio Flutter is a cross-platform app development framework made by Google. Let's get started flutter on Android Studio. I'm going to use MAC. Installing Android Studio You can download it through the official homepage. https://developer.android.com/studio You can also download it through homebrew. $ brew install --cask android-studio Installing Flutter SDK Please refer to the previous post. 2022.02.2.. 2022. 2. 27. 이전 1 ··· 9 10 11 12 13 14 15 ··· 39 다음