switchButton static method

Widget switchButton({
  1. String? text,
})

Implementation

static Widget switchButton({String? text}) {
  return GetBuilder<PWThemeController>(
    init: PWThemeController(),
    builder: (theme) {
      return SizedBox(
        width: 250,
        child: SwitchListTile(
          title: Text(text ?? (theme.isDark ? 'Light Mode' : 'Dark Mode')),
          value: theme.isDark,
          onChanged: theme.changeThemeMode,
          activeColor: Colors.grey[600],
        ),
      );
    },
  );
}