Skip to content

Generic Widgets

Padam Chopra edited this page Jun 27, 2020 · 1 revision

This wiki contains information about the generic widgets created for Opus to maintain a uniform design pattern throughout the app.

Format: this.propertyName: Type = Default value if any

CustomText

CustomText(
    this.text: String, {
    this.fontWeight: FontWeight = FontWeight.normal,
    this.textAlign: TextAlign = TextAlign.start,
    this.color: Color = MyColors.black,
    this.fontSize: double = 20,
    this.textDecoration: TextDecoration = TextDecoration.none,
    this.letterSpacing: double = 0,
    this.productSans: bool = false,
});

CustomField

CustomField({
    @required this.focusNode: FocusNode,
    @required this.hint: String,
    @required this.validator: Function,
    @required this.onSave: Function,
    this.nextFocusNode: FocusNode,
    this.inputType: TextInputType = TextInputType.text,
    this.icon: IconData,
    this.obscureText: bool,
});

CustomButton

CustomButton({
    @required this.label: String,
    @required this.onPress: Function,
    this.color: Color = MyColors.primary,
});

AlertDialog

UniversalFunctions.showAlert(
    BuildContext context, 
    String title, 
    String description
) => Future<void>

ConfirmationDialog

UniversalFunctions.showActionDialog({
    @required BuildContext context,
    @required String title,
    @required String description,
    @required Function positiveCallback,
    Function otherCallback,
    String positiveLabel: 'OK',
    String otherLabel,
    bool otherIsNegative: false,
    bool positiveIsNegative: false,
}) => Future<void>
Clone this wiki locally