An Intro To Flutter

Share if the site was helpful

An Intro To Flutter

When Google I/O came and went in May one of the topics that captured a lot of interest was Flutter. Offering a whole new option for cross platform code, Flutter has been gaining traction over the past few years. I talked about it briefly a few weeks ago, but let’s dive more into the details of why it may be worth learning.

What is Flutter?

First, let’s get a quick primer of what Flutter actually is.  It’s a toolkit developed in 2017 by Google that allows you to write code for both Android and iOS devices.  You can write code once, and then implement it anywhere.  And by anywhere, I mean Android, iOS, web, and desktop.  Already if you’re a freelancer I’m sure you see some appeal here!

It’s written in Dart which hasn’t been too popular of a language in the past, but Flutter is breaking that trend.  It’s been featured at I/O for a few years straight now, and Google uses it for internal apps, so it’s not going away any time soon.  The framework revolves around widgets.  Everything in a Flutter app is a widget.  Widgets describe what a view should look like given its current state, and when that state changes a widget rebuilds its description.  It sounds kind of foreign until you dive in.

Let’s see some code!

I won’t waste time going through how to set up Flutter on your computer.  Here’s a good link to walk you through that (don’t worry it’s super simple).  For my personal use I’ve been using Flutter in Visual Studio Code, but you can also develop in other IDE’s such as Android Studio if you’re more comfortable with those. To get started run the command flutter create hello_world.  This will take care of everything for you creating a new application named hello_world.  To run it, type cd hello_worldto enter that directory, and then type flutter runto kick things off.

Congratulations!  You’re officially looking at your first flutter app. Whether you ran it on an iPhone or an Android device (or somewhere else) you should see an app that looks like this:

So what made this app? Well, this is from the default code that Flutter made for us.  In your navigation sidebar you should see folders for things such as android, ios, and lib.  There are some others as well, but I point these out because at its core you’ll work in the lib folder.  And the others will allow you to transport that code into iOS and Android phones. That’s REALLY oversimplifying it, but it’s not wrong!

main.dart:

Let’s open the lib folder, and inside we’ll see one file named main.dart.  This is the core of your app right now.  If you open up main.dart you’ll see what is creating the widgets currently showing on your phone.  For anyone just reading and not following along, here’s what it looks like:

In here we can see pretty hefty comments explaining everything.  The app starts by calling the method runApp() and passing in an instance of our class MyApp.  And as we can see right below that, MyApp is a StatelessWidget.  There are stateful and stateless widgets in Flutter, and we’ll go into them down the road, but for now just know what a widget is.

One really cool thing about Flutter is hot reloading.  When you want to rerun an app and see any changes you’ve made, you only have to recompile widgets that have changed their state.  The end result of this is incredibly fast reload speeds (milliseconds). Go ahead and try this out.  Under theprimarySwatchattribute change it from Colors.blue to Colors.red. Once you’ve done that save the project and in the terminal press “r”. Instantly you’ll see the theme of your app change from blue to red.  It’s really that simple to reload!

I’ve loved my experience thus far with Flutter because of the way it is structured and hot-reloading. There’s a whole world of development to explore, but if you get started and want to let us know what you like/dislike about it let us know in the comments below!

 

 

Google Glasses 2.0 In Sight

Share if the site was helpful

Google Glasses 2.0 In Sight

You guys all remember Google Glasses right?  The augmented reality headset designed to look like regular glasses, but do so much more? Well you might, but you probably didn’t get to know them too well because they flopped pretty hard in 2014. But don’t worry, Google Glasses 2.0 are here and look promising!

2ndTry’s the Charm:

The Glass Enterprise Edition 2 is on the market for $999.  Kind of.  It’s not being sold direct to consumers yet, but instead is entering the corporate world. The goal of these glasses is to “meet the demands of the growing market for wearables in the workplace” according to a post by Google.  Of course given enough time I’m sure we’ll see them used for fun too!

