Skip to content

Commit 9d83fe6

Browse files
authored
Update instructions_to_run_generated_code.md
1 parent f0e90ad commit 9d83fe6

File tree

1 file changed

+32
-55
lines changed

1 file changed

+32
-55
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -51,100 +51,77 @@ TODO
5151

5252
## Dart (http)
5353

54-
Here are the detailed instructions for running the generated API Dash code in **Dart (using `http`)** for macOS, Windows, and Linux:
54+
Here are the detailed instructions for running the generated API Dash code in **Dart (using `http`)** for macOS, Windows, and Linux:
5555

56-
---
56+
### **1. Install Dart**
5757

58-
### **1. Install Dart**
59-
To run Dart code, you need to install the Dart SDK.
58+
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step installation instructions for macOS, Windows, and Linux.
6059

61-
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step instructions for macOS, Windows, and Linux.
62-
- Follow the guide to install Dart globally on your system.
60+
### **2. Add the `http` Package**
6361

64-
---
65-
66-
### **2. Add the `http` Package**
67-
To use the `http` package in Dart, you need to add it as a dependency in your project.
68-
69-
1. Create a new Dart project by running the following command in the terminal:
70-
```bash
71-
dart create my_dart_project
72-
cd my_dart_project
73-
```
74-
2. Open the `pubspec.yaml` file in the project directory.
75-
3. Add the following line under the `dependencies` section:
62+
- Add the `http` package as a dependency under the `dependencies` section of the `pubspec.yaml` file:
7663
```yaml
7764
dependencies:
7865
http: ^1.2.2
7966
```
80-
4. Run the following command to fetch the dependency:
67+
- Run the following command to fetch the dependency:
8168
```bash
8269
dart pub get
8370
```
8471

85-
---
86-
87-
### **3. Run the Generated Code**
88-
After setting up Dart and the `http` package, follow these steps to execute the generated code:
72+
### **3. Run the Generated Code**
8973

9074
#### **Using a Text Editor or IDE (e.g., Visual Studio Code):**
91-
1. Open a text editor or an IDE like Visual Studio Code.
92-
2. Create a new Dart file, such as `api_test.dart`.
93-
3. Copy the generated code from API Dash and paste it into this file.
94-
4. Save the file.
95-
5. Run the Dart file using the terminal or the IDE's built-in tools.
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.
9680

9781
#### **Using the Command Line:**
98-
1. Save the generated code to a Dart file, e.g., `api_test.dart`.
99-
2. Open a terminal and navigate to the directory containing the file.
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.
10084
3. Run the Dart file with the following command:
10185
```bash
10286
dart run api_test.dart
10387
```
10488

105-
With these steps, you can successfully run API Dash-generated code in Dart using the `http` package! 🚀
106-
10789
## Dart (dio)
10890

10991
Here are the detailed instructions for running the generated API Dash code in **Dart (using `dio`)** for macOS, Windows, and Linux:
11092

111-
---
112-
113-
### **1. Install Dart**
114-
To run Dart code, you need to install the Dart SDK.
115-
116-
👉 Follow the instructions provided above under **Dart (http)** for detailed steps on how to install Dart on macOS, Windows, and Linux.
93+
### **1. Install Dart**
11794

118-
---
95+
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step installation instructions for macOS, Windows, and Linux.
11996

120-
### **2. Add the `dio` Package**
121-
To use the `dio` package in Dart, you need to add it as a dependency in your project.
97+
### **2. Add the `dio` Package**
12298

123-
1. Create a new Dart project by running the following command in the terminal:
124-
```bash
125-
dart create my_dart_project
126-
cd my_dart_project
127-
```
128-
2. Open the `pubspec.yaml` file in the project directory.
129-
3. Add the following line under the `dependencies` section:
99+
- Add the `dio` package as a dependency under the `dependencies` section of the `pubspec.yaml` file:
130100
```yaml
131101
dependencies:
132102
dio: ^5.7.0
133103
```
134-
4. Run the following command to fetch the dependency:
104+
- Run the following command to fetch the dependency:
135105
```bash
136106
dart pub get
137107
```
138-
---
139108

140109
### **3. Run the Generated Code**
141-
After setting up Dart and the `dio` package, follow these steps to execute the generated code:
142-
143-
👉 Refer to the instructions under **Dart (http)** for details on how to execute the Dart file using an IDE or the terminal.
144110

145-
---
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.
146117

147-
With these steps, you can successfully run API Dash-generated code in Dart using the `dio` package! 🚀
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+
```
148125

149126
## Go (net/http)
150127

0 commit comments

Comments
 (0)