본문 바로가기
카테고리 없음

플러터 Flutter - Divider, TextStyle, Backgroundcolor

by 땡칠이 2022. 2. 19.
반응형

플러터 flutter Divider TextStyle Backgroundcolor

class MyApp extends StatelessWidget {

  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
 
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({ Key? key }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("text_ex_app_jenee"),       //title Text
        backgroundColor: Colors.grey,               //title 배경색
        foregroundColor: Colors.black,               //title 색상
        centerTitle: true,
      ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,    //가운데 정렬
            children: const [
              Divider(                      //선 삽입
                height: 30,                //선 간격
                color: Colors.red,        //선 색상
                thickness: 5,              //선 굵기
              ),
                Text("대한민국"),
                Text("독일"),
                Text("브라질"),
              Divider(
                height: 30,
                color: Colors.yellow,
                thickness: 5,
              ),
                Text("스위스",
                 style: TextStyle(                           //글자 스타일
                    color: Colors.green,                  //글자 색상
                    fontSize: 30.0,                         //글자 사이즈
                    letterSpacing: 20.0,                  //글자 자간
                    fontWeight: FontWeight.bold,    //글자 굵게
                ),
                ),
                Text("일본"),
                Text("중국"),
              Divider(
                height: 30,
                color: Colors.blue,
                thickness: 5,
              ),
            ],
          ),
        ),
    );
  }
}

 

반응형

댓글