【Flutter】 エラー対応

#エラー内容


下記記事によると、SDKはアップグレードされましたが、package：ffiパッケージの更新が
まだの為、起こるエラーとの事、多分、時間が経てば解決する内容と思われます。


https://stackoverflow.com/questions/65912637/how-can-i-fix-this-error-struct-utf8-is-empty-support-for-empty-structs-is-d/65922099



```
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:1111:7: Info: Struct 'ENUMLOGFONTEX' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class ENUMLOGFONTEX extends Struct {
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2835:7: Info: Struct 'BLUETOOTH_PIN_INFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class BLUETOOTH_PIN_INFO extends Struct {
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2960:7: Info: Struct 'EXCEPINFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class EXCEPINFO extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2966:7: Info: Struct 'PROPERTYKEY' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class PROPERTYKEY extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2973:7: Info: Struct 'PROPVARIANT' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class PROPVARIANT extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2978:7: Info: Struct 'SAFEARRAY' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class SAFEARRAY extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2985:7: Info: Struct 'CLSID' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class CLSID extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2992:7: Info: Struct 'STATSTG' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class STATSTG extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2999:7: Info: Struct 'NLM_SIMULATED_PROFILE_INFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class NLM_SIMULATED_PROFILE_INFO extends Struct {}
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:23:7: Info: Struct 'Utf8' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class Utf8 extends Struct {
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:16:7: Info: Struct 'Utf16' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class Utf16 extends Struct {
      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Info: Support for using non-constant type arguments 'T' in this FFI API is deprecated and will be removed in the next stable version of Dart. Rewrite the code to ensure that type arguments are compile time constants referring to a valid native type.
  final int totalSize = count * sizeOf<T>();
                                ^
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:9: 警告: [deprecation] android.osのAsyncTaskは非推奨になりました
import android.os.AsyncTask;
                 ^
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:121: 警告: [deprecation] android.osのAsyncTaskは非推奨になりました
    new AsyncTask<Void, Void, Boolean>() {
        ^
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:121: 警告: [deprecation] AsyncTaskのAsyncTask()は非推奨になりました
    new AsyncTask<Void, Void, Boolean>() {
    ^
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:123: 警告: [deprecation] AsyncTaskのdoInBackground(Params...)は非推奨になりました
      protected Boolean doInBackground(Void... voids) {
                        ^
  Params,Resultが型変数の場合:
    クラス AsyncTaskで宣言されているParamsはObjectを拡張します
    クラス AsyncTaskで宣言されているResultはObjectを拡張します
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:121: 警告: [deprecation] AsyncTaskのAsyncTask()は非推奨になりました
    new AsyncTask<Void, Void, Boolean>() {
                                         ^
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:128: 警告: [deprecation] AsyncTaskのonPostExecute(Result)は非推奨になりました
      protected void onPostExecute(Boolean value) {
                     ^
  Resultが型変数の場合:
    クラス AsyncTaskで宣言されているResultはObjectを拡張します
/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java:131: 警告: [deprecation] AsyncTaskのexecute(Params...)は非推奨になりました
    }.execute();
     ^
  Params,Progress,Resultが型変数の場合:
    クラス AsyncTaskで宣言されているParamsはObjectを拡張します
    クラス AsyncTaskで宣言されているProgressはObjectを拡張します
    クラス AsyncTaskで宣言されているResultはObjectを拡張します
警告7個
```

#解決方法
気になる方は、flutter sdk をダウングレードしてください。
master版では同一のエラーが出るのでstable指定でダウンロードしてください。

```php:flutter/terminal
flutter channel stable
flutter downgrade
flutter clean
```
現行の場合、↓のver1.22.3になっているかと思います。

```
flutter sdk ver1.22.3
```

ただ、私の場合、sdk ver1.22.3の場合、使っているCupertino_icons の1.0.2以降は
使えない為、そちらのバージョン変更も必要でした。

```php:pubspecyaml
 cupertino_icons: ^1.0.2   //ここを^1.0.0へ変更して　pubget
```

面倒な方はエラーが出ていても動作は出来ると思うので、
エラー解決されたバージョンが出るのを待つものありだと思います。