Created
March 31, 2020 07:06
-
-
Save spiritinlife/8d23531aa97397f2e032870cd9a7f73b to your computer and use it in GitHub Desktop.
Issue with OutlineInputBorder and DropdownButtonFormField: Button is not clickable due to decoration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("Dropdown test"), | |
), | |
body: Center( | |
child: DropdownButtonFormField<String>( | |
decoration: InputDecoration( | |
border: OutlineInputBorder(), | |
labelText: "Select option", | |
), | |
items: ["1", "2", "3"] | |
.map<DropdownMenuItem<String>>( | |
(option) => DropdownMenuItem<String>( | |
value: option, | |
child: Text(option), | |
), | |
) | |
.toList(), | |
onChanged: (val) {}, | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment