jonataslaw / get_cli

Official Getx CLI
Apache License 2.0
590 stars 171 forks source link

✖ + error_unexpected Could not format because the source could not be parsed: line 81, column 5 of .: Expected to find ','. #194

Open heshesh2010 opened 2 years ago

heshesh2010 commented 2 years ago

Hi , I'm using latest verison get_cli: ^1.8.1 when in terminal and type : get create page:school_details I got the following error :

File: school_details_controller.dart created successfully at path: lib/app/modules/school_details/controllers/school_details_controller.dart
✓  File: school_details_view.dart created successfully at path: lib/app/modules/school_details/views/school_details_view.dart
✓  File: school_details_binding.dart created successfully at path: lib/app/modules/school_details/bindings/school_details_binding.dart

The lib/app/routes/app_pages.dart is not a valid dart file

✖  + error_unexpected Could not format because the source could not be parsed:

line 81, column 5 of .: Expected to find ','.
   ╷
81 │     GetPage(
   │     ^^^^^^^
   ╵`

AppPages.dart

`class AppPages {
  AppPages._();
  static final routes = [
    GetPage(
        name: _Paths.splashScreen,
        page: () => const SplashView(),
        binding: SplashBinding()),
    GetPage(
        name: _Paths.sginUp,
        page: () => SignUpView(),
        binding: SignUpBinding()),
    GetPage(name: _Paths.home, page: () => HomeView(), binding: HomeBinding()),
    GetPage(name: _Paths.login, page: () => AuthView(), binding: AuthBinding()),
    GetPage(
        name: _Paths.contactUs,
        page: () => ContactUsView(),
        binding: ContactUsBinding()),
    GetPage(
        name: _Paths.editProfile,
        page: () => EditProfileView(),
        binding: EditProfileBinding()),
    GetPage(
        name: _Paths.languages,
        page: () => LanguageView(),
        binding: LanguageBinding()),
    GetPage(
        name: _Paths.notifications,
        page: () => const NotificationsView(),
        binding: NotificationsBinding()),
    GetPage(
        name: _Paths.favorite,
        page: () => const FavoriteView(),
        binding: FavoriteBinding()),
    GetPage(
        name: _Paths.orders,
        page: () => const OrdersView(),
        binding: OrdersBinding()),
    GetPage(
        name: _Paths.offers,
        page: () => const OffersView(),
        binding: OffersBinding()),
    GetPage(
        name: _Paths.sons,
        page: () => const SonsView(),
        binding: SonsBinding()),
    GetPage(
        name: _Paths.addSon, page: () => AddSonView(), binding: SonsBinding()),
    GetPage(
        name: _Paths.editSon, page: () => EditSonView(), binding: SonsBinding())
  ];
}`
possible3656 commented 6 months ago

just add , at the last item of index like this

GetPage( name: _Paths.editSon, page: () => EditSonView(), binding: SonsBinding()) , // notice the comma here ]; }`

I don't know why this solve the issue but anyhow it does