Gender

mail@pastecode.io avatar
unknown
dart
2 years ago
1.4 kB
2
Indexable
Never
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mobile/app/global_widgets/circular_block_button_widget.dart';
import 'package:mobile/app/services/controllers/specialities_providers.dart';

class GenderFilter extends GetView<SpecialitiesProvidersController>{
  @override
  Widget build(BuildContext context) {
    return Container(
        child: Column(
          children: <Widget>[
            addGenderRadioButton(0, 'All'.tr),
            SizedBox(height: 5,),
            addGenderRadioButton(1, 'Male'.tr),
            SizedBox(height: 5,),
            addGenderRadioButton(2, 'Female'.tr),
           
          ],
        ).paddingSymmetric(horizontal: 20,vertical: 20),
    );
  }
  Row addGenderRadioButton(int btnValue, String title) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        Obx(() => Radio(
              visualDensity: VisualDensity.compact,
              activeColor: Get.theme.accentColor,
              value: btnValue,
              groupValue: controller.selectedGender.value,
              onChanged: (value) {
                print(title);
                print(btnValue);
                controller.selectedGender.value = btnValue;
              },
            )),
        Text(title,style: TextStyle(fontSize: 15),)
      ],
    );
  }
}