fix fix fix

This commit is contained in:
Kima 2024-03-27 21:11:09 +01:00
parent 81e57d2f38
commit d9ec195233
6 changed files with 188 additions and 76 deletions

View File

@ -174,7 +174,8 @@ class FilcColorPickerState extends State<FilcColorPicker> {
fontWeight: FontWeight.w600)),
backgroundColor: AppColors.of(context).background));
},
displayThumbColor: widget.displayThumbColor,
// displayThumbColor: widget.displayThumbColor,
displayThumbColor: true,
);
}

View File

@ -275,7 +275,7 @@ class ThumbPainter extends CustomPainter {
if (thumbColor != null) {
canvas.drawCircle(
Offset(0.0, size.height * 0.4),
size.height * (fullThumbColor ? 1.0 : 0.65),
size.height * (fullThumbColor ? 1.0 : 0.75),
Paint()
..color = thumbColor!
..style = PaintingStyle.fill);

View File

@ -263,7 +263,7 @@ class NotificationsScreen extends StatelessWidget {
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(4.0)),
bottom: Radius.circular(12.0)),
)
],
)

View File

@ -147,9 +147,9 @@ extension SettingsLocalization on String {
"privacy": "Adatvédelmi irányelvek",
"licenses": "Licencek",
"vibrate": "Rezgés",
"voff": "Kikapcsolás",
"vlight": "Alacsony",
"vmedium": "Közepes",
"voff": "Ki",
"vlight": "Gyenge",
"vmedium": "Normál",
"vstrong": "Erős",
"cancel": "Mégsem",
"done": "Kész",

View File

@ -3,6 +3,7 @@ import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc/utils/format.dart';
import 'package:refilc_mobile_ui/common/panel/panel_button.dart';
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
import 'package:refilc_mobile_ui/common/widgets/custom_segmented_control.dart';
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -57,13 +58,13 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
SettingsHelper.localizedPageTitles()[settingsProvider.startPage] ?? "?";
String languageText =
SettingsHelper.langMap[settingsProvider.language] ?? "?";
String vibrateTitle = {
VibrationStrength.off: "voff".i18n,
VibrationStrength.light: "vlight".i18n,
VibrationStrength.medium: "vmedium".i18n,
VibrationStrength.strong: "vstrong".i18n,
}[settingsProvider.vibrate] ??
"?";
// String vibrateTitle = {
// VibrationStrength.off: "voff".i18n,
// VibrationStrength.light: "vlight".i18n,
// VibrationStrength.medium: "vmedium".i18n,
// VibrationStrength.strong: "vstrong".i18n,
// }[settingsProvider.vibrate] ??
// "?";
return Scaffold(
appBar: AppBar(
@ -253,38 +254,38 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
),
],
),
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
onPressed: () {
SettingsHelper.vibrate(context);
setState(() {});
},
title: Text(
"vibrate".i18n,
style: TextStyle(
color: AppColors.of(context).text.withOpacity(.95),
),
),
leading: Icon(
FeatherIcons.radio,
size: 22.0,
color: AppColors.of(context).text.withOpacity(.95),
),
trailing: Text(
vibrateTitle,
style: const TextStyle(fontSize: 14.0),
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
// SplittedPanel(
// padding: const EdgeInsets.only(top: 9.0),
// cardPadding: const EdgeInsets.all(4.0),
// isSeparated: true,
// children: [
// PanelButton(
// onPressed: () {
// SettingsHelper.vibrate(context);
// setState(() {});
// },
// title: Text(
// "vibrate".i18n,
// style: TextStyle(
// color: AppColors.of(context).text.withOpacity(.95),
// ),
// ),
// leading: Icon(
// FeatherIcons.radio,
// size: 22.0,
// color: AppColors.of(context).text.withOpacity(.95),
// ),
// trailing: Text(
// vibrateTitle,
// style: const TextStyle(fontSize: 14.0),
// ),
// borderRadius: const BorderRadius.vertical(
// top: Radius.circular(12.0),
// bottom: Radius.circular(12.0),
// ),
// ),
// ],
// ),
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
@ -362,6 +363,72 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
),
],
),
// vibration option
const SizedBox(
height: 18.0,
),
SplittedPanel(
title: Text('vibrate'.i18n),
padding: EdgeInsets.zero,
cardPadding: EdgeInsets.zero,
isTransparent: true,
children: [
CustomSegmentedControl(
onChanged: (v) {
settingsProvider.update(
vibrate: v == 1
? VibrationStrength.light
: v == 2
? VibrationStrength.medium
: v == 3
? VibrationStrength.strong
: VibrationStrength.off,
);
setState(() {});
},
value: settingsProvider.vibrate == VibrationStrength.light
? 1
: settingsProvider.vibrate == VibrationStrength.medium
? 2
: settingsProvider.vibrate ==
VibrationStrength.strong
? 3
: 0,
height: 38,
children: [
Text(
'voff'.i18n,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.5,
),
),
Text(
'vlight'.i18n,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.5,
),
),
Text(
'vmedium'.i18n,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.5,
),
),
Text(
'vstrong'.i18n,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.5,
),
),
],
),
],
),
],
),
),

