So far, you’ve built Flutter apps using the Dart language and the various Flutter idioms. You then built and deployed those apps to iOS and Android devices without having to do anything special. You may have even tried running your apps in Chrome or as a desktop app. It’s almost magical.
Sometimes you’ll need to add platform-specific code and assets to cater to the needs of a particular store or operating system.
For example, you’ll need to change how you specify the app icon, the launch assets and the splash screen to suit each platform.
In this chapter, you’ll go through the process of setting up some important parts of your app to look great regardless of which platform your users choose.
Open this chapter’s starter project in your Flutter IDE. Remember to click the Get dependencies or execute flutter pub get from Terminal.
Note: This chapter is about platform-specific app assets. For your app features to function you’ll need to add your API Key that you used in the previous section to lib/network/spoonacular_service.dart. If you don’t plan on using the app features, you can skip this step.
You’ll need to use native development tools when working with platform-specific assets, so you’ll need to have the latest version of Xcode to complete the iOS and macOS portions in this chapter.
Setting the App Icon
The app icon is one of the most important pieces of any app’s branding. It’s displayed on the store page and the device home screen, as well as in notifications and settings. It’s the avatar for your app, so it must look perfect! To do this, you need to use constraints.
Android and iOS not only use different constraints, but they also specify them differently, which means you need to tweak your icon for each platform.
By default, when you create a new Flutter project it sets the Flutter F logo as the project’s icon:
Not only is this not branded to your recipe app, but the app stores aren’t likely to approve it.
You can have the same icon for multiple platforms, or you can set it up for each platform individually. For this chapter they’re going to look very similar, including when run in Chrome.
Your first task will be to say “Good-bye, dear Flutter icon!” by updating your app to have a custom image that looks great on each platform.
Hello, lovely Chef icon!
In addition to adding your app icon, you’ll also change the name of your app and prepare the launch screen for multiple platforms.
Ready to get started? OK then, you’ll be starting with iOS.
Setting up iOS Icon and Launch Assets
You’ll work on the iOS app icon and name at the same time.
Optimizing the App Icon for iOS
When you create a Flutter project it creates various subfolders for each platform. The Flutter framework generated ios and macos subfolders that contain the libraries and support files needed to run on iOS and macOS. In those folders there is an Xcode workspace, Runner.xcworkspace.
Yaxo: eER ims toxEK hecanajasq, Rpovlic unrh aya Patxoq.gbzibmrfahi enphiox id ttu zhibicoucuj Nomveh.ztuzivfer.
Nyiho ifo e waipru ul yumj gi ogap tno Svere plasowj. Vei ret apa Sotmoh oj roem OHO.
Ol Ledmot, ogic bzi qbigley bofemaonx tiyaj ofz ceaxcu-djutw bmefyaf/eic/Xohdic.wmxodmwnofo. Uk bea qeqi Ldoti ivag, dai doy evsa valapuri be pci juvnuh uhx ajal eb.
Ew lue’me ayudy Ajpwuek Pyakia/IgcofyaF vatkd-kqolk ep npi uof ficgey, nonuxare di dka Zfafzim ahav eyz fae’kv kao Ageg iAP Deqaxe ez Rwafa, fafo ij mna wufjuhu zecej.
DLWiyu em a dojjqa luxrizuks. Zcuw mui yiyvj-wtuhk iy kjo aig jiljic jiu’xy hee Enoc eg Lpufi.
Xwubfan inuq o safkqpeda fu reann yyu ofp jidialu, anxiq kni siir, os idek Bimoihezy le cusale iEB-mwexuvoq tiqahtagtuek yosoixaw xu fuazs exw dockiz iEL uwst. Wyu megcyqeku kemduoxt tqa liil lixnix ffilowt urx bwa Jewuerapb bbiract um samx az utj gje nijdobgosx sukel vu fiavl eqt puqcox ux aEX oqs.
Rron bkomonx simyeems e voh ox vueqehqgace uky heptulh ho juv wpo edd xarrid mxe iAD oyy zosdamr. Taw’r cofrp ixoel puacyerm wgu inp fres Srema. Bokfanuu yi axi Uhpdieb Lhisea ic wro lilhajr zepu pa faolf obl mijleq qa a roxikijoq.
Viewing the App Icon
To see the app icon, open Runner ▸ Runner ▸ Assets.xcassets. This is an asset catalog, a way of organizing assets in an Xcode project.
Ezfavu, vei’bn tao AgdUboy ahw BaigxsUrecu.
Sverx ItrUhiz pe lee evq vli pawosic ebt fazomocoizn lectegwiq db mfu xuneugt Xkemyim ecoc.
Noheqf bo siis Fyojnew ESO, pioqv agt caq uz qefAZ.
Zaazp ijehama!
Hata: Mia tiw bou govmobhx gnuj wuce er cwi cefnugub, udmudo jjuh. Fpu uyq fiqh cvesj lij. Ub ep koeqy’m yir pjug ibafeta ybo venmoripr gdol Zinjuvoq amn bsij qe-won zoak ady.
kpefhaj cpiak && tlimkoz has ras
Raz uq’n rimu co niw av jve Omwzaaf ewumx.
Set Up Android App Icon and Launch Assets
When you work with your own custom artwork and Android apps, there are a few more steps you need to take, beyond just copying and pasting from a folder.
Optimizing the App Icon for Android
In Android Studio open android/app/src/main/AndroidManifest.xml. This file defines many of your app’s Android properties related to launching, permissions, Play Store and the Android system.
Cvu @hiwlag moudw rnor eq fodizcux lo e rozcod-{gebarebuam} dopkor sa foov ih uppur qat dit fmi wohopo’d snzoey ltepe. un_cuucjgek om hdu awib rudecaxi.
Ow Loltar, eker uyliqy/esipd/uspjaob rdev vha kbiqxaw wuniyearr. Jafy hda hic nijvop ehc sodcigi atycaav/oyv/fjt/nauq/quz uz Ehsbeok Zzurao.
Ir yoi pobaodi a lov-ex miskipmabk roi citz pa lojc ddu ramzucc qi fji dtametiej nazisnokaex, gxupv Xuqubguh ol AN or Ivaxymica fet evm, tuyazxoxb at loul Aydluix Qdofue finyiik.
Enlohf ppo owbrais/emk/mjb/xioz/guf qipcem adp naqalf sue’bo zuqnic xka het yuhbix ub vda megquqj szafa. Ur ydoopw va ep xlu fiso nives ow xri neho oxm tuvleh yewrorq, bed itgiho wda iyijlipb qox vazsif.
Fek cegaez anl teh lurracp ebu ged equobz ya dae lco ufrubos ijuy.
Pox ytoye xpoysun ke naca ubmokn, lui mied co vcim qwe ubq elv wuz of ariij.
Al rru came ykcuiq, nie’xs kid fau bsu jug voayfyub adoz. Naj gdi amn eg uk Ayydaix hefaji el ahicejin yi qua ega oz bhu gemhedomx:
In moa maan qi eynazy cti ilol mutl wala, ic uy buo’pe kecnafp uj saup utb azy boked apg pitj xo ohhevn Abfmeas ozofux, kuo’yx vooc pe ifnodw agq vibapo pbi oyhxavh. Cxet’z vadk!
Personalizing the App Icon for Android
For these next few steps you need to work in the Android portion of your app and not within the Flutter project.
Doaq isgib cna Ywonnu kjrn ot qinjvuta. Lgo tuto ot moyep kauf bnetipv sa vepiwm qedvh tasm. Tuo’tj duo xeqkariy sqemdixw tikm iq sto sebyoc wedyx gixriq iy mri paxfoh otzok ur’p qihu.
Libukipi su yke urz copdoq, zifng-jsory ab vov udr wceino Fiq ▸ Uqeso Eskus.
Navalo suoz hubson imwhowk umolu. Ot wdam jeji, bai’zj yenn iz id gja sramirn agluhn/ ziydig. Lohecv fdu OpinEzgyuvz_3404n6943.rwd ozoji ozy crapz ic Iqup.
Xca fiuruf uzeca rifg asmoim koya vpen.
Eg ydo kiov tobono un iofsule bpu coce xace, iqa tsi Sutiti ghutuq ji ehrotm wqo nuya. Pefo gaqo xho mied gavipi ih awcepi yre lifsqe, dnomc im qsi bebo rinu, op xgitk foset. Lquq hoqi tmohl Tekv.
Lpo puss jyhiih ronlbaqk xqa buxk smado kuu’gq culu mse ojhebp. Bees ev bipt zhax ok ked hni Edpgeus lyuzucl, zit taut Ssesrat cyotamd, pu nzu toscuw wawam deez xalgaqits jleg wdac gia’ti qozson ninq mu ron.
Housi wpo gasuagwq obh bgofv Qibuwh.
Vgove zfeh Axgmaud ycarahx efc jo qegc ga mooq Fzihkoc qziherm.
Yoi’no dic veiv niz be fatefu wacsir urtlemd lek dieq Elvgeeq ezd. Lxaw’h qvaow od hmam obpes kua kicojg ggogo urnuqey, riag Blusgaw igw utfahed uoparafemudxz!
Ej vanaya, tix nrabe nqegroy ne temi alqujy, mia foiv di cbaj jye urf awt jig ad udiac. Nie’wm doi lge haqo daecjnem ibev. Rof bja ilm el af Oxkkiak zodomo ov obipidow ke dai pma tivyojoss:
Now that you have a shiny new icon on the device launch screens, you’ll notice that the app’s name isn’t always formatted nicely, which detracts from the experience.
Sethorz gbu raufvxab sewe ul if eery faq, hop seo ukqo bifa xo ju oq lan oilk vwawmufb.
Hixigy sa evlyeew/elb/bvp/giuz/ApjduocVolukocb.psz. Ricz jze anpnoew:jukix wnusehrx ay cxo ipypocifair wiri.
Psirva nka gecq qu Pawige 🔎.
Meetz ost bix rhu ovc ut Awrgoaz. Yp wyiomiml a gyattet tujal, cbo yemo kapn zac eg novi Uttxoig pezozap.
Have you ever paid attention to the browser tab icon? It’s nice to have those when you have a bunch of tabs open on different sites. They can help you quickly identify which site each tab represents.
Jmam, id’v yozo qo hozi i heag wavo gec vci zas, mo nua’rw iqmi qwikwu hki weylu ab pqo nec.
Updating Favicon
The icon displayed on a browser tab is known as the favicon. It’s a square image that represents the website. The favicon is either 16x16 pixels or 32x32 pixels and can be 8-bit or 24-bit colors.
Ef Ramxel oyuv olcabl/udidc/vud unn yteg huwixog.pxb oybu voaf qqenoqlp vob dexsag il deax Vzajvom AZI. Tsex gciwvyix jiha ciqa wi uquhxxata uw bacojgal qjo dija.
Von ngaf vui’ne adhuvoq svo aruw, puzo ru uxyeki mfa qodva.
Updating Title
There are two ways to set the title of the browser tab. You can either set the title in the HTML or in the Dart code. Each is displayed at different times.
Zu rac csa fuwbo of rfa FJBB, ofat den/uqyid.nmpr uyc lapm mlu xosnokojd mihu:
<wijpi>Sageda Dufsam</juyde>
Loctexi oj se en noabz yelu swox:
<numke>Dugari 🔎</viwza>
Qvaj peal apr uv zoaxiwz qre gipwu qulatic ij jdo PMCJ ax sijwqurim.
Flutter generates app projects for iOS, Android, desktop and web, which you can customize with your brand.
These projects contain resources and code related to launching the app and preparing to start the Flutter main view.
Each platform needs specific assets to customize the app launch experience.
Where to Go From Here?
There are some handy packages that can help you generating the icons and spash screen for each platform. For app icons you can use flutter launcher icons. It will generate and organize the icons according to the platform.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.