1000sj
SJ CODE
1000sj
전체 방문자
오늘
어제
  • 분류 전체보기
    • Security
      • 네트워크
      • 보안
      • CTF
      • Exploit
      • Fuzzing
    • System Programming
      • Kernel
      • Operating System
      • Compiler
      • Device Driver
      • Emulator
      • Parrelel Processing
      • Assembly
    • Application Programming
      • Script
      • Android
    • Cloud Computing
      • Cloud Native
      • Public Cloud
      • Infrastructure
      • Database
      • DevOps
    • TroubleShooting
    • ETC
      • 문화 생활
      • 커뮤니티

인기 글

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
1000sj

SJ CODE

[Flutter] StatelessWidget
Application Programming

[Flutter] StatelessWidget

2021. 5. 27. 13:44

Demo

import 'package:flutter/material.dart';

void main() => runApp(MyApp()); // runApp은 최상위, 매개변수로 위젯을 받음

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false, // 우측 상단 빨간띠없애기
      title: 'First app',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Grade(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('하이헬로난승주라고해'),
        centerTitle: true,
        backgroundColor: Colors.redAccent,
        elevation: 0.0, //app bar 그림자효과 없애기
      ),
      // body: Center(
      //   child: Column(
      //     children: <Widget>[Text('Hello'), Text('Hello'), Text('Hello')],
      //   ),
      // ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[Text('하이헬로'), Text('난'), Text('승주라고해')],
        ),
      ),
    );
  }
}

class Grade extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.amber[800],
      appBar: AppBar(
        title: Text('하이헬로난승주라고해'),
        backgroundColor: Colors.amber[700],
        centerTitle: true,
        elevation: 0.0,
      ),
      body: Padding(
          padding: EdgeInsets.fromLTRB(30.0, 40.0, 0.0, 0.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Center(
                child: CircleAvatar(
                  backgroundImage: AssetImage('assets/test.png'),
                  radius: 60.0,
                ),
              ),
              Divider(
                height: 60.0, // 위에서 30 아래에서 30 떨어져잇음
                color: Colors.grey[850],
                thickness: 0.5,
                endIndent: 30.0,
              ),
              Text(
                'NAME',
                style: TextStyle(
                  color: Colors.white,
                  letterSpacing: 2.0,
                ),
              ),
              SizedBox(
                height: 10.0,
              ),
              Text(
                '하이헬로난승주라고해',
                style: TextStyle(
                    color: Colors.white,
                    letterSpacing: 2.0,
                    fontSize: 28.0,
                    fontWeight: FontWeight.bold),
              ),
              SizedBox(
                height: 10.0,
              ),
              Text(
                'POWER LEVEL',
                style: TextStyle(
                  color: Colors.white,
                  letterSpacing: 2.0,
                ),
              ),
              SizedBox(
                height: 10.0,
              ),
              Text(
                '14',
                style: TextStyle(
                    color: Colors.white,
                    letterSpacing: 2.0,
                    fontSize: 28.0,
                    fontWeight: FontWeight.bold),
              ),
              SizedBox(
                height: 30.0,
              ),
              Row(
                children: <Widget>[
                  Icon(Icons.check_circle_outline),
                  SizedBox(
                    width: 10.0,
                  ),
                  Text(
                    'using lightsaber',
                    style: TextStyle(fontSize: 16.0, letterSpacing: 1.0),
                  ),
                ],
              ),
              Row(
                children: <Widget>[
                  Icon(Icons.check_circle_outline),
                  SizedBox(
                    width: 10.0,
                  ),
                  Text(
                    'facce hero tattoo',
                    style: TextStyle(fontSize: 16.0, letterSpacing: 1.0),
                  ),
                ],
              ),
              Row(
                children: <Widget>[
                  Icon(Icons.check_circle_outline),
                  SizedBox(
                    width: 10.0,
                  ),
                  Text(
                    'fire flames',
                    style: TextStyle(fontSize: 16.0, letterSpacing: 1.0),
                  ),
                ],
              ),
              Center(
                child: CircleAvatar(
                  backgroundImage: AssetImage('assets/testTwo.jpg'),
                  radius: 40.0,
                  backgroundColor: Colors.amber[800],
                ),
              )
            ],
          )),
    );
  }
}

'Application Programming' 카테고리의 다른 글

[Typescript]  (0) 2021.10.15
[Node.js] Modules  (0) 2021.09.20
[Node.js] Node.js 설치  (0) 2021.09.19
[Flutter] HTTP 통신  (0) 2021.09.07
[Flutter] 포켓몬도감  (0) 2021.09.06
    'Application Programming' 카테고리의 다른 글
    • [Node.js] Modules
    • [Node.js] Node.js 설치
    • [Flutter] HTTP 통신
    • [Flutter] 포켓몬도감
    1000sj
    1000sj

    티스토리툴바