upgradeToPrimaryBottomSheet function

Future upgradeToPrimaryBottomSheet({
  1. required BuildContext context,
  2. ContactInfoType? type,
  3. String? value,
})

shows bottom sheet to render SetContactToPrimary takes contact type and a value which can be phone or email

Implementation

Future<dynamic> upgradeToPrimaryBottomSheet(
    {required BuildContext context,
    ContactInfoType? type,
    String? value}) async {
  final ContactProvider? provider = ContactProvider.of(context);
  return showModalBottomSheet(
      context: context,
      backgroundColor: Colors.transparent,
      isScrollControlled: true,
      builder: (BuildContext context) {
        return Padding(
          padding: MediaQuery.of(context).viewInsets,
          child: Align(
            alignment: Alignment.bottomCenter,
            child: Container(
              decoration: const BoxDecoration(
                color: Colors.white,
                // borderRadius: BorderRadius.all(Radius.circular(20)),
              ),
              constraints: const BoxConstraints(
                maxWidth: 420,
              ),
              padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
              // margin: EdgeInsets.all(5),
              child: SingleChildScrollView(
                child: SetContactToPrimary(
                  type: type,
                  value: value,
                  provider: provider,
                ),
              ),
            ),
          ),
        );
      });
}