When Google first released the glasses, they were aimed at the public, but they received a lot of backlash for issues related to privacy.  It also didn’t help the glasses didn’t always work as intended.  Due to the complaints the focus turned towards professional uses such as surgery or factory work.  The business focus is sticking around for 2.0 as Google attempts to nail down a target market before expanding.

The Specs (Get it??):

2.0 actually looks a lot like the original Glass design.  Instead of a full headset like Microsoft’s HoloLens, Glass actually looks like a simple pair of black thick rimmed glasses.  But it can do quite a bit more than regular spectacles.  It has a new processor, a souped up camera, and a better battery for longer life.

Google says that the new headset incorporates computer vision and advanced machine learning capabilities.  Using Lens it can offer features like sign translation or info about restaurants nearby. It runs on Android, so there’s no reason to start moving away from the core topics off app development.  Instead they’ll be incorporated into newer forms of technology like this one.

Putting the Competition in Focus:

Unlike some of the other headsets we’ve seen in recent years, Google’s Glass Enterprise Edition 2 actually looks like a pair of regular glasses.  So regardless of what it can do, that’s already a good step in the right direction.  The less invasive a piece of technology can be the better from a user’s experience. It’s available in a frameless version or with a Smith Optics supplied safety frame (for use in manufacturing type jobs).

Glass is augmented reality focused with this smaller hardware, whereas some other entrants have focused on virtual reality.  Take the Vive headset for example.  It’s a complete headset that wraps around your head and obscures any vision unless it’s turned on.  The end result of course being that you can see into whatever virtual world is created. Glass instead builds on top of the real world.  In this sense it’s more like Magic Leap.  And with strides in ARCore over the past few years the ways it can interact with everyday objects are probably pretty impressive.  It’s important to consider this when thinking of competing forces. There are multiple headsets, but they also don’t necessary completely rule out one another.

What are your thoughts on the new Google glasses?  Let us know in the comments below!

 

 

Duplex Is Officially Here

Share if the site was helpful

Duplex Is Officially Here

Time after time we’ve seen Google Duplex in the news, but it’s always been just on the horizon for the mass market.  Well here’s some news that isn’t just a tease: Duplex is now on your phone!

Pixels Now Have Duplex:

Ok, sorry to get your hopes up if you’re not team Pixel, but if you are, then this is good news for you. Google has just rolled out Duplex to Pixel phones in 43 states.  This means that if you own a Pixel and live in one of these states, you can now have your Google Assistant call on your behalf.  Looking for a restaurant reservation?  Just say “Ok Google, make a reservation at ___”.

That’s it.  Duplex will call the restaurant and take care of everything else.  Ok, it will ask you a few more details (such as for what time and for how many people), but it takes care of all the conversing on the phone.  The future is now.

Just how good is it?

Google actually received a ton of criticism after I/O last year when Duplex made its debut.  People were concerned that it mimicked a human toowell.  In June the company promised that Google Assistant would introduce itself before engaging in any conversation.  If you’ve used Google’s call screening feature before then you’re somewhat familiar with this introduction.

Duplex uses Google’s WaveNet audio processing neural network, and as such it sounds incredibly natural.  It throws “ums” into the conversation to mimic how people actually converse. While these may seem arbitrary, the VP of engineering for Google Assistant said that they are actually the key to keeping people engrossed in conversation.  Otherwise things start to feel too artificial and people hang up.

Opting Out:

While this technology is incredible, there are certainly going to be people that want nothing to do with it yet.  And as such Duplex makes it very clear that the call is automated, and informs everyone it calls that their being recorded.  If they respond with anything along the lines of “I don’t want to be recorded” or “I don’t want to speak with this” then the call is handed off to a human operator.

There’s sure to be some legal/ethical issues that arise despite this, but it’s good to at least see people are given the option to opt out.  Duplex is going to continue its rollout to other devices over time, and eventually it will just be taken for granted.  But for now its cutting edge tech and Pixel users can take advantage of it.

What are your thoughts on Duplex and its rollout?  Let us know in the comments below!

 

en English
X