import 'package:flutter/material.dart'; class SettingItem { final String title; final String? subtitle; final bool? switchValue; final Color color; final ValueChanged? onSwitchChanged; final VoidCallback? onTap; bool selected = false; SettingItem._({ required this.title, this.subtitle, this.switchValue, required this.color, this.onSwitchChanged, this.onTap, }); factory SettingItem.switchItem({ required String title, String? subtitle, required Color color, required bool value, required ValueChanged onChanged, }) { return SettingItem._( title: title, subtitle: subtitle, switchValue: value, color: color, onSwitchChanged: onChanged, ); } factory SettingItem.navigationItem({ required String title, String? subtitle, bool? switchValue, required Color color, ValueChanged? onSwitchChanged, VoidCallback? onTap, }) { return SettingItem._( title: title, subtitle: subtitle, color: color, switchValue: switchValue, onSwitchChanged: onSwitchChanged, onTap: onTap, ); } factory SettingItem.SelectItem({ required String title, String? subtitle, required Color color, VoidCallback? onTap, }) { return SettingItem._( title: title, subtitle: subtitle, color: color, onTap: onTap, ); } }