import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import '../../../config/app_constant.dart'; import '../../../config/lang_enum.dart'; import '../../../config/provider.dart'; import '../../../config/size.dart'; import '../../../config/style.dart'; import '../../../providers/language_provider.dart'; import '../../../utils/text_style.dart'; import '../../../utils/text_widget.dart'; import '../../../widgets/custom_app_bar.dart'; class LanguageScreen extends StatelessWidget { LanguageScreen({Key? key}) : super(key: key); final hm = SizeConfig.heightMultiplier; final wm = SizeConfig.widthMultiplier; final tm = SizeConfig.textMultiplier; @override Widget build(BuildContext context) { final langProvider = Provider.of(context); return Scaffold( // backgroundColor: AppStyle.appBackground, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const CustomAppBar( title: "Language", thirdWidget: true, ), SizedBox(height: hm * 5), Padding( padding: EdgeInsets.symmetric(horizontal: wm * 10), child: Txt( text: "Choose you preferred language", style: tS("lato_bold", 13, FontWeight.bold,Theme.of(context).brightness == Brightness.dark ? AppNewStyle.whiteAppBackground: AppStyle.black), ), ), SizedBox( height: hm * 2, ), GestureDetector( onTap: () { langProvider.changeLanguage("Arabic"); }, child: Padding( padding: EdgeInsets.symmetric(horizontal: wm * 10, vertical: hm * 2), child: Row( children: [ Container( height: 30, width: 30, decoration: const BoxDecoration( shape: BoxShape.circle, color: Color.fromRGBO(246, 246, 246, 1)), child: Padding( padding: const EdgeInsets.all(5.0), child: SvgPicture.asset(Consts.mosqueIcon), ), ), SizedBox(width: 12,), Txt( text: "Arabic", style: tS("lato_bold", 13, FontWeight.bold, Theme.of(context).brightness == Brightness.dark ? AppNewStyle.whiteAppBackground: AppStyle.black), ), const Expanded( child: SizedBox(), ), langProvider.currentLangCode == Language.ar ? const Icon( Icons.check, color: Colors.blue, size: 15, ) : const SizedBox() ], ), ), ), const Divider(), GestureDetector( onTap: () { langProvider.changeLanguage("English"); }, child: Padding( padding: EdgeInsets.symmetric(horizontal: wm * 10, vertical: hm * 2), child: Row( children: [ Container( height: 30, width: 30, decoration: const BoxDecoration( shape: BoxShape.circle, color: Color.fromRGBO(246, 246, 246, 1)), child: Padding( padding: const EdgeInsets.all(5.0), child: Image.asset(Consts.englishFlagPic), ), ), SizedBox(width: 12,), Txt( text: "English", style: tS("lato_bold", 13, FontWeight.bold, Theme.of(context).brightness == Brightness.dark ? AppNewStyle.whiteAppBackground: AppStyle.black), ), const Expanded( child: SizedBox(), ), langProvider.currentLangCode == Language.en ? const Icon( Icons.check, color: Colors.blue, size: 15, ) : const SizedBox() ], ), ), ), const Divider() ], ), ), ); } }