Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@gosutesu

Flutter tips 丸みを帯びた四角

More than 1 year has passed since last update.

Flutter 丸みを帯びた四角

Flutterで丸みを帯びた四角系の簡単な方法を知っていますか。
FlutterではClipRRectを使用することで簡単に作成できます。

import 'package:flutter/material.dart';

class Sample extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        body:Center(
          // 丸みを作るWidget
          child: ClipRRect(
          // 曲線の度合いを設定
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(50.0),
              bottomLeft: Radius.circular(50.0),
            ),
              child: Container(
                child: Center(child:Text("center")),
                height: 100,
                width: 100,
                color: Colors.blue[500],
              )
          ),
        )
    );
  }
}

下の画像のように丸みを帯びた四角が簡単に出来上がります。

スクリーンショット 2019-05-15 12.18.09.png

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
gosutesu
株式会社システムアイに勤めています。業務でJavaを扱っているので、それの情報をまとめてあげていきたいと思ってます。後、趣味でReactとTypeScriptをやっているので、それに関する勉強のまとめを中心に。
systemi
ランドマークタワーを拠点に活躍する独立系システム会社

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?