Skip to content

Commit 8664a8f

Browse files
authored
Merge pull request #536 from AffanShaikhsurab/patch-6
Add instructions to run API Dash-generated code in Dart (dio)
2 parents 8167db5 + 9d83fe6 commit 8664a8f

File tree

1 file changed

+68
-2
lines changed

1 file changed

+68
-2
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,77 @@ TODO
5151

5252
## Dart (http)
5353

54-
TODO
54+
Here are the detailed instructions for running the generated API Dash code in **Dart (using `http`)** for macOS, Windows, and Linux:
55+
56+
### **1. Install Dart**
57+
58+
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step installation instructions for macOS, Windows, and Linux.
59+
60+
### **2. Add the `http` Package**
61+
62+
- Add the `http` package as a dependency under the `dependencies` section of the `pubspec.yaml` file:
63+
```yaml
64+
dependencies:
65+
http: ^1.2.2
66+
```
67+
- Run the following command to fetch the dependency:
68+
```bash
69+
dart pub get
70+
```
71+
72+
### **3. Run the Generated Code**
73+
74+
#### **Using a Text Editor or IDE (e.g., Visual Studio Code):**
75+
1. Open a text editor or an IDE like Visual Studio Code.
76+
2. Create a new Dart file, such as `api_test.dart`.
77+
3. Copy the generated code from API Dash and paste it into this file.
78+
4. Save the file.
79+
5. Run the Dart file using the terminal or the IDE's built-in tools.
80+
81+
#### **Using the Command Line:**
82+
1. Save the generated code to a Dart file, e.g., `api_test.dart`.
83+
2. Open a terminal and navigate to the directory containing the file.
84+
3. Run the Dart file with the following command:
85+
```bash
86+
dart run api_test.dart
87+
```
5588

5689
## Dart (dio)
5790

58-
TODO
91+
Here are the detailed instructions for running the generated API Dash code in **Dart (using `dio`)** for macOS, Windows, and Linux:
92+
93+
### **1. Install Dart**
94+
95+
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step installation instructions for macOS, Windows, and Linux.
96+
97+
### **2. Add the `dio` Package**
98+
99+
- Add the `dio` package as a dependency under the `dependencies` section of the `pubspec.yaml` file:
100+
```yaml
101+
dependencies:
102+
dio: ^5.7.0
103+
```
104+
- Run the following command to fetch the dependency:
105+
```bash
106+
dart pub get
107+
```
108+
109+
### **3. Run the Generated Code**
110+
111+
#### **Using a Text Editor or IDE (e.g., Visual Studio Code):**
112+
1. Open a text editor or an IDE like Visual Studio Code.
113+
2. Create a new Dart file, such as `api_test.dart`.
114+
3. Copy the generated code from API Dash and paste it into this file.
115+
4. Save the file.
116+
5. Run the Dart file using the terminal or the IDE's built-in tools.
117+
118+
#### **Using the Command Line:**
119+
1. Save the generated code to a Dart file, e.g., `api_test.dart`.
120+
2. Open a terminal and navigate to the directory containing the file.
121+
3. Run the Dart file with the following command:
122+
```bash
123+
dart run api_test.dart
124+
```
59125

60126
## Go (net/http)
61127

0 commit comments

Comments
 (0)