Nina Diana

Nina Diana

1558152530

A guide on getting started with Flutter Create 😴

In this article, I’ll quickly go over what Flutter Create is and how you can build a Flutter app for it.

I’ve built a quotes generator app for Flutter Create, since it’s simple, fun to build and tickles your funny bone. More importantly, it doesn’t require a lot of code, which is a primary requisite for a Flutter Create submission.

But first, let’s talk about Flutter Create…

What is Flutter Create ?

For those of you who don’t know what Flutter Create is, it is a competition by Google where developers are required to build a Flutter app that has Dart code that doesn’t exceed 5,120 bytes.

The submissions are judged by:

  • how amazing the idea is,
  • how good the app looks, and
  • how high-quality the code is.

Winners get to take away a few exciting prizes but that’s really not what we are focusing on in this article.

You can read more about the rules and guidelines for Flutter Create here.

Now, let’s get started with how I built my app for this contest!

flutter create project command

The Idea

The app that I built was based on a REST API provided by Andrew Jazbec, that provides a random bunch of quotes by Kanye West. 👻

Since the contest requires us to write very minimal code, I decided to go with the idea of building a Flutter app that shows random Kanye West quotes since I found it humorous and cheeky. Who wouldn’t love quotes from Yeezy? 😜

I also decided to add an About screen, because…why not? 🕶

The Design

But I also wanted to design the app well, since that also matters for the contest, which is why I included custom fonts and a set of gradients in the app.

I also designed an app icon for this using Figma, and I’ll go over how to change app icons for iOS and Android devices easily later in this article.

Here’s what the app looks like:

flutter tutorial android studio

The Development

Before I began with the main.dart file, I first wrote the data class for the quote object in the quote.dart file:

class Quote {
  final String quote;
  final String id;

  Quote.fromJson(Map<String, dynamic> json)
      : quote = json['quote'],
        id = json['id'];
}

quote.dart

Each quote object has a unique ID and the quote string itself.

Keep in mind it’s important to keep your code minimal, which is why I’ve only defined the things that I’ll absolutely need here, one of which is the factory for creating a quote.

Here’s my call to get a quote from the API:

Future<void> getQuote() async {
    String baseUrl = 'http://api.kanye.rest/';
    try {
      http.Response response = await http.get(baseUrl);
      var myQuote = Quote.fromJson(jsonDecode(response.body));
      setState(() {
        _quote = myQuote.quote;
        _gradientColors.shuffle(_random);
        _colorOne = _gradientColors[0];
        _colorTwo = _gradientColors[1];
      });
    } catch (e) {
        return;
    }
  }

api_call.dart

Since this article is more about Flutter Create and building an app for the contest, I won’t be going over how I built the app step-by-step.

Here’s the code for main.dart:

import 'package:flutter/material.dart';
import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'package:http/http.dart' as http;
import 'about_screen.dart';
import 'quote.dart';

void main() => runApp(KutInApp());

class KutInApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Kut In',
      theme: ThemeData(
        fontFamily: 'Imperator',
        textTheme: Theme.of(context).textTheme.apply(bodyColor: Colors.white),
      ),
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  String _quote;
  List<Color> _gradientColors = [
    const Color(0xfff44336),
    const Color(0xffba000d),
    const Color(0xff9c27b0),
    const Color(0xff6a0080),
    const Color(0xff2196f3),
    const Color(0xff0069c0),
    const Color(0xfffdd835),
    const Color(0xffc6a700)
  ];
  final _random = Random();
  Color _colorOne, _colorTwo;

  Future<void> getQuote() async {
    String baseUrl = 'http://api.kanye.rest/';
    try {
      http.Response response = await http.get(baseUrl);
      var myQuote = Quote.fromJson(jsonDecode(response.body));
      setState(() {
        _quote = myQuote.quote;
        _gradientColors.shuffle(_random);
        _colorOne = _gradientColors[0];
        _colorTwo = _gradientColors[1];
      });
    } catch (e) {}
  }

  void _getNewQuote() {
    setState(() {
      _quote = null;
    });
    getQuote();
  }

  @override
  void initState() {
    super.initState();
    getQuote();
    _gradientColors.shuffle(_random);
    _colorOne = _gradientColors[0];
    _colorTwo = _gradientColors[1];
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          gradient: LinearGradient(colors: [_colorOne, _colorTwo]),
        ),
        child: Padding(
          padding: const EdgeInsets.all(24.0),
          child: Center(
            child: Column(
              children: <Widget>[
                Stack(
                  children: <Widget>[
                    Align(
                      alignment: Alignment.bottomCenter,
                      child: Padding(
                        padding: const EdgeInsets.only(top: 16.0),
                        child: Text('KUT IN'),
                      ),
                    ),
                    Align(
                      alignment: Alignment.centerRight,
                      child: IconButton(
                        icon: Icon(Icons.info, color: Colors.white),
                        onPressed: () {
                          Navigator.push(
                              context,
                              MaterialPageRoute(
                                builder: (context) => AboutScreen()
                              ));
                        },
                      ),
                    ),
                  ],
                ),
                Expanded(
                  child: Align(
                    alignment: Alignment.center,
                    child: _quote != null
                        ? Text('$_quote',
                            style: TextStyle(
                              fontSize: 34.0,
                              height: 1.25,
                            ))
                        : CircularProgressIndicator(),
                  ),
                ),
                Text('- Kanye West'),
              ],
            ),
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(onPressed: _getNewQuote, child: Icon(Icons.refresh)),
    );
  }
}

