A plugin to provide common widgets that being used by multiple jobseeker products. Every contributions is one step to make other developer life easier.
- Add mobile_common_widgets under dependencies in your pubspec.yaml :
dependencies:
.
.
.
mobile_common_widgets:
git:
url: [email protected]:Jobseeker-company/mobile-common-widgets.git
ref: master
- Run
flutter pub get
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",
);
How to contribute to mobile common widgets :
- Choose your widget to be contributed. Make sure the widget is being used by multiple products with more than 90% similarity.
- Add your widget to the relevant folder. For example, JSDialog should be placed inside dialogs widget.
- Add your widget file to barrel file, named as
mobile_common_widgets.dart
. - 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.
- 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);
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
}