Flutter-sovelluksen tilanhallinta
Jokisuo, Klaus (2020)
Jokisuo, Klaus
2020
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2020110422219
https://urn.fi/URN:NBN:fi:amk-2020110422219
Tiivistelmä
Googlen uusi ohjelmistokehys Flutter on saavuttanut suuren suosion nopean kehityksen ja erittäin kovan suorituskykynsä ansiosta. Flutter eroaa muista kilpailevista ohjelmistokehyksistä tuottamalla alustakohtaisia käännöksiä yhdestä koodikannasta.
Flutter on deklaratiivinen ohjelmistokehys. Deklaratiivisten ohjelmistokehyksien suurin ero imperatiivisiin ohjelmistokehyksiin on sovelluksien mahdollinen kehittäminen ilman sovelluksen käyttöliittymän ja sovelluksen logiikan eriyttämistä.
Sovelluksien tilahallinta on yksinkertaisuudessaan logiikan ja käyttöliittymän yhteen saattamista ja niiden välisen datan viemistä eteenpäin. Deklaratiiviset ohjelmistokehykset voivat aiheuttaa loppukehittäjille vaikeuksia luoda hyvää ja hallittavaa koodia. Työssä käytettiin Flutter, Provider, Flutter BloC virallisia dokumentaatioita.
Tilanhallintatekniikoita vertailtiin teoriaosuudessa tarkastelemalla niiden toimintaa ja ominaisuuksia. Tarkastelun perusteella luotiin kolme käyttöliittymältään identtistä esimerkkisovellusta ja luotiin testi, jolla pystytään vertaamaan esimerkkisovelluksien suorituskykyeroja.
Opinnäytetyö saavutti tarkoituksensa tarjota yksityiskohtaisen vertailun kolmen suositellumman tilanhallinta menetelmän välillä. Tulokset osoittavat, että Flutter BloC tilanhallintatekniikkaa kannattaa käyttää suuremmissa sovelluksissa. Provider on selkeä voittaja helppokäyttöisyyden suhteen. SetStatea tulisi käyttää täydentämään käytettyä tilanhallintatekniikkaa, ylimääräisen koodin vähentämiseksi. Google’s new cross-platform framework Flutter has gained great popularity due to its rapid development speed and high performance. Flutter differs from other competing software frameworks because it produces platform-specific binaries from a single codebase.
Flutter is a declarative software framework. The greatest difference between declarative software frameworks and imperative software frameworks is the possible development of applications without differentiating the application interface and application logic.
At its core, application state management is bringing application logic and application user interface together and creating communication between them. Declarative software frameworks can make it difficult for the developer to create good and maintainable code. The official documentation of Flutter, Provider, Flutter BloC was used in the study.
State management techniques were compared in the theoretical part of this thesis by examining their properties and features. Based on the review, three sample applications with identical user interfaces were created and a test was created to compare the performance differences of the sample applications.
The thesis achieved its purpose to provide a detailed comparison of the current top three recommended state management approaches. The results indicate that Flutter BloC is the leader when it comes to handling larger applications. When it comes to ease of use the Provider is the clear winner. SetState should be used to complement the used state management technology to reduce boilerplate code.
Flutter on deklaratiivinen ohjelmistokehys. Deklaratiivisten ohjelmistokehyksien suurin ero imperatiivisiin ohjelmistokehyksiin on sovelluksien mahdollinen kehittäminen ilman sovelluksen käyttöliittymän ja sovelluksen logiikan eriyttämistä.
Sovelluksien tilahallinta on yksinkertaisuudessaan logiikan ja käyttöliittymän yhteen saattamista ja niiden välisen datan viemistä eteenpäin. Deklaratiiviset ohjelmistokehykset voivat aiheuttaa loppukehittäjille vaikeuksia luoda hyvää ja hallittavaa koodia. Työssä käytettiin Flutter, Provider, Flutter BloC virallisia dokumentaatioita.
Tilanhallintatekniikoita vertailtiin teoriaosuudessa tarkastelemalla niiden toimintaa ja ominaisuuksia. Tarkastelun perusteella luotiin kolme käyttöliittymältään identtistä esimerkkisovellusta ja luotiin testi, jolla pystytään vertaamaan esimerkkisovelluksien suorituskykyeroja.
Opinnäytetyö saavutti tarkoituksensa tarjota yksityiskohtaisen vertailun kolmen suositellumman tilanhallinta menetelmän välillä. Tulokset osoittavat, että Flutter BloC tilanhallintatekniikkaa kannattaa käyttää suuremmissa sovelluksissa. Provider on selkeä voittaja helppokäyttöisyyden suhteen. SetStatea tulisi käyttää täydentämään käytettyä tilanhallintatekniikkaa, ylimääräisen koodin vähentämiseksi.
Flutter is a declarative software framework. The greatest difference between declarative software frameworks and imperative software frameworks is the possible development of applications without differentiating the application interface and application logic.
At its core, application state management is bringing application logic and application user interface together and creating communication between them. Declarative software frameworks can make it difficult for the developer to create good and maintainable code. The official documentation of Flutter, Provider, Flutter BloC was used in the study.
State management techniques were compared in the theoretical part of this thesis by examining their properties and features. Based on the review, three sample applications with identical user interfaces were created and a test was created to compare the performance differences of the sample applications.
The thesis achieved its purpose to provide a detailed comparison of the current top three recommended state management approaches. The results indicate that Flutter BloC is the leader when it comes to handling larger applications. When it comes to ease of use the Provider is the clear winner. SetState should be used to complement the used state management technology to reduce boilerplate code.