アプリ関連ニュース

JWT (JSON Web Token)

You might be heard about JWT or even used it in your project for authorization. Today I will talk about JWT , what it’s and how it works.

JSON Web Token (JWT) is an open standard (RFC 7519) for securely transmitting information between parties as a JSON object.This information can be verified and trusted because it is digitally signed.

Where we can use JWT ?

JWT is a token-based authentication mechanism which is stateless. The server does not have store the information or data to hold session information.

Authorization:

This is the most common scenario for using JWT. Once the user is logged in, the next requests will be attached by JWT, allowing the user to access resources that are controlled with that token. Single Sign On is a feature that widely uses JWT nowadays, because of its small overhead and its ability to be easily used across different domains.

Information Exchange:

It’s also good for securely transmitting information between parties. Because JWTs can be signed—for example, using public/private key pairs—you can be sure the senders are who they say they are.

How it works

  • User login with username and password or google / facebook.
  • The authentication server verifies the credentials and issues a signed JWT using a secret salt or private key.
  • The client uses the JWT to access protected resources by passing the JWT in the HTTP authorization header.
  • The resource server then verifies the authenticity of the token using the public key / secret salt.

That is for now. I will talk about the JWT structure nextweek.

Yuuma



Switch List Tile in flutter

Take a moment to think back to the last time you looked at the settings page. If you wish you would quickly and easily create a list of toggle switches like that, just use SwitchListTile.

Switch List Tile, you get a little tile that’s tappable anywhere to switch a toggle from off to on.

SwitchListTitles API looks a lot like widgets of similar names. ListTile, CheckboxListTile, RadioListTile, SwitchListTile all follow the same pattern.

ListTile(
 title: Text("List Tile"),
),
SwitchListTile(
 title: Text("Switch List Tile"),
/*.....*/
),

Start with the title : Text, which will appear in the middle of the tile. Then you can add Icons to either end, and with the control tiles like SwitchListTile.

ListTile(
 title: Text("List Tile"),
 leading: Icon(Icons.ac_unit),
 trailing: Fire(),
),
SwitchListTile(
 title: Text("Switch List Tile"),
 secondary: Icon(Icons.ac_unit),
 
),

Hope you enjoyed this article!

By Ami



[Flutter] BottomNavigationBar を使用したナビゲーションメニューの作成

FlutterのUIの勉強のために、
Amazonのアプリのような画面下部のナビゲーションメニューで
画面を切り替えるアプリを作成しました。

続きを読む

Codespaces

We might heard about the news of codespace from github recently. If you don’t , it’s ok. I will briefly introduce about codespace today.

Credit: Github

GitHub has announced its product, Codespaces recently for its daily development flow. Codespaces provides a full-featured cloud-hosted development environment that can be very useful for day to day development or short interval period development for overall cases. Codespaces now supports Emacs, Vim and Visual Studio Code as code editors.

After Microsoft bought Github, I knew this is probably coming as a service and here it is. They said

Local development environments are fragile. And even when functioning perfectly, a single-context, bespoke local development environment felt increasingly out of step with the instant-on, access-from-anywhere world in which we now operate.

The Codespaces can run directly within GitHub, so developers can start contributing to their projects almost instantly.

According to GitHub, The target of Codespaces not only fixed the issue of vulnerabilities in the local environment, but also provided additional opportunities to improve the development experience. Much effort to run in a single developer local environment. Similarly, developer machines can be upgraded to higher specs very easily.

You can see the official announcement blog here and don’t forget to try it out as it’s exciting to do a development not at locally as we usually do, this time is at cloud.

Yuuma.



Flutter – Physical Model

All of the best app start with a square, squarely in the middle of the screen. But to turn this abstract idea into something more real we need to think outside the box.

All of the best app start with a square, squarely in the middle of the screen. But to turn this abstract idea into something more real we need to think outside the box.

If you look at the real physical box the only way you’re able to see it with some light, and that light casts a shadow. What if we want our abstract boxes to have a real shadow? Just like a real box. So that our users have a mental model for what the things in your app are.

Well, that’s what a Physical Model is for. Just take whatever widget you’re working with, wrap it inside of a Physical Model and give it a color.

PhysicalModel(
  child: BlueBox(),
  color: Colors.black,
)

Wait! There is no shadow. By default Physical Model’s elevation is zero, so we need to pick that box up to be able to see the shadow.

PhysicalModel(
  child: BlueBox(),
  color: Colors.black,
  elevation:  8.0
)

But unlike the real world we have additional options, for our Physical model’s shadows, like it’s color.

PhysicalModel(
  child: BlueBox(),
  color: Colors.black,
  shadowColor: Colors.pink,
  elevation:  8.0,
)

You can also change the roundness of the shadow’s corners.

PhysicalModel(
  child: BlueBox(),
  color: Colors.black,
  shadowColor: Colors.pink,
  elevation:  8.0,
  borderRadius: 
   BorderRadius: circular(45),
)

or simply update what shape it takes.

PhysicalModel(
  child: BlueBox(),
  color: Colors.black,
  shadowColor: Colors.pink,
  elevation:  8.0,
  shape: BoxShape.circle,
)

Physical Model is super useful, when you have ideas for custom shadow effects, it’s also used under the hood in widgets like Material to build material shadow.

Let’s create simple Physical model!! The result screenshoot is at the top.

    return Scaffold(
      body: Center(
        child: PhysicalModel(
          elevation: 20.0,
          shadowColor: Colors.red,
          color: Colors.red,
          child: Container(
            width: 200,
            height: 200,
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              border: Border.all(
                color: Colors.red,
                width: 1.0,
              ),
            ),
          ),
        ),
      ),
    );

Hope you enjoyed this post!

By Ami



アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム