initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
81
joplin notion extension/Web Development/Flutter/Extras.md
Normal file
81
joplin notion extension/Web Development/Flutter/Extras.md
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
Extras
|
||||
|
||||
- adb
|
||||
- this `-k` flag means it will keep cache and app data so making it more safer
|
||||
- `adb shell`
|
||||
- `adb shell pm list packages` to list installed packages
|
||||
- adb uninstall <package_name> : to uninstall app
|
||||
- `adb shell pm uninstall -k --user 0 <application_name>` to safely install package and not uninstall system istead
|
||||
- `adb shell pm disable-user --user 0 com.miui.android.fashiongallery` to disable for user in case cant be deleted for user
|
||||
|
||||
- video players
|
||||
https://pub.dev/packages/video_player_media_kit/example
|
||||
[media_kit_ex.zip](../../../_resources/media_kit_ex.zip)
|
||||
- pip (Picture in picture)
|
||||
https://pub.dev/packages/flutter_in_app_pip
|
||||
https://pub.dev/packages/pip_view (more scores than upper one)
|
||||
- audio play background
|
||||
https://pub.dev/packages/just_audio_background
|
||||
- some design kits like material design
|
||||
[designs ui.txt](../../../_resources/designs%20ui.txt)
|
||||
- file system
|
||||
- https://docs.flutter.dev/cookbook/persistence/reading-writing-files
|
||||
- in android for accessing external storage need a permission handler to grant storage like this
|
||||
https://pub.dev/packages/permission_handler
|
||||
```dart
|
||||
Future<void> storagePermissions() async {
|
||||
// var status = await Permission.storage.request();
|
||||
var status = await Permission.storage.request();
|
||||
// Permission.storage.request();
|
||||
// var status = await Permission.camera.request();
|
||||
|
||||
if (status.isDenied) {
|
||||
print('storage permission denied');
|
||||
} else if (status.isGranted) {
|
||||
print('storage permission granted');
|
||||
}
|
||||
}
|
||||
```
|
||||
- also in `AndroidManifest.xml` , add following
|
||||
for below android 11
|
||||
```xml
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
```
|
||||
for above andoid 11
|
||||
```xml
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||
```
|
||||
- by default only photos and videos access is granted so for full grant add following in manifest
|
||||
`<application android:requestLegacyExternalStorage="true">`
|
||||
- forms
|
||||
https://docs.flutter.dev/cookbook/forms/text-input
|
||||
- fetch data from internet
|
||||
https://docs.flutter.dev/cookbook/networking/fetch-data
|
||||
- parsing html
|
||||
https://pub.dev/packages/html
|
||||
[parsing_with_new.dart](../../../_resources/parsing_with_new.dart)
|
||||
- toast in flutter
|
||||
https://docs.flutter.dev/cookbook/design/snackbars
|
||||
- dropdown menu
|
||||
https://api.flutter.dev/flutter/material/DropdownMenu-class.html
|
||||
- to add support for platforms use
|
||||
`flutter create --platforms=ios,android foo` foo here is path of directory containing pubspec.yml
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Snipppets
|
||||
- popupmenu
|
||||
https://betterprogramming.pub/popup-menu-customization-in-flutter-aa8827f6ce39
|
||||
[popupmenu.dart](../../../_resources/popupmenu.dart)
|
||||
- contextmenu and rendering popmenu anywhere on screen
|
||||
[rightclick_simulation.dart](../../../_resources/rightclick_simulation.dart)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in a new issue