cedvdb / phone_form_field

Flutter phone number input
https://pub.dev/packages/phone_form_field
MIT License
73 stars 100 forks source link

CountrySelectorNavigator.page()- Customisation doesn't work #266

Closed googlina closed 3 weeks ago

googlina commented 3 weeks ago

I'm trying to customize AppBar and search box style but it doesn't work. Instead of showing default grey color. Below is the code to reproduce error.

PhoneFormField(
            autofocus: false,
            controller: controller,
            countryButtonStyle: const CountryButtonStyle(
                padding: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
                showDialCode: true,
                showIsoCode: false,
                showFlag: false),
            decoration: InputDecoration(
              labelText: labelText,
              hintText: hintText,
              hintStyle: secondaryTextStyle(size: 14),
              labelStyle: customLabelStyle,
              focusedBorder: customFocusedBorder,
              border: customBorder,
              enabledBorder: customEnabledBorder,
              errorBorder: customErrorBorder,
              contentPadding: customInputContentPadding,
              floatingLabelStyle: customFloatingLabelStyle,
              prefixIconColor: customInputPrefixIconColor,
            ),
            validator: PhoneValidator.compose([
              PhoneValidator.required(context),
              PhoneValidator.validMobile(context),
            ]),
            countrySelectorNavigator: CountrySelectorNavigator.page(
              searchBoxDecoration: const InputDecoration(
                hintText: 'Search country',
                suffixIcon: Icon(Icons.search),
              ),
              appBarTheme: ThemeData(
                appBarTheme: const AppBarTheme(
                  iconTheme: IconThemeData(color: Colors.black),
                  systemOverlayStyle: SystemUiOverlayStyle(
                    statusBarColor: Colors.amber,
                  ),
                  backgroundColor: Colors.amberAccent,
                ),
              ),
            ),
          );
cedvdb commented 3 weeks ago

The theme is now forwarded to the page in v 10.0.0, so you can wrap it with your own theme