What is new in Flutter 2.8

Using Flutter’s single codebase we can create applications for Android, iOS, Windows, Linux, Web and many more. Flutter 2.8 has added many interesting features that makes this development much easier. In addition it’s added a major performance booster.

If you’ve been reading my blog, you may have noticed that I have written about the earlier Flutter revisions and releases.

https://sanjibsinha.com/flutter-2-5-changes/
https://sanjibsinha.com/flutter-2-5-template/
https://sanjibsinha.com/latest-version-flutter/

However, Flutter 2.8 has overtaken 2.5 and improving the performance of Flutter applications on mobile devices.

We can simply upgrade to the new version by issuing this command on our terminal.

flutter upgrade

It takes some time to upgrade depending on the speed of your internet.

Then you can check the Flutter and Dart version.

Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cf44000065 (3 days ago) • 2021-12-08 14:06:50 -0800
Engine • revision 40a99c5951
Tools • Dart 2.15.0
....
Dart SDK version: 2.15.0 (stable) (Fri Dec 3 14:23:23 2021 +0100) on "linux_x64"

As a result, our Flutter applications open faster and consume less memory.

As some of Google’s core apps like Google Play and Stadia uses Flutter, it’s quite expected that Google will keep improving Flutter core.

Flutter 2.8 ha made it much easier to connect to Firebase. The good news is Firebase plugins for Flutter have been upgraded from “Beta” to “Stable.”

Now, sign-in has also become easier with a Widget.

We’ve just seen that with the revision and new release of Flutter 2.8, Dart programming language SDK has also been updated to 2.15.

We’ll discuss in a separate post how we can utilise Dart’s new features. Some features will definitely boost the development of Flutter User Interfaces.

Dart 2.15 also brings concurrency improvements, enhanced enumerations, and optimisations that provide a 10 percent reduction in memory utilisation.

However, I personally like the web view part.

The webview_flutter plugin has been upgraded to 3.0 and that means provides preliminary support for a new platform: the web.

To use it, we can add the following line to your pubspec.yaml:

dependencies:
  webview_flutter: ^3.0.0
  webview_flutter_web: ^0.1.0 

To sum up, Flutter 2.8 promises faster startup and lower resource requirements for mobile apps. We can also easily connect with the back-end services.

Let us try webview_flutter plugin in a simple Flutter 2.8 application.

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: const Text('Flutter WebView example')),
        body: const WebView(initialUrl: 'https://sanjibsinha.com'),
      );
}

Just run the code and you’ll find that web view has brought the web pages as we want.

Flutter 2.8 and web view 3.0 plugin
Flutter 2.8 and web view 3.0 plugin

We can always check out the new webview codelab, which might give us a proper guide to host web content in our Flutter app.

What Next?

Books at Leanpub

Books in Apress

My books at Amazon

GitHub repository

Technical blog

Twitter

Comments

One response to “What is new in Flutter 2.8”

  1. […] with reference to mobile application development, there has not been a great change. Structurally what we have been doing, will continue to […]

Leave a Reply