93 lines
3.1 KiB
Dart
93 lines
3.1 KiB
Dart
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/typography.dart';
|
||
import 'package:remever/common/widgets/typography.dart';
|
||
import 'package:remever/common/widgets/wspace.dart';
|
||
import 'package:remever/components/extensions/context.dart';
|
||
import 'package:remever/screens/settings/cubit/settings_cubit.dart';
|
||
import 'package:remever/widgets/primary_button.dart';
|
||
|
||
class FaqSettingsState extends StatelessWidget {
|
||
const FaqSettingsState({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
backgroundColor: AppColors.bg,
|
||
appBar: _buildAppBar(context),
|
||
body: Padding(
|
||
padding: const EdgeInsets.all(16).r,
|
||
child: Column(
|
||
children: [
|
||
Expanded(
|
||
child: Container(
|
||
width: double.infinity,
|
||
decoration: BoxDecoration(
|
||
color: AppColors.white,
|
||
borderRadius: BorderRadius.all(Radius.circular(12)).r,
|
||
),
|
||
child: _buildFaqList(),
|
||
),
|
||
),
|
||
HSpace(16),
|
||
PrimaryButton(
|
||
onTap: () {},
|
||
child: AppTypography(
|
||
'Задать свой вопрос',
|
||
type: Medium14px(),
|
||
color: AppColors.white,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildFaqList() {
|
||
return ListView(
|
||
children: [
|
||
_buildExpansion('Есть ли ограничения по количеству коллекций?', 'Нет'),
|
||
Divider(thickness: 1, height: 1, color: AppColors.bg),
|
||
_buildExpansion(
|
||
'Как поделиться коллекцией с друзьями?',
|
||
'Другу необходимо установить приложение Remever на свой телефон, после этого вы сможете обмениваться друг с другом коллекциями',
|
||
),
|
||
Divider(thickness: 1, height: 1, color: AppColors.bg),
|
||
_buildExpansion('Можно ли пользоваться бесплатно?', 'Пока да'),
|
||
Divider(thickness: 1, height: 1, color: AppColors.bg),
|
||
],
|
||
);
|
||
}
|
||
|
||
/// AppBar экрана FAQ
|
||
AppBar _buildAppBar(BuildContext context) {
|
||
return AppBar(
|
||
toolbarHeight: 66.h,
|
||
backgroundColor: AppColors.white,
|
||
shadowColor: Colors.transparent,
|
||
centerTitle: true,
|
||
title: AppTypography('FAQ', type: SemiBold20px()),
|
||
leading: IconButton(
|
||
onPressed: () => context.read<SettingsCubit>().toInitialState(),
|
||
icon: Icon(CupertinoIcons.left_chevron),
|
||
color: Colors.black,
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildExpansion(String title, String answer) {
|
||
return ExpansionTile(
|
||
title: AppTypography(title, type: Medium16px(), maxLines: 2),
|
||
textColor: Colors.black,
|
||
children: [
|
||
ListTile(
|
||
title: AppTypography(answer, type: Regular14px(), maxLines: 99),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
}
|