• Bajardi
  • Main.dart file kodi
  • Aqliy qobilyatni aniqlaydigan mobil ilova yaratish




    Download 87.17 Kb.
    bet1/2
    Sana16.03.2023
    Hajmi87.17 Kb.
    #45651
      1   2
    Bog'liq
    AZIZBEK-3MM
    sanat tarixi, fizik olimlar va qonunlari, 1 Million dasturchi barcha labaratoriyalari, 1680244528, Bir fazali va uch fazali elektr zanjirlari, 10 - lab Kiber huquq, Ochiq dars ishlanmasi, 8 MAVZU, Doc1, 730069f7-c135-4bf6-90f0-62a02039bf57, Mustaqillik yillarida davlat boshqaruv tizimida amalga oshirilga islohotlar (1), 1-amaliyot (2), MIrzoanvar deadline massiv, Mirzoanvar english deadline self study 5

    O`ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI


    MUHAMMAD AL-XORAZMIY NOMIDAGI
    TOSHKENT AXBOROT TEXNOLOGIYALARI
    UNIVERSITETI SAMARQAND FILIALI

    "Kompyuter injiniring" fakulteti


    "Mobil ilovalar ishlab chiqarish" fanidan

    Mustaqil ish_3

    Mavzu: Aqliy qobilyatni aniqlaydigan mobil ilova yaratish.

    Bajardi: Ochilov Azizbek


    Tekshirdi:Yuldoshov A.X.
    SAMARQAND – 2022
    Topshiriq: Aqliy qobilyatni aniqlaydigan mobil ilova yaratish.
    Ushbu Labaratoriyada test ishlash uchun Quiz App namoyish etaman
    Dastur kodi:
    Answer.dart file kodi:
    import 'package:flutter/material.dart';
    import 'package:hexcolor/hexcolor.dart';

    class Answer extends StatelessWidget {


    final VoidCallback selectHandler;
    final String answerText;

    const Answer(this.selectHandler, this.answerText, {Key? key})


    : super(key: key);

    @override


    Widget build(BuildContext context) {
    return ElevatedButton(
    child: SizedBox(
    width: 200,
    child: Text(
    answerText,
    textAlign: TextAlign.center,
    style: const TextStyle(
    fontWeight: FontWeight.w400,
    color: Colors.white,
    ),
    ),
    ),
    style:
    ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.green)),
    onPressed: selectHandler,
    );
    }
    }

    Main.dart file kodi:
    import "package:flutter/material.dart";
    import "package:hexcolor/hexcolor.dart";
    import './quiz.dart';
    import './result.dart';

    void main() {


    runApp(const MyApp());
    }

    class MyApp extends StatefulWidget {


    const MyApp({Key? key}) : super(key: key);

    @override


    State createState() {
    return _MyAppState();
    }
    }

    class _MyAppState extends State {


    static const _data = [
    {
    'questionText':
    'Flutter bu _____ Google tomonidan ishlab chiqilgan framework.',
    'answers': [
    {'text': 'Open-source', 'score': 10.00},
    {'text': 'Shareware', 'score': 4.61},
    {'text': 'ikkalasi', 'score': 1.95},
    {'text': 'turi javob yu', 'score': 0.00},
    ]
    },
    {
    'questionText': 'Flutter dasturlar _____ dasturlash tilida yoziladi.',
    'answers': [
    {'text': 'Java', 'score': 2.3},
    {'text': 'HTML', 'score': 0.32},
    {'text': 'JavaScript', 'score': 3.00},
    {'text': 'Dart', 'score': 10.00},
    ]
    },
    {
    'questionText': 'qaysi vidjet layoutlar uchun foydalaniladi?',
    'answers': [
    {'text': 'Text', 'score': 0.64},
    {'text': 'Column', 'score': 10.00},
    {'text': 'Inkwell', 'score': 3.28},
    {'text': 'Expanded', 'score': 1.02}
    ]
    },
    {
    'questionText': 'Flutter qachon ishlab chiqilgan?',
    'answers': [
    {'text': '2012', 'score': 0.12},
    {'text': '2013', 'score': 2.13},
    {'text': '2017', 'score': 6.42},
    {'text': '2015', 'score': 10.00}
    ]
    },
    {
    'questionText': 'Flutter qachon release qilingan?',
    'answers': [
    {'text': '2016', 'score': 5.53},
    {'text': '2017', 'score': 10.00},
    {'text': '2013', 'score': 2.47},
    {'text': '2019', 'score': 2.35}
    ]
    }
    ];

    var _indexQuestion = 0;


    double _totalScore = 0.00;

    void _answerQuestion(double score) {


    _totalScore += score;

    setState(() {


    _indexQuestion += 1;
    });
    }

    void _restart() {


    setState(() {
    _indexQuestion = 0;
    _totalScore = 0;
    });
    }

    @override


    Widget build(BuildContext context) {
    return MaterialApp(
    home: Scaffold(
    backgroundColor: Colors.white,
    appBar: AppBar(
    title: Align(
    alignment: Alignment.center,
    child: Text(
    "Flutter Quiz App",
    style: TextStyle(
    color: HexColor("#F5FFF0"),
    ),
    ),
    ),
    backgroundColor: Colors.green,
    ),
    body: Align(
    alignment: Alignment.center,
    child: (_indexQuestion <= 4 && _indexQuestion >= 0)
    ? Quiz(
    answerQuestion: _answerQuestion,
    indexQuestion: _indexQuestion,
    data: _data)
    : Result(_totalScore, _restart))),
    );
    }
    }


    Download 87.17 Kb.
      1   2




    Download 87.17 Kb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Aqliy qobilyatni aniqlaydigan mobil ilova yaratish

    Download 87.17 Kb.