vanlooverenkoen / db_viewer

A Flutter package that allows you to view/ filter/ search your moor database in-app
43 stars 18 forks source link

Material `TextTheme` related parameters are failing on Flutter v3.22 and above. #57

Closed RoarGronmo closed 7 months ago

RoarGronmo commented 7 months ago

Example of compile time fail:

/C:/Users/RoarGronmo/AppData/Local/Pub/Cache/hosted/pub.dev/db_viewer-1.0.3/lib/src/widget/general/styled/input_like_text_field.dart:40:40: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
[        ]  - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/c:/Flutter/flutter/packages/flutter/lib/src/material/text_theme.dart').
[        ] Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
[        ]                 style: theme.textTheme.bodyText1 ??
[        ]                                        ^^^^^^^^^

The error seems to be connected to a v1.0.3 module part of the library...

Examples of elemets that fail are: bodyText1 headline6 subtitle1 button

flutter doctor -v: (main channel)

PS C:\FlutterProjects\mPortal> flutter doctor -v      
[√] Flutter (Channel main, 3.22.0-5.0.pre.32, on Microsoft Windows [Version 10.0.22631.3296], locale nb-NO)
    • Flutter version 3.22.0-5.0.pre.32 on channel main at c:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bd7252137f (2 hours ago), 2024-04-05 05:02:25 -0400
    • Engine revision 23a1d0d2fc
    • Dart version 3.5.0 (build 3.5.0-18.0.dev)
    • DevTools version 2.34.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\RoarGronmo\AppData\Local\Android\sdk
    • Platform android-VanillaIceCream, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android Studio\Android Studio 2024.1.1.1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.2.1.24
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.1.1.22
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[√] Connected device (4 available)
    • SM T515 (mobile)  • R52NB09L7ZP • android-arm    • Android 11 (API 30)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.3296]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 123.0.6312.106
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 123.0.2420.65

[√] Network resources
    • All expected network resources are available.

• No issues found!
PS C:\FlutterProjects\mPortal>

Flutter doctor for beta channel:

PS C:\FlutterProjects\mPortal> flutter doctor -v      
[√] Flutter (Channel beta, 3.22.0-0.1.pre, on Microsoft Windows [Version 10.0.22631.3296], locale nb-NO)
    • Flutter version 3.22.0-0.1.pre on channel beta at c:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 29babcb32a (2 days ago), 2024-04-03 17:17:04 -0500
    • Engine revision 97550907b7
    • Dart version 3.4.0 (build 3.4.0-282.1.beta)
    • DevTools version 2.34.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\RoarGronmo\AppData\Local\Android\sdk
    • Platform android-VanillaIceCream, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android Studio\Android Studio 2024.1.1.1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.2.1.24
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.1.1.22
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] Android Studio (version 2023.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.3.1.15
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2024.1.1.1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[√] Connected device (4 available)
    • SM T515 (mobile)  • R52NB09L7ZP • android-arm    • Android 11 (API 30)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.3296]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 123.0.6312.106
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 123.0.2420.65

[√] Network resources
    • All expected network resources are available.

• No issues found!
PS C:\FlutterProjects\mPortal> 

Flutter doctor for stable channel:

PS C:\FlutterProjects\mPortal> flutter doctor -v      
[√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.22631.3296], locale nb-NO)
    • Flutter version 3.19.5 on channel stable at c:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (8 days ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\RoarGronmo\AppData\Local\Android\sdk
    • Platform android-VanillaIceCream, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android Studio\Android Studio 2024.1.1.1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.2.1.24
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.1.1.22
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] Android Studio (version 2023.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.3.1.15
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2024.1.1.1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[√] Connected device (4 available)
    • SM T515 (mobile)  • R52NB09L7ZP • android-arm    • Android 11 (API 30)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.3296]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 123.0.6312.106
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 123.0.2420.65

[√] Network resources
    • All expected network resources are available.

• No issues found!
PS C:\FlutterProjects\mPortal> 

Pubspec.yaml (when using Flutter 3.22 (beta))

name: m_portal
description: "Norva24 Customer Portal v2"
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.3.0+11

environment:
  sdk: '>=3.3.0 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

  #---flag
  flag: ^7.0.0

  #---email_validator
  email_validator: ^2.1.17

  #drift
  drift: ^2.13.2
  sqlite3_flutter_libs: ^0.5.0
  path_provider: ^2.0.0
  path: ^1.8.3

  #drift_db_viewer
  drift_db_viewer: ^2.0.0

  #swagger_dart_code_generator
  swagger_dart_code_generator: ^2.13.1
  chopper: ^7.0.9
  json_annotation: ^4.8.0

  #---jwt_decoder
  jwt_decoder: ^2.0.1
  google_maps_flutter: ^2.5.3
  flutter_resizable_container: ^0.4.0
  horizontal_data_table: ^4.3.1

  #---http:
  http: ^1.2.0

  #---collection:
  collection: ^1.18.0

  #---pdf:
  #pdf: ^3.10.7

  #---pdfx:
  pdfx: ^2.6.0

  #---intl:
  intl: ^0.19.0

  #---flutter_charts:
  flutter_charts: ^0.5.2
  week_number: ^1.1.0

  #---data_table_2:
  data_table_2: ^2.5.11

  #---package_info_plus:
  package_info_plus: ^6.0.0

  #---mock_data
  mock_data: ^2.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter

  #drift
  drift_dev: ^2.13.0

  #swagger_dart_code_generator
  build_runner: ^2.4.6
  chopper_generator: ^7.0.6
  json_serializable: ^6.6.1

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^3.0.1

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

compile fails for Flutter 3.22 and above, most likely because of changes in Material related elements.

vanlooverenkoen commented 7 months ago

Thanks @RoarGronmo for the very detailed bug report!!

vanlooverenkoen commented 7 months ago

Fixed in 1.1.0 for db_viewer and 2.1.0 for drift_db_viewer