-- main.dart --
import 'package:flutter/material.dart';
import 'package:instagram/style.dart';
import 'style.dart' as style;
void main() {
runApp(
MaterialApp(
theme: style.theme,
home: MyApp())
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Instagram", style: TextStyle(fontSize: 20),),
actions: [
IconButton(
icon: Icon(Icons.add_box_outlined),
iconSize: 30,
onPressed: () {},
)
],
),
body: Text('Hello Would'),
bottomNavigationBar: BottomNavigationBar(
showSelectedLabels: false,
showUnselectedLabels: false,
items: [
BottomNavigationBarItem(icon: Icon(Icons.home_outlined), label: '홈'),
BottomNavigationBarItem(icon: Icon(Icons.shopping_bag_outlined), label: '샵')
],
),
);
}
}
-- style.dart --
import 'package:flutter/material.dart';
var theme = ThemeData(
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
backgroundColor: Colors.grey,
)
),
iconTheme: IconThemeData(
color: Colors.blue,
),
appBarTheme: AppBarTheme(
backgroundColor: Colors.white,
titleTextStyle: TextStyle(color: Colors.black),
actionsIconTheme: IconThemeData(color: Colors.black),
elevation: 1.0,
shadowColor: Colors.black.withOpacity(0.5),
),
textTheme: TextTheme(),
);
플러터 강의 보며 잘 따라하고 있는데 앱바의 색상이 심상치 않습니다.
elevation: 1.0, 이걸 적용하자마자 탁한 색으로 바뀌는데 이거 해결 못하나요
배경색이 white가 아니여도 전부 조금씩 탁해집니다..