refactor(diary): Refactoring for settings done

This commit is contained in:
2024-03-06 11:44:20 +03:00
parent 3019a5a264
commit 00b1452cef
8 changed files with 664 additions and 593 deletions

View File

@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
import 'package:eatvio_app/core/app_export.dart';
class NotificationSwitch extends StatefulWidget {
final String title;
NotificationSwitch(this.title);
@override
_NotificationSwitchState createState() => _NotificationSwitchState();
}
class _NotificationSwitchState extends State<NotificationSwitch> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.title,
style: TextStyle(
color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold),
),
Switch(
value: switchValue,
onChanged: toggleSwitch(),
inactiveThumbColor: appTheme.blueA400,
inactiveTrackColor: Colors.white,
activeTrackColor: appTheme.blueA400,
activeColor: Colors.white,
),
],
);
}
toggleSwitch() {
return (value) {
setState(() {
switchValue = value;
});
};
}
}