mirrored_repositories/lifeclass/lib/pages/content/lessons
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:lifeclass/classes/clsApp.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../../classes/clsRichTextFormatter.dart';
import '../../../../classes/sql/clsSqlLesson.dart';
import 'package:lifeclass/pages/content/lessons/classes/clsLanguageSelector.dart';
import 'package:lifeclass/classes/sql/sqlHelper.dart';
import 'package:lifeclass/classes/Themes.dart';

import '../../../../models/modelDailyVerse.dart';
import '../../../../widgets/ads/BannerAds.dart';
import '../components/ParagraphCenterCenterFormatter.dart';
import '../components/ParagraphFormatter.dart';
import '../controlBox/MultiInputField.dart';

class LessonQuestionnaire10 extends StatefulWidget {
  const LessonQuestionnaire10({super.key});
  @override
  State<LessonQuestionnaire10> createState() => _LessonQuestionnaire10State();
}

class _LessonQuestionnaire10State extends State<LessonQuestionnaire10> {
  late String colorTheme=clsApp.defaultColorThemes;
  late double fontSize=16;
  late String language = clsApp.defaultLanguage;
  clsSqlLesson? lessonData;
  modelDailyVerse? dailyVerseData;

  final int lessonID = 10;
  final  answer_1_1_left = TextEditingController();
  final  answer_1_1_right = TextEditingController();
  final  answer_1_2_left = TextEditingController();
  final  answer_1_2_right = TextEditingController();
  final  answer_1_3_left = TextEditingController();
  final  answer_1_3_right = TextEditingController();
  final  answer_1_4_left = TextEditingController();
  final  answer_1_4_right = TextEditingController();
  final  answer_1_5_left = TextEditingController();
  final  answer_1_5_right = TextEditingController();
  final  answer_1_6_left = TextEditingController();
  final  answer_1_6_right = TextEditingController();
  final  answer_1_7_left = TextEditingController();
  final  answer_1_7_right = TextEditingController();
  final  answer_1_8_left = TextEditingController();
  final  answer_1_8_right = TextEditingController();

  late String createdDt = '';
  late String content = '';
  late int maxAnswers=0;
  late int completionRate=0;
  late int _currentFontSize = 1;
  List<double> availableFontSize = [10,12,16,18,20,24,28,32];

