“kompyuter injiniringi” fakulteti
Download 0.67 Mb. Pdf ko'rish
|
ESHQ MI mustaqil ish
- Bu sahifa navigatsiya:
- “AXBOROT TA’LIM TEXNOLOGIYALARI” KAFEDRASI “MOBIL ILOVALAR YARATISH” FANIDAN LABORATORIYA ISHI
O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI SAMARQAND FILIALI “KOMPYUTER INJINIRINGI” FAKULTETI “AXBOROT TA’LIM TEXNOLOGIYALARI” KAFEDRASI “MOBIL ILOVALAR YARATISH” FANIDAN LABORATORIYA ISHI Tayyorladi: Egamberdiyev Sh.Q Qabul qildi: Shokirov F.SH Samarqand – 2022 MISOL: a ning ixtiyoriy qiymatida x = 12a 2 + 7a -16funksiyani qiymati hisoblang. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( // Application name title: 'Flutter Hello World', // Application theme data, you can set the colors for the application as // you want theme: ThemeData( primarySwatch: Colors.blue, ), // A widget which will be started on application startup home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State final controller1 = TextEditingController(); String matn1 = ''; int son1 = 0; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( // The title text which will be shown on the action bar title: Text('title'), ), body: Column(children: [ TextField( controller: controller1, ), ElevatedButton( onPressed: () { setState(() { matn1 = controller1.text; son1 = int.parse(matn1); son1 = son1 * son1 * 12 + son1 * 7 - 16; }); }, child: Text(" ok")), Text("${son1}"), ]), ); } } Materialapp dasturning nomi stateesswidjiti dasturimizning ildizi primariyswatch orqa fonni ko’k rang ko’rinishida qildim. String turida matin 1 o’zgaruvchi kiritip qiymatini bo’sh qoldiryapmiz yana int turida son 1 o’zgaruvchi kirityapmiz qiymatini 0 ga taminlayapmiz. Bodyda kolumn yaratip kolumini ichida textfiled yaratyapmiz textfielda kontroller1 xosil qilyapmiz kontroller 1 ni vazifasi son kiritish. Matn1 ni kontroller 1.textga taminlayapmiz matn1 int qiladi son1 taminlaydi. Child: Text(“ ok) bu narsa kamplatsiya berganimizda konsol oynada ok text chiqaradi. Text(“${son1}”), bu narsa komplatsiya berganimizda konsol oynadan istalgan sonni xosil qilish uchun kerak buladi. Dastur tuzilgandan keyin unga son beramiz 0 qiymat kiritganda -16 soni chiqdi . Kiyin yana 1 qiymat kiritganimizda 3 chiqdi. Download 0.67 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling