2024-12-15 23:23:00 +04:00
|
|
|
import 'package:flutter/material.dart';
|
2024-12-16 22:59:15 +04:00
|
|
|
import 'package:flutter_android_app/components/extensions/context_x.dart';
|
2024-12-15 23:23:00 +04:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
|
|
|
|
import '../common/svg_objects.dart';
|
|
|
|
import '../locale_bloc/locale_bloc.dart';
|
|
|
|
import '../locale_bloc/locale_events.dart';
|
|
|
|
import '../locale_bloc/locale_state.dart';
|
|
|
|
|
|
|
|
class SettingsPage extends StatelessWidget {
|
|
|
|
const SettingsPage({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-12-17 14:31:39 +04:00
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 16, top: 8),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'${context.locale.settingsLanguage}:',
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () => context.read<LocaleBloc>().add(const ChangeLocaleEvent()),
|
|
|
|
child: SizedBox.square(
|
|
|
|
dimension: 50,
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.only(right: 0),
|
|
|
|
child: BlocBuilder<LocaleBloc, LocaleState>(
|
2024-12-16 22:59:15 +04:00
|
|
|
builder: (context, state) {
|
|
|
|
return state.currentLocale.languageCode == 'ru'
|
|
|
|
? const SvgRu()
|
|
|
|
: const SvgUs();
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
2024-12-17 14:31:39 +04:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
2024-12-15 23:23:00 +04:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|