# Dart and Flutter mirror (pkg.shecan.ir)

> Mirror of pub.dev (PUB_HOSTED_URL) and of the Flutter storage bucket (FLUTTER_STORAGE_BASE_URL: SDK releases, engine artifacts, download.flutter.io Maven repository).

- Upstream: pub.dev, storage.googleapis.com
- Mirror URL: <https://mirror-flutter.pkg.shecan.ir/>
- Clients: dart, flutter
- Service status: <https://pkg.shecan.ir/status.json> (key `flutter`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/flutter/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/flutter.json>

## Limitations

- Read-only: dart pub publish is not supported.
- The Flutter SDK git repository (github.com/flutter/flutter) is not mirrored; install the SDK from the release archive.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### dart, flutter: persistent (user- or system-wide configuration)

Run (linux, macos)

```sh
export PUB_HOSTED_URL=https://mirror-flutter.pkg.shecan.ir
export FLUTTER_STORAGE_BASE_URL=https://mirror-flutter.pkg.shecan.ir
```

Undo / restore the default (linux, macos)

```sh
unset PUB_HOSTED_URL FLUTTER_STORAGE_BASE_URL
sed -i.bak -E '/^export (PUB_HOSTED_URL|FLUTTER_STORAGE_BASE_URL)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```

Run (windows) (checked by hand)

```powershell
[Environment]::SetEnvironmentVariable('PUB_HOSTED_URL', 'https://mirror-flutter.pkg.shecan.ir', 'User')
[Environment]::SetEnvironmentVariable('FLUTTER_STORAGE_BASE_URL', 'https://mirror-flutter.pkg.shecan.ir', 'User')
```

Undo / restore the default (windows) (checked by hand)

```powershell
[Environment]::SetEnvironmentVariable('PUB_HOSTED_URL', $null, 'User')
[Environment]::SetEnvironmentVariable('FLUTTER_STORAGE_BASE_URL', $null, 'User')
```

### flutter: persistent (user- or system-wide configuration)

Run (linux)

```sh
curl -fLO https://mirror-flutter.pkg.shecan.ir/flutter_infra_release/releases/stable/linux/flutter_linux_3.47.7-stable.tar.xz
tar -xJf flutter_linux_3.47.7-stable.tar.xz
```
