我正在使用 argon_buttons_flutter 1.1.0 包來創建一個計時器按鈕,它作業得很好。我只是有一個問題,我可以在這個按鈕上添加一個圖示嗎?就像當我使用提升按鈕左右時一樣,我可以通過將其設為 ElevatedButton.icon 來做到這一點,但它似乎不適用于這個我認為這是因為這是一個自定義按鈕。有沒有辦法給它添加一個圖示?
這是按鈕的代碼:
ArgonTimerButton(
initialTimer: 60, // Optional
height: 50,
width: MediaQuery.of(context).size.width * 0.45,
minWidth: MediaQuery.of(context).size.width * 0.30,
color: Color(0xFF7866FE),
borderRadius: 5.0,
child: const Text(
"Resend Verification Email",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w700
),
),
loader: (timeLeft) {
return Text(
"Resend Verification Email in | $timeLeft",
style: const TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w700
),
);
},
onTap: (startTimer, btnState) async {
if (btnState == ButtonState.Idle) {
await sendVerificationEmail();
startTimer(60);
}
},
),
uj5u.com熱心網友回復:
您可以使用子項上的Row添加圖示
ArgonTimerButton(
initialTimer: 60, // Optional
height: 50,
width:
MediaQuery.of(context).size.width * 0.45,
minWidth:
MediaQuery.of(context).size.width * 0.30,
color: Color(0xFF7866FE),
borderRadius: 5.0,
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(Icons.add),
Text(
"Resend Verification Email",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w700),
),
],
),
loader: (timeLeft) {
return Text(
"Resend Verification Email in | $timeLeft",
style: const TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w700),
);
},
onTap: (startTimer, btnState) async {
if (btnState == ButtonState.Idle) {
await sendVerificationEmail();
startTimer(60);
}
},
),
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/498367.html
下一篇:Base64隱寫
