• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Flutter 게시판 긴급) appBar 색상 이슈

긴급) appBar 색상 이슈

  • 이 주제에는 1개 답변, 2명 참여가 있으며 codingapple1 년 전에 전에 마지막으로 업데이트했습니다.
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 글쓴이
  • #124382

    Cheol
    참가자
    -- 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가 아니여도 전부 조금씩 탁해집니다..
    
    스크린샷 2024-05-28 오후 5.15.30
    
    
    #124393

    codingapple
    키 마스터
    https://stackoverflow.com/q/77537315/22444723 useMaterial3: false 넣어보거나 
    surfaceTintColor 조절해봅시다
    
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