contac and calendar update

This commit is contained in:
2025-11-08 12:26:18 +01:00
parent 05044691b6
commit 8359b8c49e
13 changed files with 1037 additions and 532 deletions
+102 -100
View File
@@ -178,121 +178,123 @@ Future<void> _saveLanguage(String language) async {
showDialog(
context: context,
builder: (context) {
return Dialog(
backgroundColor: Colors.grey[900],
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
child: Padding(
padding: const EdgeInsets.all(24.0),
child: StatefulBuilder(
builder: (context, setState) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"${_t('Camera')} ${index + 1}",
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: TextField(
controller: controller,
style: const TextStyle(color: Colors.white),
return RepaintBoundary(
child: Dialog(
backgroundColor: Colors.grey[900],
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
child: Padding(
padding: const EdgeInsets.all(24.0),
child: StatefulBuilder(
builder: (context, setState) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"${_t('Camera')} ${index + 1}",
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
decoration: InputDecoration(
filled: true,
fillColor: Colors.grey[800],
hintText: _t("Enter Camera IP"),
hintStyle: const TextStyle(color: Colors.white54),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: _getColorFromName(_selectedBulletColor)),
),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: TextField(
controller: controller,
style: const TextStyle(color: Colors.white),
textAlign: TextAlign.center,
decoration: InputDecoration(
filled: true,
fillColor: Colors.grey[800],
hintText: _t("Enter Camera IP"),
hintStyle: const TextStyle(color: Colors.white54),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: _getColorFromName(_selectedBulletColor)),
),
),
),
),
),
const SizedBox(height: 24),
const SizedBox(height: 24),
// Save Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
String newIP = controller.text.trim();
if (newIP.isNotEmpty) {
await _saveCameraIP(index, newIP);
// Save Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
String newIP = controller.text.trim();
if (newIP.isNotEmpty) {
await _saveCameraIP(index, newIP);
if (context.mounted) {
Navigator.pop(context);
}
}
},
style: ElevatedButton.styleFrom(
backgroundColor: _getColorFromName(_selectedBulletColor),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(_t("Save")),
),
),
const SizedBox(height: 12),
// Reset Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
await _clearCameraIP(index);
if (context.mounted) {
Navigator.pop(context);
}
}
},
style: ElevatedButton.styleFrom(
backgroundColor: _getColorFromName(_selectedBulletColor),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[700],
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(_t("Reset to Default")),
),
child: Text(_t("Save")),
),
),
const SizedBox(height: 12),
const SizedBox(height: 12),
// Reset Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
await _clearCameraIP(index);
if (context.mounted) {
Navigator.pop(context);
}
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[700],
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
// Cancel Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[800],
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(_t("Cancel")),
),
child: Text(_t("Reset to Default")),
),
),
const SizedBox(height: 12),
// Cancel Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[800],
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(_t("Cancel")),
),
),
],
);
},
],
);
},
),
),
),
);