Using Gradients, Fractional Offsets, Page Views and Other Widgets in Dart's Flutter Framework

in #utopian-io6 years ago (edited)

What Will I Learn?

  • You will learn how to make use of the Page View in the flutter framework
  • You will learn how to use Fractional Offsets for aligning items
  • You will learn how to build a Linear Gradient
  • You will learn how to use the decorated box and material widgets

Requirements

Difficulty

  • Intermediate

Description

In this video tutorial, we build out a simple flutter wallpaper or photo gallery application. The basic concept behind this application was to properly demo how to use the page view widget, factional offsets, make linear gradients, and use other widgets like the material widget and the decorated box widget.

In flutter, we have various different scrolling list style widgets to choose from; the grid view, the list view and the page view. The page view is different because it constrains the view-port so that only one of the pages can be on the screen as a focus at a given moment. It also lazily loads the other pages which makes it optimal for applications that use large infinite lists of data.

Linear gradients are a method of mixing multiple colors in a way that flows from one color to the next. These gradients also use a linear function to define how they transition from one color to the next. In flutter, we can supply our linear gradients infinite colors and we must setup where the gradient starts and ends on our screen. In this application, we use this gradient to slightly overlay on top of our wallpapers to give them a little depth.

Factional offsets are positional coordinates similar to normal offsets. The main difference is that a fractional offset uses a smaller number (typically between -1.0 and 1.0) to represent the various areas of the screen. In this way, fractional offsets are more reactive and more useful for applications that must react to different screen sizes.

The source code for this project can be found here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

That was really quick. Thank you for moderating my content.

Hey @ewq, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

well done tensor!

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64118.79
ETH 3390.14
USDT 1.00
SBD 2.51