613_20 gururh talabasi Mo’minova Zilola
2-deadline
Android Studioda ilk dasturni yozish va uni emulyatorda sinovdan o‘tkazish.
Android Studio bilan ishlash uchun, avvalo, uni o'rnatish kerak. O'rnatish havolasini yuklab olish kerak. Odatda Android Studio Flutterni qo'llab-quvvatlamaydi, shuning uchun tegishli plaginni o'rnatishimiz kerak. Buni amalga oshirish uchun boshlang'ich ekranda Android Studio-da Plugins-ni tanlang (yoki file - > Settings> menyusiga o'ting va keyin ochilgan oynada Plugins-ni tanlang). Va plaginlar panelida Flutter plaginini topamiz:
Kerakli plaginni qidirishni soddalashtirish uchun qidiruv tizimiga "Flutter" so'zini kiritishimiz mumkin va birinchi natija faqat o'rnatilishi kerak. Plaginni o'rnatishda dart uchun plaginni o'rnatish taklifi bilan oyna ham ko'rsatiladi. Bundan tashqari, uni o'rnatish uchun OK ni bosing:
Plaginni o'rnatganingizdan so'ng Android studiyasini qayta ishga tushirishingiz kerak bo'ladi.
Android Strudio-da boshlang'ich ekranda qayta ishga tushirilgandan so'ng, biz yangi Flutter loyihasi tugmachasini ko'rishimiz mumkin:
Flutter ostida loyiha yaratish uchun ushbu tugmani bosing.
Shu bilan bir qatorda, studiyada loyiha yaratish uchun menyuga o'ting fayl - > yangi - > > yangi Flutter loyihasi > >:
Odatda Android va iOS elementlari belgilanadi, ammo boshqa mavjud platformalarni tanlash mumkin.
Android Studioda asosiy komponentalar bilan ishlash: Layout, Table, ListView, Grid, List va boshqalar.
Palette panelida foydalanuvchi interfeysi komponentlari mavjud.
LinearLayout
Layout da ikkita variant mavjud: Horizontal va Vertical.
LinearLayout tartibi barcha q ob'ektlar bir yo'nalishda — vertikal yoki
gorizontal ravishda moslashtiradi.
Yo'nalish Android yo'nalishi xususiyati bilan belgilanadi: orientation:
android:orientation="horizontal"
android:orientation="vertical"
Misol:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#aa0000"
android:gravity="center_horizontal"
android:text="red"/>
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="row three"
android:textSize="15dp"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="row four"
android:textSize="15dp"/>
Dostları ilə paylaş: |