Browse Source

Merge pull request 'config/android' (#23) from config/android into develop

Reviewed-on: https://git.nwhco.ir/amirreza.chegini/hade_hoda_flutter/pulls/23
pull/25/head
amirreza.chegini 3 weeks ago
parent
commit
aadce7e9fa
  1. 2
      android/app/src/main/AndroidManifest.xml
  2. 6
      android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  3. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  4. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png
  5. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  6. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png
  7. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  8. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png
  9. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  10. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png
  11. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  12. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png
  13. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  14. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png
  15. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  16. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
  17. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  18. BIN
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png
  19. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  20. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
  21. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  22. BIN
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png
  23. 25
      lib/core/utils/my_device.dart
  24. 2
      lib/main.dart
  25. 2
      pubspec.yaml

2
android/app/src/main/AndroidManifest.xml

@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="hadi_hoda_flutter"
android:label="Hadi &amp; Hoda"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity

6
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png

Before

Width: 72  |  Height: 72  |  Size: 544 B

After

Width: 72  |  Height: 72  |  Size: 4.3 KiB

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png

After

Width: 162  |  Height: 162  |  Size: 932 B

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png

After

Width: 162  |  Height: 162  |  Size: 11 KiB

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png

After

Width: 162  |  Height: 162  |  Size: 11 KiB

BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png

Before

Width: 48  |  Height: 48  |  Size: 442 B

After

Width: 48  |  Height: 48  |  Size: 2.3 KiB

BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png

After

Width: 108  |  Height: 108  |  Size: 539 B

BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png

After

Width: 108  |  Height: 108  |  Size: 6.0 KiB

BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png

After

Width: 108  |  Height: 108  |  Size: 6.0 KiB

BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png

Before

Width: 96  |  Height: 96  |  Size: 721 B

After

Width: 96  |  Height: 96  |  Size: 6.7 KiB

BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png

After

Width: 216  |  Height: 216  |  Size: 1.4 KiB

BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png

After

Width: 216  |  Height: 216  |  Size: 18 KiB

BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png

After

Width: 216  |  Height: 216  |  Size: 18 KiB

BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png

Before

Width: 144  |  Height: 144  |  Size: 1.0 KiB

After

Width: 144  |  Height: 144  |  Size: 13 KiB

BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png

After

Width: 324  |  Height: 324  |  Size: 2.6 KiB

BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png

After

Width: 324  |  Height: 324  |  Size: 37 KiB

BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png

After

Width: 324  |  Height: 324  |  Size: 37 KiB

BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png

Before

Width: 192  |  Height: 192  |  Size: 1.4 KiB

After

Width: 192  |  Height: 192  |  Size: 20 KiB

BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png

After

Width: 432  |  Height: 432  |  Size: 4.2 KiB

BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png

After

Width: 432  |  Height: 432  |  Size: 60 KiB

BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png

After

Width: 432  |  Height: 432  |  Size: 60 KiB

25
lib/core/utils/my_device.dart

@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class MyDevice {
static const MyDevice _i = MyDevice._internal();
@ -58,4 +59,28 @@ class MyDevice {
static bool isWeb() {
return kIsWeb;
}
/// Set Device based on Orientation
static Future<void> setPortrait() async {
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
}
static Future<void> setLandscape() async {
await SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}
static Future<void> setAllOrientations() async {
await SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
}
}

2
lib/main.dart

@ -4,6 +4,7 @@ import 'package:hadi_hoda_flutter/common_ui/theme/my_theme.dart';
import 'package:hadi_hoda_flutter/common_ui/theme/theme_service.dart';
import 'package:hadi_hoda_flutter/core/routers/my_routes.dart';
import 'package:hadi_hoda_flutter/core/utils/local_storage.dart';
import 'package:hadi_hoda_flutter/core/utils/my_device.dart';
import 'package:hadi_hoda_flutter/core/utils/storage_path.dart';
import 'package:hadi_hoda_flutter/init_bindings.dart';
import 'package:hadi_hoda_flutter/l10n/app_localizations.dart';
@ -15,6 +16,7 @@ Future<void> main() async {
LocalStorage.init(),
StoragePath.getDocumentDir(),
initDataBase(),
MyDevice.setPortrait(),
]);
runApp(const MainApp());
}

2
pubspec.yaml

@ -1,7 +1,7 @@
name: hadi_hoda_flutter
description: "A new Flutter project."
publish_to: 'none'
version: 0.1.0
version: 1.0.0+1
environment:
sdk: ^3.9.2

Loading…
Cancel
Save