Files
Remever/lib/screens/settings/states/notifications.dart

104 lines
3.5 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:remever/common/resources.dart';
import 'package:remever/common/widgets/typography.dart';
import 'package:remever/components/extensions/context.dart';
import 'package:remever/screens/settings/cubit/settings_cubit.dart';
class NotificationsSettingsState extends StatelessWidget {
const NotificationsSettingsState({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.bg,
appBar: AppBar(
toolbarHeight: 66.h,
backgroundColor: AppColors.white,
shadowColor: Colors.transparent,
centerTitle: true,
title: AppTypography('Уведомления', type: SemiBold20px()),
leading: IconButton(
onPressed: () {
context.read<SettingsCubit>().toInitialState();
},
icon: Icon(CupertinoIcons.left_chevron),
color: Colors.black,
),
),
body: Padding(
padding: const EdgeInsets.all(16).r,
child: Column(
spacing: 10,
children: [
_buildInfoLine(
context,
'Напоминание о тренировке',
'Начнешь тренировку вовремя для эффективного запоминания. Уведомления будут приходить в период с 9:00 до 23:00',
),
_buildInfoLine(
context,
'От разработчика',
'Обновление приложения, скидки и акции',
),
_buildInfoLine(
context,
'Мои коллекции',
'Появление новых карточек в избранных коллекциях и новых коллекций у любимых авторов',
),
_buildInfoLine(
context,
'Авторам коллекций',
'Новые подписчики в ваших публичных коллекциях и предложенные ими карточки',
),
],
),
),
);
}
Widget _buildInfoLine(BuildContext context, String title, String subTitle) {
return GestureDetector(
onTap: () {},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.all(Radius.circular(12)).r,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16).r,
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTypography(
title,
type: Regular16px(),
color: Colors.black,
),
AppTypography(
subTitle,
type: Regular12px(),
color: AppColors.disabled,
maxLines: 99,
),
],
),
),
CupertinoSwitch(
value: true,
onChanged: (value) {},
activeTrackColor: AppColors.primary,
),
],
),
),
),
);
}
}