show admin
This commit is contained in:
parent
1abd80e9ba
commit
e8b0d87b2e
3 changed files with 87 additions and 97 deletions
Binary file not shown.
|
|
@ -46,108 +46,99 @@ class SettingsPage extends StatelessWidget {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.0.w),
|
padding: EdgeInsets.symmetric(horizontal: 10.0.w),
|
||||||
child: Expanded(
|
child: Column(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
children: [
|
||||||
children: [
|
Divider(
|
||||||
Divider(
|
height: 1,
|
||||||
height: 1,
|
color: borderGray.withOpacity(0.2),
|
||||||
color: borderGray.withOpacity(0.2),
|
),
|
||||||
|
SharedPrefButton<bool>.builder(
|
||||||
|
spKey: 'sound_on',
|
||||||
|
builder: (enabled, _) => AbsorbPointer(
|
||||||
|
child: SwitchTile(
|
||||||
|
text: 'Звук',
|
||||||
|
value: enabled ?? false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
setOnTap: (v) => !(v ?? false),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
color: borderGray.withOpacity(0.2),
|
||||||
|
),
|
||||||
|
SharedPrefButton<bool>.builder(
|
||||||
|
spKey: 'auto_play_sound_view',
|
||||||
|
builder: (enabled, _) => AbsorbPointer(
|
||||||
|
child: SwitchTile(
|
||||||
|
text: 'Авто воспроизведение при просмотре',
|
||||||
|
value: enabled ?? false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
setOnTap: (v) => !(v ?? false),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
color: borderGray.withOpacity(0.2),
|
||||||
|
),
|
||||||
|
SharedPrefButton<bool>.builder(
|
||||||
|
spKey: 'auto_play_sound_tests',
|
||||||
|
builder: (enabled, _) => AbsorbPointer(
|
||||||
|
child: SwitchTile(
|
||||||
|
text: 'Авто воспроизведение в тестах',
|
||||||
|
value: enabled ?? false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
setOnTap: (v) => !(v ?? false),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
color: borderGray.withOpacity(0.2),
|
||||||
|
),
|
||||||
|
SimpleTile.text(
|
||||||
|
text: 'Скорость чтения',
|
||||||
|
trail: SharedPrefButton<double>.builder(
|
||||||
|
spKey: 'sound_speed',
|
||||||
|
builder: (v, s) => MnemoSlider(
|
||||||
|
onChanged: (value) => s(value),
|
||||||
|
value: v ?? 1.0,
|
||||||
|
),
|
||||||
|
shouldRebuild: (v) => false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
color: borderGray.withOpacity(0.2),
|
||||||
|
),
|
||||||
|
if (ADMIN_BUILD)
|
||||||
SharedPrefButton<bool>.builder(
|
SharedPrefButton<bool>.builder(
|
||||||
spKey: 'sound_on',
|
spKey: 'show_admin',
|
||||||
builder: (enabled, _) => AbsorbPointer(
|
builder: (enabled, _) => AbsorbPointer(
|
||||||
child: SwitchTile(
|
child: SwitchTile(
|
||||||
text: 'Звук',
|
text: 'Show admin',
|
||||||
value: enabled ?? false,
|
value: enabled ?? false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
setOnTap: (v) => !(v ?? false),
|
setOnTap: (v) => !(v ?? false),
|
||||||
),
|
),
|
||||||
Divider(
|
],
|
||||||
height: 1,
|
|
||||||
color: borderGray.withOpacity(0.2),
|
|
||||||
),
|
|
||||||
SharedPrefButton<bool>.builder(
|
|
||||||
spKey: 'auto_play_sound_view',
|
|
||||||
builder: (enabled, _) => AbsorbPointer(
|
|
||||||
child: SwitchTile(
|
|
||||||
text: 'Авто воспроизведение при просмотре',
|
|
||||||
value: enabled ?? false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
setOnTap: (v) => !(v ?? false),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 1,
|
|
||||||
color: borderGray.withOpacity(0.2),
|
|
||||||
),
|
|
||||||
SharedPrefButton<bool>.builder(
|
|
||||||
spKey: 'auto_play_sound_tests',
|
|
||||||
builder: (enabled, _) => AbsorbPointer(
|
|
||||||
child: SwitchTile(
|
|
||||||
text: 'Авто воспроизведение в тестах',
|
|
||||||
value: enabled ?? false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
setOnTap: (v) => !(v ?? false),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 5,
|
|
||||||
color: borderGray.withOpacity(0.2),
|
|
||||||
),
|
|
||||||
SimpleTile.text(
|
|
||||||
text: 'Скорость чтения',
|
|
||||||
trail: SharedPrefButton<double>.builder(
|
|
||||||
spKey: 'sound_speed',
|
|
||||||
builder: (v, s) => MnemoSlider(
|
|
||||||
onChanged: (value) => s(value),
|
|
||||||
value: v ?? 1.0,
|
|
||||||
),
|
|
||||||
shouldRebuild: (v) => false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 1,
|
|
||||||
color: borderGray.withOpacity(0.2),
|
|
||||||
),
|
|
||||||
if (ADMIN_BUILD)
|
|
||||||
SharedPrefButton<bool>.builder(
|
|
||||||
spKey: 'show_admin',
|
|
||||||
builder: (enabled, _) => AbsorbPointer(
|
|
||||||
child: SwitchTile(
|
|
||||||
text: 'Show admin',
|
|
||||||
value: enabled ?? false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
setOnTap: (v) => !(v ?? false),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Padding(
|
||||||
mainAxisSize: MainAxisSize.min,
|
padding:
|
||||||
children: [
|
EdgeInsets.only(left: 10.0.w, right: 10.w, top: 32.h),
|
||||||
SizedBox(
|
child: LinkButton(
|
||||||
height: 32.0.h,
|
'Политика конфиденциальности',
|
||||||
),
|
() {
|
||||||
Padding(
|
launchUrl(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.0.w),
|
Uri.parse(
|
||||||
child: LinkButton(
|
'https://www.freeprivacypolicy.com/live/1c2bce51-86c6-4a36-b226-b6c6f50ebf0f'),
|
||||||
'Политика конфиденциальности',
|
);
|
||||||
() {
|
},
|
||||||
launchUrl(
|
),
|
||||||
Uri.parse(
|
|
||||||
'https://www.freeprivacypolicy.com/live/1c2bce51-86c6-4a36-b226-b6c6f50ebf0f'),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
const BigBackButton(),
|
const BigBackButton(),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class UserStatistics extends StatelessWidget {
|
||||||
final lastDigit = learnedWordsLength % 10;
|
final lastDigit = learnedWordsLength % 10;
|
||||||
final String? totalWordsText;
|
final String? totalWordsText;
|
||||||
if (learnedWordsLength == 0) {
|
if (learnedWordsLength == 0) {
|
||||||
totalWordsText = null;
|
totalWordsText = 'Словарик';
|
||||||
} else if (lastDigit == 0 || lastDigit >= 5) {
|
} else if (lastDigit == 0 || lastDigit >= 5) {
|
||||||
totalWordsText = 'Ты уже знаешь $learnedWordsLength слов!';
|
totalWordsText = 'Ты уже знаешь $learnedWordsLength слов!';
|
||||||
} else if (lastDigit == 1) {
|
} else if (lastDigit == 1) {
|
||||||
|
|
@ -37,17 +37,16 @@ class UserStatistics extends StatelessWidget {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
padding: EdgeInsets.only(bottom: 8.0.h, top: 8.0.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (totalWordsText != null)
|
Text(
|
||||||
Text(
|
totalWordsText,
|
||||||
totalWordsText,
|
style: TextStyle(
|
||||||
style: TextStyle(
|
fontSize: 18,
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue