图像我不想在我的ui中更改国家代码字体样式。我正在使用";intl_phone_ field 3.1.0";这个包裹。这是我的代码
Container(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[
Container(
child: IntlPhoneField(
showCountryFlag: false,
showDropdownIcon: false,
keyboardType: TextInputType.number,
style: TextStyle(
color: Colors.grey,
fontFamily: 'DMSans',
fontSize: 20,
fontWeight: FontWeight.bold),
decoration: InputDecoration(
counterText: '', border: InputBorder.none),
initialCountryCode: 'IN',
onChanged: (phone) {
print(phone.completeNumber);
print(phone.countryCode);
print(phone.number);
},
)),
],
)),
为国家代码使用一个变量,并将其分配给initialCountryCode。
String countryISOCode = 'IN';
对于国家/地区代码文本样式,可以使用。
dropdownTextStyle: TextStyle(),
完整的代码。
Container(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[
Container(
child: IntlPhoneField(
showCountryFlag: false,
showDropdownIcon: false,
dropdownTextStyle: TextStyle(
color: Colors.grey,
fontFamily: 'DMSans',
fontSize: 25,
fontWeight: FontWeight.bold),
keyboardType: TextInputType.number,
style: TextStyle(
color: Colors.grey,
fontFamily: 'DMSans',
fontSize: 25,
fontWeight: FontWeight.bold),
decoration: InputDecoration(
counterText: '', border: InputBorder.none),
initialCountryCode: 'IN',
onChanged: (phone) {
print(phone.completeNumber);
print(phone.countryCode);
print(phone.number);
},
)),
],
)),