feat:theme changing done

This commit is contained in:
jahongireshonqulov
2025-11-01 15:37:05 +05:00
parent 44878e79b3
commit b734fc9ce6
9 changed files with 142 additions and 45 deletions

View File

@@ -1,21 +1,35 @@
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 Scaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Home"),
GradientSwitch(value:false, onChanged: (value) {
print(value);
}),
],
),
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),
],
),
);
},
);
}
}