  @override
  void initState() {
    super.initState();
    initTheme();
    loadData();
  }
  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }
  void initTheme() async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    setState(() {
      colorTheme = prefs.getString('colorThemes') ?? clsApp.defaultColorThemes;
      _currentFontSize = prefs.getInt('fontSize') ?? 1;
      language = prefs.getString('language') ?? clsApp.defaultLanguage;
      fontSize = availableFontSize[_currentFontSize];
    });
  }
  void loadData() async{
    lessonData = await sqlHelper.getLessonByID(lessonID);
    dailyVerseData = await sqlHelper.getDailyVerseByID(lessonID);

    print('mao na ni->'+ lessonData!.answer_1);

    maxAnswers = lessonData!.maxAnswers;
    completionRate = lessonData!.completionRate;

    List<String> colAns1 = lessonData!.answer_1.split("~");
    if(colAns1.length>1){
      answer_1_1_left.text = colAns1[0];
      answer_1_1_right.text = colAns1[1];
      answer_1_2_left.text = colAns1[2];
      answer_1_2_right.text = colAns1[3];
      answer_1_3_left.text = colAns1[4];
      answer_1_3_right.text = colAns1[5];
      answer_1_4_left.text = colAns1[6];
      answer_1_4_right.text = colAns1[7];
      answer_1_5_left.text = colAns1[8];
      answer_1_5_right.text = colAns1[9];
      answer_1_6_left.text = colAns1[10];
      answer_1_6_right.text = colAns1[11];
      answer_1_7_left.text = colAns1[12];
      answer_1_7_right.text = colAns1[13];
      answer_1_8_left.text = colAns1[14];
      answer_1_8_right.text = colAns1[15];
    }

    createdDt = lessonData!.createdDt;
  }

  void updateAnswers() async{
    String ans1 =
        answer_1_1_left.text + "~" + answer_1_1_right.text + "~" +
            answer_1_2_left.text + "~" + answer_1_2_right.text + "~" +
            answer_1_3_left.text + "~" + answer_1_3_right.text + "~" +
            answer_1_4_left.text + "~" + answer_1_4_right.text + "~" +
            answer_1_5_left.text + "~" + answer_1_5_right.text + "~" +
            answer_1_6_left.text + "~" + answer_1_6_right.text + "~" +
            answer_1_7_left.text + "~" + answer_1_7_right.text + "~" +
            answer_1_8_left.text + "~" + answer_1_8_right.text;
    String ans2 = '';
    String ans3 = '';
    String ans4 = '';
    String ans5 = '';

    int completionCounter = 0;
    if(answer_1_1_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_1_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_2_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_2_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_3_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_3_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_4_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_4_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_5_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_5_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_6_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_6_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_7_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_7_right.text.trim()!='')
      completionCounter+=1;
    if(answer_1_8_left.text.trim()!='')
      completionCounter+=1;
    if(answer_1_8_right.text.trim()!='')
      completionCounter+=1;

    double totalPercentage = (completionCounter/16) * 100;
    completionRate = int.parse(totalPercentage.toStringAsFixed(0));

    await sqlHelper.updateLesson(
        lessonID,
        ans1,
        ans2,
        ans3,
        ans4,
        ans5,
        maxAnswers,
        completionRate,
        createdDt);

    setState(() {
      var snackBar = SnackBar(content: Text(clsLanguagePreset.label_update_notify(language)));
      ScaffoldMessenger.of(context).showSnackBar(snackBar);

      if (Navigator.canPop(context)) {
        Navigator.pop(context);
      } else {
        SystemNavigator.pop();
      }

    });
  }
  void clearFields(){
    Navigator.pop(context,false);
    answer_1_1_left.text='';
    answer_1_1_right.text='';
    answer_1_2_left.text='';
    answer_1_2_right.text='';
    answer_1_3_left.text='';
    answer_1_3_right.text='';
    answer_1_4_left.text='';
    answer_1_4_right.text='';
    answer_1_5_left.text='';
    answer_1_5_right.text='';
    answer_1_6_left.text='';
    answer_1_6_right.text='';
    answer_1_7_left.text='';
    answer_1_7_right.text='';
    answer_1_8_left.text='';
    answer_1_8_right.text='';
    setState(() {});
  }

  void openDailyVerse(int dailyVerseID, String content, String title){
    Navigator.of(context).pushNamed('/DailyVerseDetails', arguments: {
      'dailyVerseID': dailyVerseID.toString(),
      'content': content,
      'title' : title
    });
  }

  @override
  Widget build(BuildContext context) {
    var brightness = MediaQuery.of(context).platformBrightness;
    bool isDarkMode = brightness == Brightness.dark;

    List<clsRichTextFormatter> question_01 = [
      clsRichTextFormatter(content: clsWeek02Lesson10.question_01(language), fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, bColor: '', fontSize: fontSize, isDarkMode: isDarkMode),
      clsRichTextFormatter(content: '', fontStyle: FontStyle.italic, fontWeight: FontWeight.normal, bColor: colorTheme, fontSize: fontSize, isDarkMode: isDarkMode),
    ];
    List<clsRichTextFormatter> question_01_01 = [
      clsRichTextFormatter(content: clsWeek02Lesson10.question_01_01(language), fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, bColor: '', fontSize: fontSize, isDarkMode: isDarkMode),
      clsRichTextFormatter(content: '', fontStyle: FontStyle.italic, fontWeight: FontWeight.normal, bColor: colorTheme, fontSize: fontSize, isDarkMode: isDarkMode),
    ];

    List<clsRichTextFormatter> remember_the_lesson = [
      clsRichTextFormatter(content: clsWeek02Lesson10.remember_the_lesson(language), fontStyle: FontStyle.italic, fontWeight: FontWeight.bold, bColor: '', fontSize: fontSize, isDarkMode: isDarkMode),
      clsRichTextFormatter(content: '', fontStyle: FontStyle.italic, fontWeight: FontWeight.normal, bColor: colorTheme, fontSize: fontSize, isDarkMode: isDarkMode),
    ];
    List<clsRichTextFormatter> study_the_word = [
      clsRichTextFormatter(content: clsWeek02Lesson10.study_the_word(language), fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, bColor: '', fontSize: fontSize, isDarkMode: isDarkMode),
      clsRichTextFormatter(content: '', fontStyle: FontStyle.italic, fontWeight: FontWeight.normal, bColor: colorTheme, fontSize: fontSize, isDarkMode: isDarkMode),
    ];

    Widget getAnswers(String numbers, TextEditingController controller, String tag){
      return Row();
    }

    return Scaffold(
      body:
      Scaffold(
        appBar: AppBar(
          actions: [
            IconButton(onPressed: () {
              showDialog(
                  context: context,
                  builder: (context) =>
                      AlertDialog(
                        title: Text(clsLanguagePreset.label_clear_fields(language), style: TextStyle(fontSize: 16.0),),
                        actions: <Widget>[
                          TextButton(onPressed: () => Navigator.pop(context, false), child: Text(clsLanguagePreset.label_no(language), style: TextStyle(color: myThemes.getColor(colorTheme)),)),
                          TextButton(onPressed: () => clearFields(), child: Text(clsLanguagePreset.label_yes(language), style: TextStyle(color: myThemes.getColor(colorTheme)),)),],));
            },
              icon: Icon(Icons.delete),
              tooltip: clsLanguagePreset.icon_label_clear_all_fields(language),)
          ],
          title: Text(clsLanguagePreset.app_bar_label_questionnaire(language) + ' ' + lessonID.toString()),
          backgroundColor: myThemes.getColor(colorTheme),
        ),
        floatingActionButton: FloatingActionButton(onPressed: updateAnswers, backgroundColor: myThemes.getColor(colorTheme), child: Icon(Icons.save), tooltip: clsLanguagePreset.float_button_label_save_answers(language)),

        body: SafeArea(
          child: Column(
            children: [Expanded(
              child: RawScrollbar(
                child: SingleChildScrollView(
                  child: SafeArea(
                    child: Column(
                      mainAxisSize: MainAxisSize.max,
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Center(child: Image.asset('assets/images/live_the_lessons.png')),
                        Divider(),
                        ParagraphFormatter(richTextData: question_01),
                        ParagraphFormatter(richTextData: question_01_01),
                        Center(child: Container(margin: EdgeInsets.symmetric(horizontal: 50),  child: Image.asset('assets/images/week_10_question_img.jpg'))),

                        Row(
                          children: [
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: Row(
                                  children:[
                                          Expanded(flex: 1, child: Text('2.')),
                                          Expanded(
                                                flex: 9,
                                                child: TextField(
                                                      textAlign: TextAlign.center,
                                                      controller: answer_1_1_left,
                                                      cursorColor: myThemes.getColor(colorTheme),
                                                      decoration:
                                                      InputDecoration(
                                                        hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                                        isDense: true,
                                                        contentPadding:
                                                        EdgeInsets.all(0),
                                                        focusedBorder: UnderlineInputBorder(
                                                        borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                                        ),
                                                      ),
                                                    ),
                                              ),
                                          ]
                              ),
                            )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_1_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Isaiah 53:4)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Isaiah 53:4)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12))))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('3.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_2_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_2_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(2 Corinthians 5:21)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(2 Corinthians 5:21)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12))))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('4.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_3_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_3_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Romans 6:23)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Romans 6:23)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('5.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_4_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_4_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Galatians 3:13-14)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Galatians 3:13-14)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('6.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_5_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_5_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(2 Corinthians 8:9)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(2 Corinthians 8:9)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('7.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_6_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_6_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Hebrews 2:10, 1 Peter 2:6b)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Hebrews 2:10)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('8.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_7_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_7_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Isaiah 53:3, Ephesians 1:6)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Isaiah 53:3, Ephesians 1:6)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),

                        Row(
                          children: [
                            Expanded(
                                child: Padding(
                                  padding:EdgeInsets.all(16),
                                  child: Row(
                                      children:[
                                        Expanded(flex: 1, child: Text('9.')),
                                        Expanded(
                                          flex: 9,
                                          child: TextField(
                                            textAlign: TextAlign.center,
                                            controller: answer_1_8_left,
                                            cursorColor: myThemes.getColor(colorTheme),
                                            decoration:
                                            InputDecoration(
                                              hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                              isDense: true,
                                              contentPadding:
                                              EdgeInsets.all(0),
                                              focusedBorder: UnderlineInputBorder(
                                                borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ]
                                  ),
                                )),
                            Expanded(
                              child: Padding(
                                padding:EdgeInsets.all(16),
                                child: TextField(
                                  textAlign: TextAlign.center,
                                  controller: answer_1_8_right,
                                  cursorColor: myThemes.getColor(colorTheme),
                                  decoration:
                                  InputDecoration(
                                    hintText: clsLanguagePreset.hint_enter_your_answer(language),
                                    isDense: true,
                                    contentPadding:
                                    EdgeInsets.all(0),
                                    focusedBorder: UnderlineInputBorder(
                                      borderSide: BorderSide(color: myThemes.getColor(colorTheme), width: 3),
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ],
                        ),
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(child: Center(child: Text('(Romans 6:6-7, 2 Corinthians 5:17)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12)))),
                            Expanded(child: Center(child: Text('(Romans 6:6-7)',style: TextStyle(fontStyle: FontStyle.italic,fontSize: 12),)))
                          ],
                        ),


                        Center(child: Image.asset('assets/images/remember_the_lesson.png')),
                        Divider(),
                        ParagraphCenterCenterFormatter(richTextData: remember_the_lesson, marginGap: 50),
                        Center(child: Image.asset('assets/images/study_the_word.png')),
                        Divider(),
                        ParagraphCenterCenterFormatter(richTextData: study_the_word, marginGap: 50),
                        SizedBox(width: 0, height: 30,),
                        Center(child: Padding(padding: EdgeInsets.all(10.0), child: ElevatedButton.icon(icon: Icon(Icons.open_in_new), onPressed: () {openDailyVerse(lessonID, dailyVerseData!.content.toString(), 'DAY ' + lessonID.toString());}, style: ButtonStyle(backgroundColor: MaterialStateProperty.all(myThemes.getColor(colorTheme))), label: Padding(padding: EdgeInsets.all(15), child: Text(clsLanguagePreset.button_open_daily_readings(language))),))),
                        SizedBox(width: 0, height: 100,),
                      ],
                    ),
                  ),
                ),
              ),
            ),
              BannerAds()
            ],
          ),
        ),
      ),
    );
  }
}
