Code Monkey home page Code Monkey logo

Comments (5)

merlinofcha0s avatar merlinofcha0s commented on June 13, 2024

Hi,

Sorry for the late answer.

Yes, you are supposed to launch yo jhipster-flutter-merlin in your generated jhipster project.

Normally you are supposed to use the java version linked with the Android SDK that you downloaded. I'm not sure that it will work with regular JDK but not 100% sure (see screen capture below).

image

For your last problem, You have either to use the generated launcher present in the run configuration (.idea) it's because all the libraries are not ready for null safety so you have to add --no-sound-null-safety with your flutter run : flutter run --no-sound-null-safety.

Sure, for the bug bounties, it will be awesome !

And yes it will work with JWT reactive or not.

Tell me if something wasn't clear enough.

from generator-jhipster-flutter.

mraible avatar mraible commented on June 13, 2024

I tried this again tonight with my jhipster7-demo app that uses JHipster v7.0.1 and JWT for auth.

When I run flutter run --no-sound-null-safety, I get the following error:

    ** BUILD FAILED **


Xcode's output:
↳
    lib/main.dart:4:8: Error: Error when reading 'lib/main.mapper.g.dart': No such file or directory
    import 'main.mapper.g.dart' show initializeJsonMapper;
           ^
    lib/main.dart:9:3: Error: Method not found: 'initializeJsonMapper'.
      initializeJsonMapper();
      ^^^^^^^^^^^^^^^^^^^^
    Failed to package /Users/mraible/dev/jhipster7-demo/flutter-app.

You can see the code for this in mraible/jhipster7-demo#7, or by cloning the repo/branch:

git clone -b flutter https://github.com/mraible/jhipster7-demo

from generator-jhipster-flutter.

Djamdev avatar Djamdev commented on June 13, 2024

I tried this again tonight with my jhipster7-demo app that uses JHipster v7.0.1 and JWT for auth.

When I run flutter run --no-sound-null-safety, I get the following error:

    ** BUILD FAILED **


Xcode's output:
↳
    lib/main.dart:4:8: Error: Error when reading 'lib/main.mapper.g.dart': No such file or directory
    import 'main.mapper.g.dart' show initializeJsonMapper;
           ^
    lib/main.dart:9:3: Error: Method not found: 'initializeJsonMapper'.
      initializeJsonMapper();
      ^^^^^^^^^^^^^^^^^^^^
    Failed to package /Users/mraible/dev/jhipster7-demo/flutter-app.

You can see the code for this in mraible/jhipster7-demo#7, or by cloning the repo/branch:

git clone -b flutter https://github.com/mraible/jhipster7-demo

You should run " flutter pub run build_runner build --delete-conflicting-outputs", this will update (or create if not exist) the file main.mapper.g.dart, that's because of dart_json_mapper_flutter lib. It is an issue of build runner that didn't display some errors! (in this case, dart version between your drat sdk and targeted by the generated code)

Also, notice that this jhipster module does not support JHipster 7, but with some workaround it will as I did for one of my projects based on JHipster 7, notice also the null safety issues with generated pubspec, here it mine after updating some libs:
`
environment:
sdk: ">=2.14.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.3
http: any
dart_json_mapper: ^2.1.16
dart_json_mapper_flutter: ^1.0.3
flutter_secure_storage: ^4.2.1
url_launcher: ^6.0.12
datetime_picker_formfield: ^2.0.0
introduction_screen: ^2.1.0

toggle_switch: ^1.2.0

cached_network_image: ^3.1.0

#BLoC pattern related
formz: ^0.4.1
equatable: ^2.0.0
flutter_bloc: ^7.3.1

google_maps_flutter: ^2.0.11
custom_info_window: ^1.0.1
clippy_flutter: ^2.0.0-nullsafety.1

qr_flutter: ^4.0.0
glob: ^2.0.2
reflectable: ^3.0.4
intl: ^0.17.0
search_choices: ^2.0.14
video_player: ^2.2.6
firebase_core: "^1.10.0"
firebase_messaging: "^11.1.0"
form_builder_phone_field: ^1.0.0-beta.0

barcode_widgets: ^2.0.0
flutter_svg:
maps_launcher: ^2.0.1
......
`
Hope this could help you

from generator-jhipster-flutter.

mraible avatar mraible commented on June 13, 2024

I tried updating my dependencies. See mraible/jhipster7-demo@c9f4bab for specific versions.

Now if I run:

flutter pub run build_runner build --delete-conflicting-outputs

It seems to succeed:

[INFO] Succeeded after 12.7s with 1 outputs (1 actions)

When I try flutter run, it seems to want to connect to Chrome. Is there something I need to do after running this command to see the app?

flutter run
Launching lib/main.dart on Chrome in debug mode...
lib/account/login/login_repository.dart:12:23: Error: A value of type 'JWTToken?' can't be returned from an async
function with return type 'Future<JWTToken>' because 'JWTToken?' is nullable and 'Future<JWTToken>' isn't.
 - 'JWTToken' is from 'package:Flickr/shared/models/jwt_token.dart' ('lib/shared/models/jwt_token.dart').
 - 'Future' is from 'dart:async'.
    return JsonMapper.deserialize<JWTToken>(authenticateRequest.body);
                      ^
