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)), fontWeight: FontWeight.w600)),
backgroundColor: AppColors.of(context).background)); 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) { if (thumbColor != null) {
canvas.drawCircle( canvas.drawCircle(
Offset(0.0, size.height * 0.4), Offset(0.0, size.height * 0.4),
size.height * (fullThumbColor ? 1.0 : 0.65), size.height * (fullThumbColor ? 1.0 : 0.75),
Paint() Paint()
..color = thumbColor! ..color = thumbColor!
..style = PaintingStyle.fill); ..style = PaintingStyle.fill);

View File

@ -263,7 +263,7 @@ class NotificationsScreen extends StatelessWidget {
), ),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0), 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", "privacy": "Adatvédelmi irányelvek",
"licenses": "Licencek", "licenses": "Licencek",
"vibrate": "Rezgés", "vibrate": "Rezgés",
"voff": "Kikapcsolás", "voff": "Ki",
"vlight": "Alacsony", "vlight": "Gyenge",
"vmedium": "Közepes", "vmedium": "Normál",
"vstrong": "Erős", "vstrong": "Erős",
"cancel": "Mégsem", "cancel": "Mégsem",
"done": "Kész", "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/utils/format.dart';
import 'package:refilc_mobile_ui/common/panel/panel_button.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/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/settings_helper.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -57,13 +58,13 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
SettingsHelper.localizedPageTitles()[settingsProvider.startPage] ?? "?"; SettingsHelper.localizedPageTitles()[settingsProvider.startPage] ?? "?";
String languageText = String languageText =
SettingsHelper.langMap[settingsProvider.language] ?? "?"; SettingsHelper.langMap[settingsProvider.language] ?? "?";
String vibrateTitle = { // String vibrateTitle = {
VibrationStrength.off: "voff".i18n, // VibrationStrength.off: "voff".i18n,
VibrationStrength.light: "vlight".i18n, // VibrationStrength.light: "vlight".i18n,
VibrationStrength.medium: "vmedium".i18n, // VibrationStrength.medium: "vmedium".i18n,
VibrationStrength.strong: "vstrong".i18n, // VibrationStrength.strong: "vstrong".i18n,
}[settingsProvider.vibrate] ?? // }[settingsProvider.vibrate] ??
"?"; // "?";
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
@ -253,38 +254,38 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
), ),
], ],
), ),
SplittedPanel( // SplittedPanel(
padding: const EdgeInsets.only(top: 9.0), // padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0), // cardPadding: const EdgeInsets.all(4.0),
isSeparated: true, // isSeparated: true,
children: [ // children: [
PanelButton( // PanelButton(
onPressed: () { // onPressed: () {
SettingsHelper.vibrate(context); // SettingsHelper.vibrate(context);
setState(() {}); // setState(() {});
}, // },
title: Text( // title: Text(
"vibrate".i18n, // "vibrate".i18n,
style: TextStyle( // style: TextStyle(
color: AppColors.of(context).text.withOpacity(.95), // color: AppColors.of(context).text.withOpacity(.95),
), // ),
), // ),
leading: Icon( // leading: Icon(
FeatherIcons.radio, // FeatherIcons.radio,
size: 22.0, // size: 22.0,
color: AppColors.of(context).text.withOpacity(.95), // color: AppColors.of(context).text.withOpacity(.95),
), // ),
trailing: Text( // trailing: Text(
vibrateTitle, // vibrateTitle,
style: const TextStyle(fontSize: 14.0), // style: const TextStyle(fontSize: 14.0),
), // ),
borderRadius: const BorderRadius.vertical( // borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0), // top: Radius.circular(12.0),
bottom: Radius.circular(12.0), // bottom: Radius.circular(12.0),
), // ),
), // ),
], // ],
), // ),
SplittedPanel( SplittedPanel(
padding: const EdgeInsets.only(top: 9.0), padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.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:dropdown_button2/dropdown_button2.dart';
import 'package:refilc/api/providers/user_provider.dart'; import 'package:refilc/api/providers/user_provider.dart';
import 'package:refilc/helpers/subject.dart'; import 'package:refilc/helpers/subject.dart';
import 'package:refilc/models/icon_pack.dart';
import 'package:refilc/models/settings.dart'; import 'package:refilc/models/settings.dart';
import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc/theme/observer.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_kreta_api/providers/timetable_provider.dart';
import 'package:refilc_mobile_ui/common/panel/panel_button.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/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/settings_helper.dart';
import 'package:refilc_mobile_ui/screens/settings/submenu/edit_subject.dart'; import 'package:refilc_mobile_ui/screens/settings/submenu/edit_subject.dart';
import 'package:refilc_mobile_ui/screens/settings/submenu/paint_list.dart'; import 'package:refilc_mobile_ui/screens/settings/submenu/paint_list.dart';
@ -458,37 +460,37 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
], ],
), ),
// change subject icons // change subject icons
SplittedPanel( // SplittedPanel(
padding: const EdgeInsets.only(top: 9.0), // padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0), // cardPadding: const EdgeInsets.all(4.0),
isSeparated: true, // isSeparated: true,
children: [ // children: [
PanelButton( // PanelButton(
onPressed: () { // onPressed: () {
SettingsHelper.iconPack(context); // SettingsHelper.iconPack(context);
}, // },
title: Text( // title: Text(
"icon_pack".i18n, // "icon_pack".i18n,
style: TextStyle( // style: TextStyle(
color: AppColors.of(context).text.withOpacity(.95), // color: AppColors.of(context).text.withOpacity(.95),
), // ),
), // ),
leading: Icon( // leading: Icon(
FeatherIcons.grid, // FeatherIcons.grid,
size: 22.0, // size: 22.0,
color: AppColors.of(context).text.withOpacity(.95), // color: AppColors.of(context).text.withOpacity(.95),
), // ),
trailing: Text( // trailing: Text(
settingsProvider.iconPack.name.capital(), // settingsProvider.iconPack.name.capital(),
style: const TextStyle(fontSize: 14.0), // style: const TextStyle(fontSize: 14.0),
), // ),
borderRadius: const BorderRadius.vertical( // borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0), // top: Radius.circular(12.0),
bottom: Radius.circular(12.0), // bottom: Radius.circular(12.0),
), // ),
), // ),
], // ],
), // ),
// grade colors // grade colors
SplittedPanel( SplittedPanel(
padding: const EdgeInsets.only(top: 9.0), 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 // custom fonts
const SizedBox( const SizedBox(
height: 18.0, height: 18.0,