rounded_modal 1.0.1

rounded_modal #

THIS PLUGIN IS NOW DEPRECATED #

You can now properly use borders with the default implementation of showModalBottomSheet!

showModalBottomSheet(
  shape: RoundedRectangleBorder(
     borderRadius: BorderRadius.circular(10.0),
  ),
  backgroundColor: Colors.white,
);

##

A custom implementation of showModalBottomSheet.

Instead of overriding the entire theme of the app (which caused problems in various parts of my app) as suggested by other solutions on "How to set rounded corners of a modal?", I decided to take a look at the implementation for showModalBottomSheet and find the problem myself.

Getting Started #

Turns out that all that was needed was wrapping the main code for the modal in a Theme widget that contains the canvasColor: Colors.transparent trick. I also made it easier to customize the radius and the background color of the modal itself.

screenshot

import 'package:rounded_modal/rounded_modal.dart';

showRoundedModalBottomSheet(
   context: context,
   radius: 10.0,  // This is the default
   color: Colors.white,  // Also default
   builder: (context) => ???,
);

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[1.0.1] - 2019-08-05

This plugin is now DEPRECATED as you can now do proper borders with the default implementation from showModalBottomSheet as follows:

showModalBottomSheet(
  shape: RoundedRectangleBorder(
     borderRadius: BorderRadius.circular(10.0),
  ),
  backgroundColor: Colors.white,
);

[1.0.0] - 2018-10-12

  • Added fix from @slightfoot that handles the issue of modals hiding the keyboard if any text input is part of its layout

[0.0.1] - 2018-09-01

  • First release for this amazingly simple package

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  rounded_modal: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:rounded_modal/rounded_modal.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
91
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
77
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and rounded_modal.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8