Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get_cli errors on the latest version of flutter #243

Open
maxwelladapoe opened this issue Jan 22, 2024 · 5 comments
Open

Get_cli errors on the latest version of flutter #243

maxwelladapoe opened this issue Jan 22, 2024 · 5 comments

Comments

@maxwelladapoe
Copy link

I am trying to run get_cli on the latest version of Flutter/dart however I seem to get the below error
image

below is my version of flutter
image

@BOFOII
Copy link

BOFOII commented Jan 24, 2024

I experienced the same problem, this happened because waitFor will be removed in the next dart, I added the --enable_deprecated_wait_for flag but it still couldn't solve the problem

@maxwelladapoe
Copy link
Author

Upon further investigation the issue has more to do with dcli than this package.
you will have to downgrade flutter and dart for now if you still need to use this package.
I believe once its fixed in dcli you should be able to use it again

@gktirkha
Copy link

I found a workaround as get init is not working, we only need to manually initialize the project, and we can still add pages.
hope the issue will get resolved, but till then

we can still use

// use this option for Getx_pattern
get create page:home

and

// use this option for CLEAN (by Arktekko)
get create screen:home 

add get dependency, create the home screen, then you can edit the main file based on your architecture

for Getx_pattern

import 'package:flutter/material.dart';

import 'package:get/get.dart';

import 'app/routes/app_pages.dart';

void main() {
  runApp(
    GetMaterialApp(
      initialRoute: AppPages.INITIAL,
      getPages: AppPages.routes,
    ),
  );
}

for CLEAN main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Hello World!'),
        ),
      ),
    );
  }
}

config.dart

class Environments {
  static const String PRODUCTION = 'prod';
  static const String QAS = 'QAS';
  static const String DEV = 'dev';
  static const String LOCAL = 'local';
}

class ConfigEnvironments {
  static const String _currentEnvironments = Environments.LOCAL;
  static final List<Map<String, String>> _availableEnvironments = [
    {
      'env': Environments.LOCAL,
      'url': 'http://localhost:8080/api/',
    },
    {
      'env': Environments.DEV,
      'url': '',
    },
    {
      'env': Environments.QAS,
      'url': '',
    },
    {
      'env': Environments.PRODUCTION,
      'url': '',
    },
  ];

  static Map<String, String> getEnvironments() {
    return _availableEnvironments.firstWhere(
      (d) => d['env'] == _currentEnvironments,
    );
  }
}

@knottx
Copy link
Contributor

knottx commented Mar 3, 2024

dart pub global deactivate get_cli

dart pub global activate -s git https://github.com/knottx/get_cli.git --git-ref knottx

@jaxnz
Copy link

jaxnz commented Mar 10, 2024

dart pub global deactivate get_cli

dart pub global activate -s git https://github.com/knottx/get_cli.git --git-ref knottx

Works perfectly - only dependancies required updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants