2

I want to to create a custom bottom app bar with CustomPainter in flutter: I already try the code below but is not give me the result i want:

i want somthing like this : radius container

from my container widget:

Container(
    height: ConfigSize.screenHeight * 0.15,
    width: ConfigSize.screenWidth,
    decoration: BoxDecoration(
      color: CustomColor.white,
      borderRadius: BorderRadius.vertical(
        top: Radius.circular(CustomRadius.appbarradius),
      ),
    ),
  ),

import 'package:flutter/material.dart';

class Chevron extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    var paint = Paint();
    paint.color = Colors.white;
    Path path = Path();
    path.moveTo(0, size.height * 0.5);

    path.quadraticBezierTo(0, size.height * 0.15, size.width * 0.2, 0);

    path.lineTo(size.width * 0.36, 0);

    path.quadraticBezierTo(
        size.width * 0.5, size.height * 0.95, size.width * 0.65, 0);
    path.quadraticBezierTo(size.width*0.99, 0, size.width, size.height * 0.65);
    //path.lineTo(size.width, 0);
    path.lineTo(size.width, size.height);
    path.lineTo(0, size.height);
    path.close();

    canvas.drawPath(path, paint);
  }

      @override
      bool shouldRepaint(CustomPainter oldDelegate) => false;
    }

Notice : I want the custom container like the image with custom painter with no need to use BottomAppBar widget or FloatingActionButton

mevos19
  • 15
  • 4
  • I believe this question/answer might be helpful for you: https://stackoverflow.com/questions/52592588/bottomappbar-floating-action-button-notch-inset-is-not-transparent – J. S. Jan 22 '20 at 14:04
  • Unfortunately no, I want to the custom container like the image with custom painter with no needs to use BottomAppBar widget or FloatingActionButton – mevos19 Jan 22 '20 at 14:37

0 Answers0