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(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.0.w),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Divider(
|
||||
height: 1,
|
||||
color: borderGray.withOpacity(0.2),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Divider(
|
||||
height: 1,
|
||||
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(
|
||||
spKey: 'sound_on',
|
||||
spKey: 'show_admin',
|
||||
builder: (enabled, _) => AbsorbPointer(
|
||||
child: SwitchTile(
|
||||
text: 'Звук',
|
||||
text: 'Show admin',
|
||||
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: 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(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 32.0.h,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.0.w),
|
||||
child: LinkButton(
|
||||
'Политика конфиденциальности',
|
||||
() {
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
'https://www.freeprivacypolicy.com/live/1c2bce51-86c6-4a36-b226-b6c6f50ebf0f'),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.only(left: 10.0.w, right: 10.w, top: 32.h),
|
||||
child: LinkButton(
|
||||
'Политика конфиденциальности',
|
||||
() {
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
'https://www.freeprivacypolicy.com/live/1c2bce51-86c6-4a36-b226-b6c6f50ebf0f'),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const BigBackButton(),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class UserStatistics extends StatelessWidget {
|
|||
final lastDigit = learnedWordsLength % 10;
|
||||
final String? totalWordsText;
|
||||
if (learnedWordsLength == 0) {
|
||||
totalWordsText = null;
|
||||
totalWordsText = 'Словарик';
|
||||
} else if (lastDigit == 0 || lastDigit >= 5) {
|
||||
totalWordsText = 'Ты уже знаешь $learnedWordsLength слов!';
|
||||
} else if (lastDigit == 1) {
|
||||
|
|
@ -37,17 +37,16 @@ class UserStatistics extends StatelessWidget {
|
|||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
padding: EdgeInsets.only(bottom: 8.0.h, top: 8.0.h),
|
||||
child: Row(
|
||||
children: [
|
||||
if (totalWordsText != null)
|
||||
Text(
|
||||
totalWordsText,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
maxLines: 1,
|
||||
Text(
|
||||
totalWordsText,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue