본문 바로가기
Development Solutions/Flutter & Dart

[flutter] how to change background color of flutter app. (앱의 배경 색상 변경 방법)

by studio ODOC 2021. 11. 5.
반응형

[flutter]

how to change background color of flutter app.

(앱의 배경 색상 변경 방법)

 

 

앱의 가장 바깥이 되는 위젯을 Scaffold로 구축하고

아래와 같이 backgroundColor를 지정해주면 된다.

 

[English](Build the most external widget of the app into Scaffold

You can designate the background color as follows.)

 

import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
  @override
    Widget build(BuildContext context) {

      return new MaterialApp(
        title: 'Testing',
        home: new Scaffold(
        //Here you can set what ever background color you need.
          backgroundColor: Colors.white,
        ),
      );
    }
}
반응형

Scaffold는 건축 분야에서 나온 용어로서

가장 기본 골격을 의미한다.

필자의 경우 이렇게 외우니 쉽게 기억할 수 있었다.

 

[English](Scaffold is a term that comes from the field of architecture

It means the most basic skeleton.

In the case of the author, it was easy to remember by memorizing it like this.)

반응형