如何设置InputDecoration的OutlineInputBorder的样式?

时间:2018-05-31 10:41:16

标签: flutter

我正试图设置TextFormField的边框。我正在使用OutlineInputBorder。它默认采用几乎黑色的颜色,焦点采用原色。我试图改变BorderSide的颜色,但它没有用。

我还尝试了UnderlineInputBordernew TextFormField( decoration: new InputDecoration( labelText: "Email", contentPadding: new EdgeInsets.all(12.0), filled: true, border: new OutlineInputBorder( borderSide: new BorderSide(width: 2.0, color: Colors.white), ) ), ), 提到的变通办法,但没有任何变化。

always @ (posedge clk) begin     
  if (x) begin 
    count <= count + 1'b1;
  end    
end

always @ (posedge clk) begin     
  if (y) begin 
    count <= count - 2'b10;
  end    
end

always @ (negedge clk) begin     
  if (x) begin 
    count <= count - 1'b1;
  end    
end

always @ ( count ) begin 
  ...do something... ;   
end

1 个答案:

答案 0 :(得分:2)

深挖后,似乎只能由ThemeData配置。所以我只是添加了一个主题小部件。

body: Theme(data: Theme.of(context).copyWith(
          primaryColor: Colors.white,
          accentColor: Colors.amber
      ), child: new TextFormField(
          decoration: new InputDecoration(
          labelText: "Email",
          contentPadding: new EdgeInsets.all(12.0),
      ),
),

input_decorator.dart#1440至50年

Color _getActiveColor(ThemeData themeData) {
    if (isFocused) {
      switch (themeData.brightness) {
        case Brightness.dark:
          return themeData.accentColor;
        case Brightness.light:
          return themeData.primaryColor;
      }
    }
    return themeData.hintColor;
  }