Home > database >  Flutter slidebar menu transparent corner
Flutter slidebar menu transparent corner

Time:10-01

I'm trying to make this corner transparent but nothing works I can't make it rounded too. like here I made it black but when I give it color: Color.transparent it is not changing without color: Colors.black it's white Help pls

import 'package:flutter/material.dart';

class SlidebarMenu extends StatelessWidget {
  final padding = const EdgeInsets.symmetric(horizontal: 10);
  final boxBorder = const BoxDecoration(
    borderRadius: BorderRadius.only(
        topRight: Radius.circular(50.0),
        bottomRight: Radius.circular(40.0),
        topLeft: Radius.circular(40.0),
        bottomLeft: Radius.circular(40.0)),
  );

  const SlidebarMenu({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    const string = 'Logged in as: ';
    const email = '[email protected]';
    return SafeArea(
      child: Drawer(
        child: Material(
          child: ListView(
            children: <Widget>[
              Container(
                color: Colors.black,
                child: buildHeader(
                  //end work
                  string: string,
                  email: email,
                ),
              ),

            ],
          ),
        ),
      ),
    );
  }

CodePudding user response:

Try below code hope its help to you.

Add your drawer Widget inside ClipRRect

ClipRRect(
        borderRadius: BorderRadius.only(
          topRight: Radius.circular(35),
          bottomRight: Radius.circular(35),
        ),
        child: Drawer(),
),
  • Related