[flutter] 텍스트 버튼

5336 단어 flutterflutter
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(
      home: Scaffold(
        appBar: AppBar( title: Text('안녕'),),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('텍스트'),
              Icon(Icons.star),
              Container(child: Text('컨테이너 안이야'), color: Colors.red,),
              TextButton(
                child: Text('난 텍스트버튼'),
              onPressed: (){
                  print('텍스트 버튼 눌림');
              },
              ),
            ],
          )
        ),
      ),
    );
  }
}

좋은 웹페이지 즐겨찾기