joplin-notes/joplin notion extension/Web Development/Flutter/tips.md
2026-11-04 00:33:23 +05:30

30 lines
1.4 KiB
Markdown

tips
- for making column elements take whole space horizontally use this
`crossAxisAlignment: CrossAxisAlignment.stretch`
- in buttons to remove the splash and modify other aspects to it
```dart
TextButton(
style: TextButton.styleFrom(
splashFactory: NoSplash.splashFactory,
overlayColor: Colors.grey,
shape: BeveledRectangleBorder(),
),
)
```
- conditional inline widgets
[conditional widgets.txt](../../../_resources/conditional%20widgets.txt)
- in flutter if there is issue in version imcompability like this
```txt
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_android:androidJdkImage'.
```
then
1 .inside android/settings.gradle, change id "com.android.application" to version "8.7.1" apply false
image
2. in gradle-wraper.properties, change distributionUrl to https://services.gradle.org/distributions/gradle-8.9-all.zip
- passing callback from child to parent
use callback function as state of parent, pass the function which can change callback by taking to parameter to child and in child widget update the callback function of parent state.
eg: `VoidCallback? takeScreenShot;`
- sorting files with date modified
https://stackoverflow.com/questions/70225891/how-to-sort-list-of-file-in-order-of-latest-to-oldest