View File

@ -5,6 +5,7 @@ import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:refilc/api/providers/user_provider.dart';
import 'package:refilc/helpers/subject.dart';
import 'package:refilc/models/icon_pack.dart';
import 'package:refilc/models/settings.dart';
import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc/theme/observer.dart';
@ -15,6 +16,7 @@ import 'package:refilc_kreta_api/providers/grade_provider.dart';
import 'package:refilc_kreta_api/providers/timetable_provider.dart';
import 'package:refilc_mobile_ui/common/panel/panel_button.dart';
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
import 'package:refilc_mobile_ui/common/widgets/custom_segmented_control.dart';
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
import 'package:refilc_mobile_ui/screens/settings/submenu/edit_subject.dart';
import 'package:refilc_mobile_ui/screens/settings/submenu/paint_list.dart';
@ -458,37 +460,37 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
],
),
// change subject icons
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
onPressed: () {
SettingsHelper.iconPack(context);
},
title: Text(
"icon_pack".i18n,
style: TextStyle(
color: AppColors.of(context).text.withOpacity(.95),
),
),
leading: Icon(
FeatherIcons.grid,
size: 22.0,
color: AppColors.of(context).text.withOpacity(.95),
),
trailing: Text(
settingsProvider.iconPack.name.capital(),
style: const TextStyle(fontSize: 14.0),
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
// SplittedPanel(
// padding: const EdgeInsets.only(top: 9.0),
// cardPadding: const EdgeInsets.all(4.0),
// isSeparated: true,
// children: [
// PanelButton(
// onPressed: () {
// SettingsHelper.iconPack(context);
// },
// title: Text(
// "icon_pack".i18n,
// style: TextStyle(
// color: AppColors.of(context).text.withOpacity(.95),
// ),
// ),
// leading: Icon(
// FeatherIcons.grid,
// size: 22.0,
// color: AppColors.of(context).text.withOpacity(.95),
// ),
// trailing: Text(
// settingsProvider.iconPack.name.capital(),
// style: const TextStyle(fontSize: 14.0),
// ),
// borderRadius: const BorderRadius.vertical(
// top: Radius.circular(12.0),
// bottom: Radius.circular(12.0),
// ),
// ),
// ],
// ),
// grade colors
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
@ -830,6 +832,48 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
),
],
),
// subject icon shceme
const SizedBox(
height: 18.0,
),
SplittedPanel(
title: Text('icon_pack'.i18n),
padding: EdgeInsets.zero,
cardPadding: EdgeInsets.zero,
isTransparent: true,
children: [
CustomSegmentedControl(
onChanged: (v) {
settingsProvider.update(
iconPack:
v == 0 ? IconPack.material : IconPack.cupertino,
);
setState(() {});
},
value: settingsProvider.iconPack == IconPack.material
? 0
: 1,
height: 38,
children: const [
Text(
'Material',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 15,
),
),
Text(
'Cupertino',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 15,
),
),
],
),
],
),
// custom fonts
const SizedBox(
height: 18.0,