Psst! The size of Dart files for this entire project? 5102 bytes.

flutter language

Checking the size of Dart files

To check the size of the Dart files in your project, just type in the following command in a terminal that’s open in your root project folder:

find . -name "*.dart" | xargs cat | wc -c

If you’re using IntelliJ or Visual Studio Code, you can just use the Terminal option available in these IDEs to run the command in the root project folder.

“Is it okay if I have too many images/fonts/assets/packages?”

Yes, that should be fine. As the contest rules state, the only files whose size matter is the Dart files in your project. Only they are measured and they need to be less than 5,120 bytes in size combined.

So feel free to go ahead and include packages, custom fonts, images and other assets in your Flutter app!

Polishing Up…

  1. Reduce the size of your Dart files by removing unnecessary code as much as you can! Remove the test.dart file, unnecessary commas and duplicate theming code. But do not forgo proper indenting and formatting, since the code quality matters as well.
  2. Give your app a good description and be sure to mention yourself as the author in the pubspec.yaml file.
  3. Another rule of the contest is that your project should have a README.md and a LICENSE file.
  • For the README, make sure that you explain what your app is about and if your app requires any configurations to be setup, add the instructions for the same in this file.
  • For the LICENSE file, make sure you’re using either an Apache, MIT or BSD License. If you need help figuring out which license to use, you can go through this nice little guide.