lib/shared/repository/account_repository.dart:25:23: Error: A value of type 'User?' can't be returned from an async
function with return type 'Future<User>' because 'User?' is nullable and 'Future<User>' isn't.
 - 'User' is from 'package:Flickr/shared/models/user.dart' ('lib/shared/models/user.dart').
 - 'Future' is from 'dart:async'.
    return JsonMapper.deserialize<User>(saveRequest.body);
                      ^
Waiting for connection from debug service on Chrome...             17.6s
Failed to compile application.

from generator-jhipster-flutter.

mrtklein avatar mrtklein commented on June 13, 2024

I tried updating my dependencies. See mraible/jhipster7-demo@c9f4bab for specific versions.

Now if I run:

flutter pub run build_runner build --delete-conflicting-outputs

It seems to succeed:

[INFO] Succeeded after 12.7s with 1 outputs (1 actions)

When I try flutter run, it seems to want to connect to Chrome. Is there something I need to do after running this command to see the app?

flutter run
Launching lib/main.dart on Chrome in debug mode...
lib/account/login/login_repository.dart:12:23: Error: A value of type 'JWTToken?' can't be returned from an async
function with return type 'Future<JWTToken>' because 'JWTToken?' is nullable and 'Future<JWTToken>' isn't.
 - 'JWTToken' is from 'package:Flickr/shared/models/jwt_token.dart' ('lib/shared/models/jwt_token.dart').
 - 'Future' is from 'dart:async'.
    return JsonMapper.deserialize<JWTToken>(authenticateRequest.body);
                      ^
lib/shared/repository/account_repository.dart:25:23: Error: A value of type 'User?' can't be returned from an async
function with return type 'Future<User>' because 'User?' is nullable and 'Future<User>' isn't.
 - 'User' is from 'package:Flickr/shared/models/user.dart' ('lib/shared/models/user.dart').
 - 'Future' is from 'dart:async'.
    return JsonMapper.deserialize<User>(saveRequest.body);
                      ^
Waiting for connection from debug service on Chrome...             17.6s
Failed to compile application.

After solving the above error by catching null values, I get the following error:

════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by gesture ═══════════════════════════════════════════════════════════════
The following StateError was thrown while handling a gesture:
Bad state: add(TermsAndConditionsChanged) was called without a registered event handler.
Make sure to register a handler via on<TermsAndConditionsChanged>((event, emit) {...})

When the exception was thrown, this was the stack: 
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49  throw_
packages/bloc/src/bloc.dart 75:9                                                                                           <fn>
packages/bloc/src/bloc.dart 80:14                                                                                          add
packages/eyeCare/account/register/register_screen.dart 136:53                                                              <fn>
packages/flutter/src/material/toggleable.dart 229:9                                                                        [_handleTap]
packages/flutter/src/gestures/recognizer.dart 198:24                                                                       invokeCallback
packages/flutter/src/gestures/tap.dart 608:48                                                                              handleTapUp
packages/flutter/src/gestures/tap.dart 296:5                                                                               [_checkUp]
packages/flutter/src/gestures/tap.dart 230:7                                                                               handlePrimaryPointer
packages/flutter/src/gestures/recognizer.dart 563:9                                                                        handleEvent
packages/flutter/src/gestures/pointer_router.dart 94:12                                                                    [_dispatch]
packages/flutter/src/gestures/pointer_router.dart 139:9                                                                    <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:13      forEach
packages/flutter/src/gestures/pointer_router.dart 137:17                                                                   [_dispatchEventToRoutes]
packages/flutter/src/gestures/pointer_router.dart 123:7                                                                    route
packages/flutter/src/gestures/binding.dart 439:19                                                                          handleEvent
packages/flutter/src/gestures/binding.dart 419:14                                                                          dispatchEvent
packages/flutter/src/rendering/binding.dart 322:11                                                                         dispatchEvent
packages/flutter/src/gestures/binding.dart 374:7                                                                           [_handlePointerEventImmediately]
packages/flutter/src/gestures/binding.dart 338:5                                                                           handlePointerEvent
packages/flutter/src/gestures/binding.dart 296:7                                                                           [_flushPointerEventQueue]
packages/flutter/src/gestures/binding.dart 279:32                                                                          [_handlePointerDataPacket]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 1020:13           invoke1
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 184:5             invokeOnPointerDataPacket
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/pointer_binding.dart 130:39                [_onPointerData]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/pointer_binding.dart 558:18                <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/pointer_binding.dart 511:21                <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/pointer_binding.dart 217:16                loggedHandler
Handler: "onTap"
Recognizer: TapGestureRecognizer#6610a
  debugOwner: GestureDetector
  state: possible
  won arena
  finalPosition: Offset(32.0, 711.0)
  finalLocalPosition: Offset(17.0, 10.9)
  button: 1
  sent tap down

from generator-jhipster-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.