skip to Main Content

How can I change the color of "ElevatedButton" depend on something else changes in the program? – Flutter

I have a provider value like below: var book = Provider.of<Books>(context, listen: false); And an upload button like the following: ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: book['imageUrl'] == "" ? Theme.of(context).highlightColor : Theme.of(context).primaryColor, ), ), onPressed: () async { setState(() { book['imageUrl']…

VIEW QUESTION

Android Studio – How Can I Resolve Preview Display Issues in Android Studio After Upgrading to Electric Eel?

<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".fragments.MainFragment"> <com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="match_parent"> </com.google.android.material.card.MaterialCardView> </androidx.constraintlayout.widget.ConstraintLayout> Preview will looks like this: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".fragments.MainFragment"> </androidx.constraintlayout.widget.ConstraintLayout> Preview will looks like this: I upgraded Android Studio to Electric…

VIEW QUESTION

Android Studio – Can remove space between box and underline for android TextInputLayout

I want to create TextInputLayout without a gap between the underline and edge of the box can remove this gap? image here: <com.google.android.material.textfield.TextInputLayout android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/tilSearch" android:hint="@string/search_location" app:errorEnabled="false" app:errorTextColor="@color/red" app:helperTextEnabled="true"> <EditText android:id="@+id/edtSearch" android:layout_width="match_parent" android:layout_height="@dimen/_60dp" android:importantForAutofill="no" android:inputType="text" tools:ignore="LabelFor" /> </com.google.android.material.textfield.TextInputLayout>

VIEW QUESTION
Back To Top
Search