반응형 Flutter11 [Flutter] DropdownButton A value of type 'Object?' can't be assigned to a variable of type 'String'. 오류 [문제점] 플러터에 DropdownButton을 구글검색으로 나온 것과 같이 구현하는데 오류가 발생하였다. 오류가 난 코드는 아래와 같다. class DropdownEaxampleState extends State { final List _valueList = ['month', 'two weeks', 'week']; String _selectedValue = 'week'; @override Widget build(BuildContext context) { return DropdownButton( value: _selectedValue, items: _valueList.map((value) { return DropdownMenuItem( value: value, child: Text(value), ); }.. 2022. 1. 5. [Flutter] Container 배경 이미지 넣기 flutter 에서 배경에 이미지를 넣는 방법은 크게 2가지가 있다. Stack을 사용해서 아래에 이미지를 넣을 수도 있고, Container에 decoration을 사용해서 이미지를 넣을 수도 있습니다. 이번 글에서는 decoration을 사용해서 이미지를 넣어보겠습니다. import 'package:flutter/material.dart'; class Page extends StatelessWidget { const Page({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( body: Container( decoration: BoxDecoration( image: Decoration.. 2022. 1. 3. 이전 1 2 다음 반응형