Skip to content

RegionInfo Formatted result unexpected #48

@willylaurents

Description

@willylaurents

im have a code for autoformat like this:

Future<String> getFormattedPhoneNumber(String phoneNumber) async {
    final RegionInfo regionInfo = await PhoneNumberUtil.getRegionInfo(phoneNumber: phoneNumber, isoCode: 'id');
    return regionInfo.formattedPhoneNumber ?? phoneNumber;
}

when the phoneNumber is 0877123 the regionInfo result is [RegionInfo prefix=62, iso=ID, formatted=0877123]
when the phoneNumber is 08771234 the regionInfo result is [RegionInfo prefix=62, iso=ID, formatted=8771234]

in formatted property the 0 is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions