PIbd-32_Shabunov_O.A._Mobil.../lib/presentation/settings_page/settings_page.dart
olshab f0a17af845 final improvements
added internet permission in manifest
added unique app bar titles for each section
fixed card layout
fixed card details page layout
added appbar button for toggling dark mode
2024-12-17 14:31:39 +04:00

48 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_android_app/components/extensions/context_x.dart';
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) {
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>(
builder: (context, state) {
return state.currentLocale.languageCode == 'ru'
? const SvgRu()
: const SvgUs();
}),
),
),
),
],
),
],
),
);
}
}