본문 바로가기

flutter22

[Flutter] Animation Animation makes applications look more gorgeous. AnimatedContainer Widget Flutter provides an AnimatedContainer widget for easy use of animation. Let's take a look at the full code first. import 'package:flutter/material.dart'; import 'dart:math'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildCo.. 2022. 4. 3.
[Flutter] File Handling In this posting, we will learn about file handling. path_provider Package This package supports getting commonly used locations on the filesystem. It supports Android, iOS, Linux, macOS, and Windows, but not all methods are supported on all platforms. Refer to the below page for the detailed supported list. https://pub.dev/packages/path_provider Usage Directory tempDir = await getTemporaryDirect.. 2022. 4. 2.
[Flutter] Save Data using Shared Preferences Flutter provides SharedPreferences class that supports saving data to a shared preference file as key-value pair. Prerequisite If you want to use this feature on iOS, it needs cocoapods. Please find the materials on the official site. https://guides.cocoapods.org/using/getting-started.html#installation If you are using homebrew, you can simply install it. $ brew install cocoapods Register Packag.. 2022. 4. 1.
[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.
[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.
[Flutter] Getting Started on VSCode Flutter is a cross-platform app development framework made by Google. Let's get started flutter on VSCode. Prerequisite Xcode has to be installed already. And, this command should be run in order to use the iOS simulator in VSCode. $ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer $ sudo xcodebuild -license accept Installing VSCode You can download it through the official h.. 2022. 2. 27.