如何在颤动中增加芯片的宽度

时间:2020-01-19 09:08:34

标签: android flutter dart

我想增加Chip()的宽度。我该如何实现?

Chip(                                       
  elevation: 6.0,                                      
  backgroundColor:  Colors.white,                                          
  shape: 
   RoundedRectangleBorder(                                            
   borderRadius: BorderRadius.circular(12.0)                                          ),                                          
   label: Text('09AM - 10AM'),                                 
),

1 个答案:

答案 0 :(得分:2)

您可以使用padding属性:

Chip(                                       
  elevation: 6.0,                                      
  backgroundColor:  Colors.white, 
  padding: const EdgeInsets.only(left :20, right : 20),
  shape: 
   RoundedRectangleBorder(                                            
   borderRadius: BorderRadius.circular(12.0)),                                          
   label: Text('09AM - 10AM'),                                 
),

https://api.flutter.dev/flutter/material/Chip/padding.html

https://api.flutter.dev/flutter/painting/EdgeInsets-class.html