how to make factor level selectinput filed in shiny flex dashboard

sample type gender
sample1 group1 Male
sample2 group1 Female
sample3 group1 Male
sample4 group2 Female
sample5 group2 Female

Suppose user have uploaded above csv file and data stored as reactive object - metadata() . how can we create three selectinput fileds variable , condition1 and condition2 in dashboard,

such that varible filed show type and gender.

condition1 and condition2 fields show ; group1 and group2 (means all the levels of type) ; if user selects variable as type.

similarly condition1 and condition2 fields show ; Male and Female (means all the levels of gender) ; if user selects variable as gender.

please help