You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user_guide/instructions_to_run_generated_code.md
+32-55Lines changed: 32 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,100 +51,77 @@ TODO
51
51
52
52
## Dart (http)
53
53
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:
55
55
56
-
---
56
+
### **1. Install Dart**
57
57
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.
60
59
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**
63
61
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:
76
63
```yaml
77
64
dependencies:
78
65
http: ^1.2.2
79
66
```
80
-
4. Run the following command to fetch the dependency:
67
+
- Run the following command to fetch the dependency:
81
68
```bash
82
69
dart pub get
83
70
```
84
71
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**
89
73
90
74
#### **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.
96
80
97
81
#### **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.
100
84
3. Run the Dart file with the following command:
101
85
```bash
102
86
dart run api_test.dart
103
87
```
104
88
105
-
With these steps, you can successfully run API Dash-generated code in Dart using the `http` package! 🚀
106
-
107
89
## Dart (dio)
108
90
109
91
Here are the detailed instructions for running the generated API Dash code in **Dart (using `dio`)** for macOS, Windows, and Linux:
110
92
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**
117
94
118
-
---
95
+
- Visit the official **[Dart Installation Guide](https://dart.dev/get-dart)** for step-by-step installation instructions for macOS, Windows, and Linux.
119
96
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**
122
98
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:
130
100
```yaml
131
101
dependencies:
132
102
dio: ^5.7.0
133
103
```
134
-
4. Run the following command to fetch the dependency:
104
+
- Run the following command to fetch the dependency:
135
105
```bash
136
106
dart pub get
137
107
```
138
-
---
139
108
140
109
### **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.
144
110
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.
146
117
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.
0 commit comments