Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make curved bottom appBar in Flutter?

Tags:

custom appbar

How to draw custom shape for the appBar in my application to look like the image?

like image 406
ialyzaafan Avatar asked Jul 03 '20 00:07

ialyzaafan


1 Answers

I think it is not the appBar's shape.

I think it's the white container below the green-colored appBar that has the rounded corner.

Here's the example:

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.lightBlueAccent,
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(
            padding: EdgeInsets.only(
                top: 60.0, left: 30.0, right: 30.0, bottom: 30.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  'Hello',
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 50.0,
                    fontWeight: FontWeight.w700,
                  ),
                ),
              ],
            ),
          ),
          Expanded(
            child: Container(
              padding: EdgeInsets.symmetric(horizontal: 20.0),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(20.0),
                  topRight: Radius.circular(20.0),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

like image 99
hisam Avatar answered Oct 21 '22 17:10

hisam