import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class SettingsScreen extends StatelessWidget {

  ProjectViewModel projectsProvider;
  @override
  Widget build(BuildContext context) {
    projectsProvider = Provider.of(context);
    return AppScaffold(
      appBarTitle: TranslationBase.of(context).settings.toUpperCase(),
      body: ListView(
        children: [
          AppText(TranslationBase.of(context).language.toUpperCase(),fontSize: 18,margin: 5,fontWeight: FontWeight.bold,),
          Container(
            margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
            height: 50,
            decoration: BoxDecoration(
              border: Border.all(color: Colors.grey[600],width: 2.0),
              borderRadius: BorderRadius.circular(8.0)
            ),
            child: ClipRRect(
              borderRadius: BorderRadius.circular(7.0),
              child: Row(
                children: [
                  Expanded(
                    child: InkWell(
                      onTap: () { projectsProvider.changeLanguage('en'); },
                      child: AnimatedContainer(
                          duration: Duration(milliseconds: 350),
                          decoration: BoxDecoration(
                              color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
                              border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
                          ),
                          child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
                      ),
                    ),
                  ),
                  Expanded(
                    child: InkWell(
                      onTap: (){projectsProvider.changeLanguage('ar');},
                      child: AnimatedContainer(
                          duration: Duration(milliseconds: 350),
                          decoration: BoxDecoration(
                              color: projectsProvider.isArabic ?  AppGlobal.appPrimaryColor : Colors.transparent,
                              border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
                          ),
                          child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))
                      ),
                    ),
                  )
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}