Skip to content

Commit f4af459

Browse files
committed
fix: hide gender icon when gender is unspecified
1 parent 8e059e7 commit f4af459

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lib/components/cards/user_info_card.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,18 @@ class UserInfoCard extends StatelessWidget {
263263
),
264264
),
265265
Padding(
266-
padding: const EdgeInsets.only(left: 20, top: 4),
267-
child: Row(
268-
children: [
269-
Icon(data.gender == 1 ? Icons.male : Icons.female, size: 20.0),
270-
SizedBox(width: 5),
271-
Text(
272-
'${DateUtil.fromToday(data.logintime)}活跃',
273-
style: const TextStyle(
274-
fontSize: 14,
275-
),
276-
),
277-
],
278-
)),
266+
padding: const EdgeInsets.only(left: 20, top: 4),
267+
child: (data.gender == 0 || data.gender == 1)
268+
? Row(
269+
children: [
270+
Icon(data.gender == 1 ? Icons.male : Icons.female,
271+
size: 20.0),
272+
SizedBox(width: 5),
273+
Text('${DateUtil.fromToday(data.logintime)}活跃'),
274+
],
275+
)
276+
: Text('${DateUtil.fromToday(data.logintime)}活跃'),
277+
),
279278
],
280279
);
281280
}

0 commit comments

Comments
 (0)