|
18 | 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19 | 19 | // SOFTWARE.
|
20 | 20 |
|
21 |
| -import "dart:ffi"; |
22 | 21 | import "dart:io";
|
23 | 22 |
|
24 |
| -import "../../klutter.dart"; |
25 |
| -import "environment.dart"; |
26 |
| -import "exception.dart"; |
27 |
| -import "utilities.dart"; |
| 23 | +import "common.dart"; |
28 | 24 |
|
29 | 25 | /// Create and/or append the .klutter-plugins file to register a Klutter plugin.
|
30 | 26 | ///
|
@@ -163,36 +159,6 @@ String findDependencyPath({
|
163 | 159 | return cachePath.normalize;
|
164 | 160 | }
|
165 | 161 |
|
166 |
| -/// Find applicable [FlutterDistribution] for the current |
167 |
| -/// [OperatingSystem] and [Architecture] or throw [KlutterException]. |
168 |
| -FlutterDistribution toFlutterDistributionOrThrow( |
169 |
| - {required VerifiedFlutterVersion version, |
170 |
| - required String pathToRoot, |
171 |
| - PlatformWrapper? platformWrapper}) { |
172 |
| - final p = platformWrapper ?? platform; |
173 |
| - OperatingSystem? os; |
174 |
| - |
175 |
| - if (version.os != null) { |
176 |
| - os = version.os; |
177 |
| - } else if (p.isWindows) { |
178 |
| - os = OperatingSystem.windows; |
179 |
| - } else if (p.isMacos) { |
180 |
| - os = OperatingSystem.macos; |
181 |
| - } else if (p.isLinux) { |
182 |
| - os = OperatingSystem.linux; |
183 |
| - } else { |
184 |
| - throw KlutterException( |
185 |
| - "Current OS is not supported (supported: macos, windows or linux): ${Platform.operatingSystem}"); |
186 |
| - } |
187 |
| - |
188 |
| - final arch = version.arch ?? |
189 |
| - (Abi.current().toString().contains("arm") |
190 |
| - ? Architecture.arm64 |
191 |
| - : Architecture.x64); |
192 |
| - |
193 |
| - return FlutterDistribution(version: version.version, os: os!, arch: arch); |
194 |
| -} |
195 |
| - |
196 | 162 | extension on String {
|
197 | 163 | /// Create a path to the root-project/.klutter-plugins file.
|
198 | 164 | /// If the file does not exist create it.
|
|
0 commit comments