alvinwatner / mobile-common-widgets

Common widgets for .app & .partners & .life

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mobile Common Widgets

A plugin to provide common widgets that being used by multiple jobseeker products. Every contributions is one step to make other developer life easier.

Installation

  1. Add mobile_common_widgets under dependencies in your pubspec.yaml :
dependencies:
  .
  .
  .
  mobile_common_widgets: 
    git:
      url: git@github.com:Jobseeker-company/mobile-common-widgets.git
      ref: master
  1. Run flutter pub get

Usage

import 'package:mobile_common_widgets/mobile_common_widgets.dart';

// show info dialog
CustomButton(
  onPressed: () {
    JSInfoDialog(
      context,
      content: const Icon(
        Icons.warning,
        size: 100,
        color: Colors.red,
      ),
      bodyText: "Hey this is an info dialog example",
      buttonText: "Close",
      buttonColor: Colors.red,
    ).show();
  },
  text: "Info Dialog",
);

// show general bottom sheet
CustomButton(
  onPressed: () {
    JSGeneralBottomSheet(
      context,
      content: const Icon(
        Icons.warning,
        size: 100,
        color: Colors.red,
      ),
      bodyText: "Hey this is a general bottom sheet example",
      buttonText: "Ok",
      buttonColor: Colors.red,
    ).show();
  },
  text: "Info Dialog",
);

Contribute

How to contribute to mobile common widgets :

  1. Choose your widget to be contributed. Make sure the widget is being used by multiple products with more than 90% similarity.
  2. Add your widget to the relevant folder. For example, JSDialog should be placed inside dialogs widget.
  3. Add your widget file to barrel file, named as mobile_common_widgets.dart.
  4. Add the usage to the example folder. Similar to [2], the widget should be placed to the relevant page that accessed from the list of buttons in home page.
  5. Add a screenshot of your widget to the readme, in this section and at top of the widget constructor (see bewlow example). How to host image to url using github?
  /// ![](url to your awesome widget)
  const YourAwesomeWidget(
    BuildContext context, {
  }) : super(context);

List of common widgets

Dialog

JSInfoDialog

JSConfirmDialog

Modal Bottom Sheet

JSBareBottomSheet

JSGeneralBottomSheet

DefaultBottomSheetItem

JSSignInBottomSheet

JSSavedAccountBottomSheet

Others

LocationPage

arguments:
* locale : string (en/id)
* product : enum (Product)
* onSubmitted : ValueChanged<Map<String?, dynamic>>
  {
  province_name: string,
  province_oid: string,
  city_name: string,
  city_oid: string
  }

About

Common widgets for .app & .partners & .life

License:Other


Languages

Language:Dart 100.0%