본문 바로가기

개발32

Flutter의 ElevatedButton 색상 ElevatedButton은 배경색을 적용하여도 tint값과 섞인 색상이 나오게 된다. 디자이너가 지정한 정확한 색상을 버튼에 적용하기 위해선 아래 코드와 같이 surfaceTintColor에도 같은 색상을 적용해줘야만 한다. ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: Color.fromARGB(255, 3, 199, 90), surfaceTintColor: Color.fromARGB(255, 3, 199, 90), foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), onPressed: (.. 2022. 11. 28.
flutter로 만든 macos app에서 network 설정 DEBUG: macos/Runner/DebugProfile.entitlements RELEASE : macos/Runner/Release.entitlements 각 환경에 맞는 파일에 com.apple.security.network.client 항목을 추가해주어야 한다. 2022. 11. 12.
flutter에서 다크모드 테마 적용하기 플러터로 만든 앱에 다크모드와 같은 테마를 적용하기 위해선 MyApp의 MaterialApp에 theme 파라메터만 설정해주면 된다. ThemeData 객체에 원하는값을 셋팅해준 후 theme(기본테마)와 dartTheme(다크테마)에 설정해주도록 하자. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( brightness: Bright.. 2022. 8. 29.
flutter에서 responsive 구현하기 flutter는 iOS, Android, Windows, MacOS, Linux, Web의 6가지 플렛폼을 하나의 코드로 지원한다. 하지만 각각의 기기는 모바일이냐 데스크탑이냐에 따라 화면 크기가 다르고 보여줄 정보의 양도 다르다. 이 글에서는 flutter에서 반응형 디자인을 적용하여 모바일과 데스크탑 모두에 적합하게 보이는 화면을 구현해보도록 하겠다. import 'package:flutter/material.dart'; class ResponsiveLayout extends StatelessWidget { final Widget phone; final Widget tablet; final Widget desktop; const ResponsiveLayout({ required this.phone, .. 2022. 8. 27.