bangladesh 0.2.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

The 'Bangladesh' Flutter plugin is a powerful tool for displaying a customizable map of Bangladesh. With division borders highlighted and custom touch feedback, it can be used in a multitude of applications for an engaging user experience.

Bangladesh

The 'Bangladesh' Flutter plugin is a versatile tool that allows developers to effortlessly render a detailed map of Bangladesh within their Flutter applications. With its seamless integration, this plugin provides a visually appealing display of the country's map, highlighting all division borders for enhanced clarity.

Features

  • Render a detailed map of Bangladesh within Flutter applications.
  • Highlight division borders for improved visual representation.
  • Provide custom touch feedback for interactive user experience.
  • Suitable for various applications such as educational apps, travel guides, and more.

Installation

To use the 'Bangladesh' Flutter plugin, follow these steps:

  1. Add the following line to the dependencies section in your project's pubspec.yaml file:
flutter pub add bangladesh
  1. Import the package in your Dart code:
import 'package:bangladesh/bangladesh.dart';

Usage

Render Bangladesh Map

To render the Bangladesh map, use the BangladeshMap widget:

import 'package:bangladesh/bangladesh.dart';

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Bangladesh Map'),
      ),
      body: Center(
        child: Bangladesh(),
      ),
    );
  }
}

Customize Map

The 'Bangladesh' Flutter plugin allows you to provide custom touch feedback when interacting with the map. Here's an example of how to achieve this:

import 'package:bangladesh/bangladesh.dart';

class OurMap extends StatelessWidget {

  @override
  Widget build(BuildContext context,  ) {
    return const BangladeshMap(
      width: 461,
      height: 600,
      rangpurColor: Colors.orange,
      rajshahiColor: Colors.red,
      dhakaColor: Colors.indigo,
      sylhetColor: Colors.blue,
      khulnaColor: Colors.teal,
      chittagongColor: Colors.grey,
      barisalColor: Colors.pink,
      mymensinghColor: Colors.brown,
      showBorder: true,
      showName: true,
      showDivisionBorder: true,
      showDistrictBorder: true,
    );

  }
}

Available Options

Also there are some other properties you can use to customize the map:

FieldTypeDescription
widthdoubleWidth of the map
heightdoubleHeight of the map
animationScaleFactordoubleScale factor for map animation
showNameboolWhether to show division names on the map
showTooltipboolWhether to show tooltips when tapping on divisions
showDistrictBorderboolWhether to show borders around districts
isNameUpperCaseboolWhether division names should be displayed in uppercase
showBorderboolWhether to show borders around divisions
showDivisionBorderboolWhether to show borders between divisions
tooltipFeedbackbool?Whether to provide haptic feedback on tooltip display
tooltipPreferBelowbool?Whether tooltips should be displayed below divisions
tooltipExcludeFromSemanticsbool?Whether tooltips should be excluded from semantics
borderStrokeSizedouble?Size of the border stroke
divisionStrokeSizedouble?Size of the division border stroke
districtStrokeSizedouble?Size of the district border stroke
tooltipHeightdouble?Height of the tooltip
tooltipVerticalOffsetdouble?Vertical offset for tooltip display
borderColorColor?Color of the border
divisionBorderColorColor?Color of the division border
districtBorderColorColor?Color of the district border
tooltipDecorationDecoration?Decoration for the tooltip
tooltipDurationDuration?Duration for tooltip display
tooltipWaitDurationDuration?Duration to wait before displaying the tooltip
tooltipTriggerModeTooltipTriggerMode?Mode for triggering tooltips (long press or tap)
tooltipTextStyleTextStyle?Text style for the tooltip
nameTextStyleTextStyle?Text style for division names
tooltipPaddingEdgeInsetsGeometry?Padding for the tooltip
tooltipMarginEdgeInsetsGeometry?Margin for the tooltip
dhakaColorColor?Color for Dhaka division
rangpurColorColor?Color for Rangpur division
rajshahiColorColor?Color for Rajshahi division
khulnaColorColor?Color for Khulna division
sylhetColorColor?Color for Sylhet division
barisalColorColor?Color for Barisal division
chittagongColorColor?Color for Chattogram division
mymensinghColorColor?Color for Mymensingh division
onTapRangpurVoidCallback?Callback function for tapping on Rangpur division
onTapRajshahiVoidCallback?Callback function for tapping on Rajshahi division
onTapMymensinghVoidCallback?Callback function for tapping on Mymensingh division
onTapSylhetVoidCallback?Callback function for tapping on Sylhet division
onTapKhulnaVoidCallback?Callback function for tapping on Khulna division
onTapDhakaVoidCallback?Callback function for tapping on Dhaka division
onTapBarishalVoidCallback?Callback function for tapping on Barishal division
onTapChattogramVoidCallback?Callback function for tapping on Chattogram division
rangpurTitleStringTitle for Rangpur division
rajshahiTitleStringTitle for Rajshahi division
mymensinghTitleStringTitle for Mymensingh division
sylhetTitleStringTitle for Sylhet division
khulnaTitleStringTitle for Khulna division
dhakaTitleStringTitle for Dhaka division
barishalTitleStringTitle for Barishal division
chattogramTitleStringTitle for Chattogram division
tooltipMsgRangpurString?Tooltip message for Rangpur division
tooltipMsgRajshahiString?Tooltip message for Rajshahi division
tooltipMymensinghString?Tooltip message for Mymensingh division
tooltipSylhetString?Tooltip message for Sylhet division
tooltipKhulnaString?Tooltip message for Khulna division
tooltipDhakaString?Tooltip message for Dhaka division
tooltipBarishalString?Tooltip message for Barishal division
tooltipChattogramString?Tooltip message for Chattogram division
tooltipRichMsgRangpurInlineSpan?Rich tooltip message for Rangpur division
tooltipRichMsgRajshahiInlineSpan?Rich tooltip message for Rajshahi division
tooltipRichMsgMymensinghInlineSpan?Rich tooltip message for Mymensingh division
tooltipRichMsgSylhetInlineSpan?Rich tooltip message for Sylhet division
tooltipRichMsgKhulnaInlineSpan?Rich tooltip message for Khulna division
tooltipRichMsgDhakaInlineSpan?Rich tooltip message for Dhaka division
tooltipRichMsgBarishalInlineSpan?Rich tooltip message for Barishal division
tooltipRichMsgChattogramInlineSpan?Rich tooltip message for Chattogram division

Feel free to refer to this table when using the 'Bangladesh' Flutter plugin to understand the available options and their respective types.

Contributions

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

The 'Bangladesh' Flutter plugin is released under the MIT License.