2024-04-30 19:25:16 +02:00
|
|
|
import 'package:cofounderella/themes/theme_provider.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
2024-04-29 17:11:35 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2024-04-30 19:25:16 +02:00
|
|
|
import 'package:provider/provider.dart';
|
2024-04-29 17:11:35 +02:00
|
|
|
|
|
|
|
class SettingsPage extends StatelessWidget {
|
|
|
|
const SettingsPage({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
2024-06-03 23:22:43 +02:00
|
|
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
2024-04-29 17:11:35 +02:00
|
|
|
appBar: AppBar(
|
|
|
|
title: const Text("Settings"),
|
|
|
|
),
|
2024-04-30 19:25:16 +02:00
|
|
|
body: Container(
|
|
|
|
decoration: BoxDecoration(
|
2024-06-18 02:24:42 +02:00
|
|
|
color: Theme.of(context).colorScheme.secondaryContainer,
|
2024-04-30 19:25:16 +02:00
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
),
|
|
|
|
margin: const EdgeInsets.all(25),
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
// dark mode switch
|
|
|
|
const Text("Dark Mode"),
|
2024-06-19 19:31:18 +02:00
|
|
|
Consumer<ThemeProvider>(
|
|
|
|
builder: (context, themeProvider, child) {
|
|
|
|
return CupertinoSwitch(
|
|
|
|
value: themeProvider.isDarkMode,
|
|
|
|
onChanged: (value) {
|
|
|
|
themeProvider.toggleTheme();
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
2024-04-30 19:25:16 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|