import '../../../../../food_delivery_client.dart';
import '../../../common/presentation/blocs/theme_bloc/theme_bloc.dart';

class ProfilePage extends StatelessWidget {
  const ProfilePage({super.key});

  @override
  Widget build(BuildContext context) {
    return BlocBuilder<ThemeBloc, ThemeState>(
      builder: (context, state) {
        return Scaffold(
          body: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text("Home"),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("Dark mode"),
                  GradientSwitch(
                    value: state.themeMode == ThemeMode.dark,
                    onChanged: (value) {
                      context.read<ThemeBloc>().add(ThemeEvent.changed());
                    },
                  ),
                ],
              ).paddingSymmetric(horizontal: 20),
            ],
          ),
        );
      },
    );
  }
}
