buttonType method

Widget buttonType({
  1. required S button,
  2. required BuildContext context,
})

Implementation

Widget buttonType(
    {required S button,
      required BuildContext context}) {

  return OutlinedButton(
    onPressed: () async {
      debugPrint("button:${button.name} clicked");
      Navigator.push(
        context,
        PageTransition(
          type: PageTransitionType.fade,
          child: MediaQuery(
            data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
            child: Container(
              color: Theme.of(context).colorScheme.background,
              child: SafeArea(
                child: await button.onTap(context),
              ),
            ),
          ),
          isIos: true,
          duration: const Duration(milliseconds: 400),
        ),
      );
    },
    style: OutlinedButton.styleFrom(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10),
      ),
      side: BorderSide(
          color: Theme.of(context).textTheme.bodyMedium!.color!,
          width: 2), // 테두리 색상과 두께 설정
    ),
    child: Text(button.name)
        .fontWeight(FontWeight.bold)
        .textColor(Theme.of(context).textTheme.bodyMedium!.color!)
        .padding(vertical: 15, horizontal: 20),
  ).padding(
    horizontal: 20,
    vertical: 7,
  );
}