Unity Positive hexagonal grid drawing (streamlined version)-code can be reused directly

2023-02-28   ES  

Flutter version: 2.0.5
Write it when you have time, fill in the pit slowly


Some functions can improve development efficiency, it is recommended to see

Android Studio
vs code

flutter clean # 5 5 5 5 5 5 cache
flutter pub get # 6 6 dependencies

Migration Guide
To ensure that the library you use also supports air safety

# automatic upgrade
dart migrate --apply-changes

In the environment of the web browser, you cannot use Platform to determine whether to determine whether it is Kisweb for the web

import 'dart:io';

import 'package:flutter/foundation.dart';

class DeviceType {
  static bool isWeb = kIsWeb;

  static bool isIOS = !isWeb && Platform.isIOS;
  static bool isAndroid = !isWeb && Platform.isAndroid;
  static bool isMacOS = !isWeb && Platform.isMacOS;
  static bool isLinux = !isWeb && Platform.isLinux;
  static bool isWindows = !isWeb && Platform.isWindows;

  static bool get isDesktop => isWindows || isMacOS || isLinux;

  static bool get isMobile => isAndroid || isIOS;

  static bool get isDesktopOrWeb => isDesktop || isWeb;

  static bool get isMobileOrWeb => isMobile || isWeb;

# Different APKs for ARM and ARM64 to reduce the size of the APK
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
# Installation
adb install .\build\app\outputs\flutter-apk\app-arm64-v8a-release.apk

1 When writing native code, you must first run in Android Studio, let Cocoapods generate project files, and then open it with Xcode, otherwise you cannot see the native Plugin file in the directory.

flutter config --enable-web
## Create a web template in the root directory of the existing project
flutter create .

flutter run -d chrome

web packaging can choose two rendering modes, the PC side corresponds to Canvaskit, and the mobile terminal corresponds to HTML

# Generate files in BUILD/Web
# mobile terminal optimization
flutter build web --web-renderer html
# PC -end optimization
flutter build web --web-renderer canvaskit

Need Python environment support

python -m http.server 80 --directory .\build\web\

flutter config --enable-windows-desktop
## Create Windows template in the root directory of existing projects
flutter create .

flutter run -d windows

# generate files in Build/Windows/Runner/Release
flutter build windows

Packing into a installation program tool MSIX


Related Posts

ESP8266 WIFI module learning road (5) -Android mobile phone debugging assistant communicates with single -chip microcomputers

PTA 11-Application and login of Shalement 3 QQ account (detailed explanation)

Oracle Clob field Insertation The character is too long

Deep Learning Deeplearning Recommended Paper List List of Princess Scholars Recommended Learning route scoField

Unity Positive hexagonal grid drawing (streamlined version)-code can be reused directly

Random Posts

[Establishing Oracle 19C on Oracle Linux 7 -Single instance database based on ASM storage]

java implements the Virginia Canada algorithm, and the accurate key can be calculated in explicitly

Simulation signal Discuss in-depth transmission distance of 4-20mA current signal

How to download with JS for file download

Swagger environment (Swagger-Editor | Swagger-UI) Swagger-Editor | Swagger-UI)