ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • (flutter) 테마지정
    카테고리 없음 2020. 2. 20. 09:40
    반응형
    
    import 'package:flutter/material.dart';
    
    void main() => runApp(BMIApp());
    
    class BMIApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
    return MaterialApp(
    theme: ThemeData.dark().copyWith(
    floatingActionButtonTheme:FloatingActionButtonThemeData(backgroundColor: Colors.red),
    appBarTheme: AppBarTheme(color:Colors.red),
    ),
    home: Scaffold(
    appBar: AppBar(
    title: const Text('ThemeData Demo'),
    
    ),
    floatingActionButton: FloatingActionButton(
    child: const Icon(Icons.add),
    onPressed: () {},
    ),
    body: Center(
    child: Text(
    'Button pressed 0 times',
    ),
    ),
    ),
    );
    }
    }

    댓글

Designed by Tistory.