Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alphabet sidebar while scrolling #5

Closed
flikkr opened this issue Jun 13, 2020 · 2 comments
Closed

Update alphabet sidebar while scrolling #5

flikkr opened this issue Jun 13, 2020 · 2 comments

Comments

@flikkr
Copy link

flikkr commented Jun 13, 2020

I noticed when using the country picker, the sidebar containing the alphabet letter of the countries does not update with what is displayed on screen. It would be nice if the sidebar updates with the current country's letter that is on screen as the user scrolls through the list.

@jpainam
Copy link
Contributor

jpainam commented Sep 24, 2020

Nice library, need to update the alphabet sidebar while scrolling.

@jpainam
Copy link
Contributor

jpainam commented Sep 27, 2020

@flikkr Hi, I made a pull request to solve this problem, and added a lot of customization
Here a case use of my repo, you can check

CountryListPick(
    appBar: AppBar(
          // create your own appBar, default appBar(blue, centerTitle)
       ),
        pickerBuilder: (context, CountryCode countryCode) {
              // create your own picker, the default is countryflag, country name, keyboard_arrow_down
              return Row(
                children: [
                  Image.asset(
                    countryCode.flagUri,
                    package: 'country_list_pick', // do not forget this 
                  ),
                  Text(countryCode.code),
                  Text(countryCode.dialCode),
                ],
              );
            },
            theme: CountryTheme(
              // create your own theme customization, check CountryTheme class for more details
              isShowFlag: true,
              isShowTitle: true,
              isShowCode: true,
              isDownIcon: true,
              showEnglishName: true,
            ),
            initialSelection: '+62',
            onChanged: (CountryCode code) {
              print(code.name);
              print(code.code);
              print(code.dialCode);
              print(code.flagUri);
            },         
     ),

Hope to help,
You can use this by adding this line in your pubspec.yaml

country_list_pick:
    git: https://github.com/jpainam/country-list-pick.git

@hifiaz hifiaz closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants