overseas
overseas

Reputation: 45

Flutter debug vs. release difference in interface

I am having issues while launching my Flutter application in the same physical device in debug and release mode. You can clearly see the difference in terms of interface (the uglier one is, of course, release mode). When I launch it on a different emulator device (Pixel) in both debug and release mode, it works fine.

build.gradle:

buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled false
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

proguard-rules.pro:

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
-dontwarn com.google.errorprone.annotations.CheckReturnValue
-dontwarn com.google.errorprone.annotations.Immutable
-dontwarn com.google.errorprone.annotations.RestrictedApi
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.concurrent.GuardedBy
-keep class io.flutter.** { *; }
-keep class io.flutter.embedding.android.** { *; }
-keepattributes *Annotation*
-keepresources *.png
-keepresources *.ttf

enter image description here

enter image description here

Example of code for the drop down "Uzmanlik Alani":

                          Expanded(
                        flex: 3,
                        child: SizedBox(
                          height: 25.h,
                          child: DropdownButtonHideUnderline(
                            child: DropdownButton2<String>(
                              hint: Text(
                                'Uzmanlık Alanı',
                                style: Theme.of(context)
                                    .textTheme
                                    .displaySmall
                                    ?.copyWith(
                                        color: AppColors.inactiveGrey),
                                overflow: TextOverflow.ellipsis,
                              ),
                              items: convertSpecializationAreas.keys
                                  .toList()
                                  .sublist(0, 5)
                                  .map<DropdownMenuItem<String>>(
                                      (String value) {
                                return DropdownMenuItem<String>(
                                  value: value,
                                  child: Text(
                                    value,
                                    style: Theme.of(context)
                                        .textTheme
                                        .displaySmall,
                                    overflow: TextOverflow.ellipsis,
                                    maxLines: 2,
                                  ),
                                );
                              }).toList(),
                              value: convertSpecializationAreas[
                                  _selectedSpecializationArea],
                              onChanged: (String? newSpecializationArea) {
                                if (newSpecializationArea != null &&
                                    _selectedSpecializationArea !=
                                        convertSpecializationAreas[
                                            newSpecializationArea]) {
                                  setState(() {
                                    _selectedSpecializationArea =
                                        convertSpecializationAreas[
                                            newSpecializationArea];
                                  });
                                }
                              },
                              buttonStyleData: ButtonStyleData(
                                height: 27.h,
                                width: double.infinity,
                                padding: EdgeInsets.symmetric(
                                  horizontal: AppSpacing.horizontalSpace,
                                  vertical: AppSpacing.verticalSpace,
                                ),
                                decoration: BoxDecoration(
                                  borderRadius: AppStyles.borderRadius,
                                  border: Border.all(
                                      color: AppColors.inactiveGrey),
                                ),
                              ),
                              isDense: true,
                              isExpanded: true,
                              iconStyleData: IconStyleData(
                                icon: Icon(
                                  size: 9.h,
                                  Icons.arrow_drop_down,
                                ),
                              ),
                              dropdownStyleData: DropdownStyleData(
                                maxHeight: 100.h,
                              ),
                            ),
                          ),
                        ),
                      ),

I can provide you with any file you might need. Thank you in advance!

Upvotes: 0

Views: 30

Answers (0)

Related Questions