0

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!

asked Jan 11, 2025 at 16:44
11
  • i downloaded both images, opened them in gimp, made a decent zoom and i cannot see any differences on them Commented Jan 11, 2025 at 16:56
  • @pskink thank you. No need to make a zoom I guess, the borders are not rounded in both images, for example, the spacing isn't there in release mode, the spacing in text fields is also different. Commented Jan 11, 2025 at 17:12
  • ok now i noticed the corners, what code is used for them? Commented Jan 11, 2025 at 17:16
  • I have just added a code sample. The main thing I don't understand is the difference between debug & main for the physical device and the emulator. On emulator, everything seems OK - basically, no difference between two versions. Commented Jan 11, 2025 at 17:26
  • 1
    looks like AppStyles.borderRadius is equal to BorderRadius.zero - use some kind of logging in realase mode and log AppStyles.borderRadius to be sure (if you dont know how to do that you can add some extra Text widget in your ui and pass that AppStyles.borderRadius as a String - Text('radius: ${AppStyles.borderRadius}')) Commented Jan 11, 2025 at 17:47

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.