Home > other >  Getting to know the using of Git with Flutter
Getting to know the using of Git with Flutter

Time:01-22

I'm a beginner in Flutter, and I don't know if it is right to clone a project in Android Studio that has been from 2 years ago, I got an error involving the difference of the Flutter versions that opens the cloned project and the framework in my device, I know how to use git and how to use the widgets and the APIs of Flutter, but my problem is with projects cloning from GitHub. My other concern is, how to reuse a specific UI from another project in GitHub for my project so I save time. And finally, I don’t know if a confliction happens when I clone a project from an old version of Flutter, and is it okay to combine codes from GitHub to my project to save time and trouble.

I cloned a project and got an error concerning the version of the cloned project, but the framework and the IDE in my device are fine, and the app worked on the emulator but I have a little concern.

CodePudding user response:

It is generally okay to clone projects from GitHub, even if they are from a few years ago, as long as you are aware that the code may be outdated and may not work with the latest version of Flutter or other dependencies. One way to address this is to check the dependencies listed in the cloned project's pubspec.yaml file, and update them as necessary to match the versions you have installed on your device.

It is also possible to reuse specific UI elements from other projects in GitHub by copying and pasting the relevant code into your own project. However, it is important to be aware of any potential conflicts that may arise from combining code from different sources, and to make sure that you are only using code that is appropriate for your project and that you have the necessary permissions to use.

In general, it is a good idea to be familiar with Git, and to use it to manage your code and keep track of any changes you make. This will allow you to easily go back to previous versions of your code if you encounter any issues.

CodePudding user response:

  • of course you can clone projects from GitHub even if they were outdated, the problem is flutter is regulary updated and sometimes you'd find a remarkable changes in the previous versions, so if you can find a newer one with the same topic it's always safer and better. also, if you're new to flutter I wouldn't recommend using the exact same code for the ui widgets, unless you're 100% that you're able to do them in your own first, otherwise you'll find a big difficulties when you create your own widgets after that.
  • Related