4. For my app, I designed an app icon of resolution 512x512 in Figma, a simple design tool that quickly lets you make app mockups and icons. After adding my app icon to the assets folder, I added a neat little package called [flutter_launcher_icons](https://pub.dartlang.org/packages/flutter_launcher_icons) to auto-generate app icons for both Android and iOS platforms using my designed icon.

5. Then run the following command to clean up any unneeded build files that may have been generated by Flutter:

flutter clean

Finally, zip up your project folder, because it’s ready to be submitted! 🚀

create new flutter project

Go to the official Flutter Create website, click on the Submit your app button and upload your ZIP file via the form along with a few other details to finalise your submission! 😄

Note: You can only submit one app but you can make changes to your project and re-upload a new ZIP file, as long as you do it before April 7th!

Conclusion

The winners will be announced around April 25th online and also in Google I/O 2019. So what are you waiting for? Get started with Flutter today and build a minimal app before the contest ends! 😉

#ios #mobile-apps #swift #flutter

What is GEEK

Buddha Community

A guide on getting started with Flutter Create 😴

Google's Flutter 1.20 stable announced with new features - Navoki

Flutter Google cross-platform UI framework has released a new version 1.20 stable.

Flutter is Google’s UI framework to make apps for Android, iOS, Web, Windows, Mac, Linux, and Fuchsia OS. Since the last 2 years, the flutter Framework has already achieved popularity among mobile developers to develop Android and iOS apps. In the last few releases, Flutter also added the support of making web applications and desktop applications.

Last month they introduced the support of the Linux desktop app that can be distributed through Canonical Snap Store(Snapcraft), this enables the developers to publish there Linux desktop app for their users and publish on Snap Store.  If you want to learn how to Publish Flutter Desktop app in Snap Store that here is the tutorial.

Flutter 1.20 Framework is built on Google’s made Dart programming language that is a cross-platform language providing native performance, new UI widgets, and other more features for the developer usage.

Here are the few key points of this release:

Performance improvements for Flutter and Dart

In this release, they have got multiple performance improvements in the Dart language itself. A new improvement is to reduce the app size in the release versions of the app. Another performance improvement is to reduce junk in the display of app animation by using the warm-up phase.

sksl_warm-up

If your app is junk information during the first run then the Skia Shading Language shader provides for pre-compilation as part of your app’s build. This can speed it up by more than 2x.

Added a better support of mouse cursors for web and desktop flutter app,. Now many widgets will show cursor on top of them or you can specify the type of supported cursor you want.

Autofill for mobile text fields

Autofill was already supported in native applications now its been added to the Flutter SDK. Now prefilled information stored by your OS can be used for autofill in the application. This feature will be available soon on the flutter web.

flutter_autofill

A new widget for interaction

InteractiveViewer is a new widget design for common interactions in your app like pan, zoom drag and drop for resizing the widget. Informations on this you can check more on this API documentation where you can try this widget on the DartPad. In this release, drag-drop has more features added like you can know precisely where the drop happened and get the position.

Updated Material Slider, RangeSlider, TimePicker, and DatePicker

In this new release, there are many pre-existing widgets that were updated to match the latest material guidelines, these updates include better interaction with Slider and RangeSliderDatePicker with support for date range and time picker with the new style.

flutter_DatePicker

New pubspec.yaml format

Other than these widget updates there is some update within the project also like in pubspec.yaml file format. If you are a flutter plugin publisher then your old pubspec.yaml  is no longer supported to publish a plugin as the older format does not specify for which platform plugin you are making. All existing plugin will continue to work with flutter apps but you should make a plugin update as soon as possible.

Preview of embedded Dart DevTools in Visual Studio Code

Visual Studio code flutter extension got an update in this release. You get a preview of new features where you can analyze that Dev tools in your coding workspace. Enable this feature in your vs code by _dart.previewEmbeddedDevTools_setting. Dart DevTools menu you can choose your favorite page embed on your code workspace.

Network tracking

The updated the Dev tools comes with the network page that enables network profiling. You can track the timings and other information like status and content type of your** network calls** within your app. You can also monitor gRPC traffic.

Generate type-safe platform channels for platform interop

Pigeon is a command-line tool that will generate types of safe platform channels without adding additional dependencies. With this instead of manually matching method strings on platform channel and serializing arguments, you can invoke native class and pass nonprimitive data objects by directly calling the Dartmethod.

There is still a long list of updates in the new version of Flutter 1.2 that we cannot cover in this blog. You can get more details you can visit the official site to know more. Also, you can subscribe to the Navoki newsletter to get updates on these features and upcoming new updates and lessons. In upcoming new versions, we might see more new features and improvements.

You can get more free Flutter tutorials you can follow these courses:

#dart #developers #flutter #app developed #dart devtools in visual studio code #firebase local emulator suite in flutter #flutter autofill #flutter date picker #flutter desktop linux app build and publish on snapcraft store #flutter pigeon #flutter range slider #flutter slider #flutter time picker #flutter tutorial #flutter widget #google flutter #linux #navoki #pubspec format #setup flutter desktop on windows

Terry  Tremblay

Terry Tremblay

1598396940

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking** Android and iOS** applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).

flutter-mobile-desktop-web-embedded_min

Flutter was officially released in December 2018. Since then, it has gone a much stronger flutter community.

There has been much increase in flutter developers, flutter packages, youtube tutorials, blogs, flutter examples apps, official and private events, and more. Flutter is now on top software repos based and trending on GitHub.

Flutter meaning?

What is Flutter? this question comes to many new developer’s mind.

humming_bird_dart_flutter

Flutter means flying wings quickly, and lightly but obviously, this doesn’t apply in our SDK.

So Flutter was one of the companies that were acquired by **Google **for around $40 million. That company was based on providing gesture detection and recognition from a standard webcam. But later when the Flutter was going to release in alpha version for developer it’s name was Sky, but since Google already owned Flutter name, so they rename it to Flutter.

Where Flutter is used?

Flutter is used in many startup companies nowadays, and even some MNCs are also adopting Flutter as a mobile development framework. Many top famous companies are using their apps in Flutter. Some of them here are

Dream11

Dream11

NuBank

NuBank

Reflectly app

Reflectly app

Abbey Road Studios

Abbey Road Studios

and many more other apps. Mobile development companies also adopted Flutter as a service for their clients. Even I was one of them who developed flutter apps as a freelancer and later as an IT company for mobile apps.

Flutter as a service

#dart #flutter #uncategorized #flutter framework #flutter jobs #flutter language #flutter meaning #flutter meaning in hindi #google flutter #how does flutter work #what is flutter

Punith Raaj

1640672627

Flutter Hotel Booking UI - Book your Stay At A New Hotel With Flutter - Ep1

https://youtu.be/-tHUmjIkGJ4
Flutter Hotel Booking UI - Book your Stay At A New Hotel With Flutter - Ep1
#flutter #fluttertravelapp #hotelbookingui #flutter ui design 

In this video, I'm going to show you how to make a Cool Hotel Booking App using Flutter and visual studio code. 

In this tutorial, you will learn how to create a Splash Screen and Introduction Screen, how to implement a SmoothPageIndicator in Flutter. 

🚀 Nice, clean and modern Hotel Booking #App #UI made in #Flutter 

⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub. 

► Social Media 

    GitHub: https://github.com/Punithraaj 

    LinkedIn: https://www.linkedin.com/in/roaring-r...

    Twitter: https://twitter.com/roaringraaj

    Facebook: https://www.facebook.com/flutterdartacademy

I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub! 

⭐️ Thanks for watching the video and for more updates don't forget to click on the notification.⭐️Please comment your suggestion for my improvement. ⭐️Remember to like, subscribe, share this video, and star the repo on Github :)Hope you enjoyed this video! If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj

#flutter riverpod #flutter travel app #appointment app flutter #morioh

Adobe XD plugin for Flutter with CodePen Tutorial

Recently Adobe XD releases a new version of the plugin that you can use to export designs directly into flutter widgets or screens. Yes, you read it right, now you can make and export your favorite design in Adobe XD and export all the design in the widget form or as a full-screen design, this can save you a lot of time required in designing.

What we will do?
I will make a simple design of a dialogue box with a card design with text over it as shown below. After you complete this exercise you can experiment with the UI. You can make your own components or import UI kits available with the Adobe XD.

#developers #flutter #adobe xd design export to flutter #adobe xd flutter code #adobe xd flutter code generator - plugin #adobe xd flutter plugin #adobe xd flutter plugin tutorial #adobe xd plugins #adobe xd to flutter #adobe xd tutorial #codepen for flutter.

punith raj

1642514982

Flutter Hotel Booking UI - Book your Stay At A New Hotel - Ep3

Flutter Hotel Booking UI - Book your Stay At A New Hotel - Ep3

In this video, I'm going to show you how to make a Cool Hotel Booking App using Flutter from scratch.

In this Episode , you will learn how to create a Custom Navigation Bar for Navigating between Screen.

🚀 Nice, clean and modern Hotel Booking #App #UI made in #Flutter

⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub.

Starter Project : https://github.com/Punithraaj/Flutter_Hotel_Booking_UI/tree/Episode-2

► Timestamps 

0:00 Intro 

0:15 Custom Bottom Navigation Screen 

07:26 Tab Button

► Social Media 

GitHub: https://github.com/Punithraaj/Flutter_Hotel_Booking_UI

LinkedIn: https://www.linkedin.com/in/roaring-r...

Twitter: https://twitter.com/roaringraaj

Facebook: https://www.facebook.com/flutterdartacademy

► Previous Episode : https://youtu.be/A0QdZPpMBb0

► Playlist: https://www.youtube.com/playlist?list=PL6vcAuTKAaYdboy1OOxnMekOEuRzHUvR6

I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub! 

⭐️ Thanks for watching the video and for more updates don't forget to click on the notification. ⭐️Please comment your suggestion for my improvement. ⭐️Remember to like, subscribe, share this video, and star the repo on Github :)

Hope you enjoyed this video!If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj

#morioh #flutter travel app #appointment app flutter #flutter #fluttertravelapp #hotelbookingui #flutter ui design #book your stay at a new hotel app #hotel booking app flutter #flutter travel ui tutorial

https://youtu.be/cCion2y7hNE