mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-07-05 13:40:41 +00:00
Compare commits
3 commits
2dee63e78e
...
0e45d98060
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0e45d98060 | ||
![]() |
cf471afdfd | ||
![]() |
d95b811d6c |
8 changed files with 62 additions and 36 deletions
43
README.md
43
README.md
|
@ -38,41 +38,18 @@ To build this app you need to install Flutter 3.24.5 stable. [How to install](ht
|
||||||
|
|
||||||
### 2. Project setup
|
### 2. Project setup
|
||||||
|
|
||||||
#### Restore _constants.dart_ file
|
#### Restore git-ignored files:
|
||||||
|
|
||||||
Create a file _lib/constants.dart_ and paste the following content:
|
For macOS you can just run the following script:
|
||||||
|
|
||||||
```dart
|
|
||||||
const String contactEmail = '';
|
|
||||||
const String iapServerUrl = '';
|
|
||||||
const String issuesReportUrl = '';
|
|
||||||
const String sourceCodeUrl = '';
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Stub IAP package
|
|
||||||
|
|
||||||
As part of the app's functionallity is in the private repo, you have to replace these lines in _pubspec.yaml_:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
m3_lightmeter_iap:
|
|
||||||
git:
|
|
||||||
url: "https://github.com/vodemn/m3_lightmeter_iap"
|
|
||||||
ref: main
|
|
||||||
```
|
|
||||||
|
|
||||||
with these:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
m3_lightmeter_iap:
|
|
||||||
path: iap
|
|
||||||
```
|
|
||||||
|
|
||||||
You can do it simply by running the script:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sh .github/scripts/stub_iap.sh
|
sh scripts/setup_fork.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or create the files manually using the contents from the script.
|
||||||
|
|
||||||
|
#### Get dependencies
|
||||||
|
|
||||||
> If you are using VSCode, you can open the workspace like so: _File -> Open Workspace from File -> m3_lightmeter.code-workspace_. Otherwise you have to run `flutter pub get` command from the iap folder.
|
> If you are using VSCode, you can open the workspace like so: _File -> Open Workspace from File -> m3_lightmeter.code-workspace_. Otherwise you have to run `flutter pub get` command from the iap folder.
|
||||||
|
|
||||||
Then you can fetch all the neccessary dependencies and generate translation files by running the following commands:
|
Then you can fetch all the neccessary dependencies and generate translation files by running the following commands:
|
||||||
|
@ -82,11 +59,7 @@ flutter pub get
|
||||||
flutter pub run intl_utils:generate
|
flutter pub run intl_utils:generate
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. (Optional) Install Firebase
|
### 3. Build
|
||||||
|
|
||||||
Out of the box Firebase Crashlytics won't work. If you want to add Crashlytics to your local build please follow [this guide](https://firebase.google.com/docs/flutter/setup).
|
|
||||||
|
|
||||||
### 4. Build
|
|
||||||
|
|
||||||
- Checkout [Build .apk](.github/workflows/build_apk.yml) workflow for Android
|
- Checkout [Build .apk](.github/workflows/build_apk.yml) workflow for Android
|
||||||
- Checkout [Build .ipa](.github/workflows/build_ipa.yml) workflow for iOS
|
- Checkout [Build .ipa](.github/workflows/build_ipa.yml) workflow for iOS
|
||||||
|
|
|
@ -132,7 +132,7 @@ class _ProFeaturesOverlay extends StatelessWidget {
|
||||||
);
|
);
|
||||||
final bool hasSpotMetering = UserPreferencesProvider.cameraFeatureOf(
|
final bool hasSpotMetering = UserPreferencesProvider.cameraFeatureOf(
|
||||||
context,
|
context,
|
||||||
CameraFeature.histogram,
|
CameraFeature.spotMetering,
|
||||||
);
|
);
|
||||||
return Stack(
|
return Stack(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
|
|
4
scripts/mocks/mock_constants.dart
Normal file
4
scripts/mocks/mock_constants.dart
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
const String contactEmail = '';
|
||||||
|
const String iapServerUrl = '';
|
||||||
|
const String issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues/new/choose';
|
||||||
|
const String sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter/';
|
30
scripts/mocks/mock_firebase.json
Normal file
30
scripts/mocks/mock_firebase.json
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"flutter": {
|
||||||
|
"platforms": {
|
||||||
|
"android": {
|
||||||
|
"default": {
|
||||||
|
"projectId": "mockproject-1234",
|
||||||
|
"appId": "1:123456789000:android:f1bf012572b04063",
|
||||||
|
"fileOutput": "android/app/google-services.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"default": {
|
||||||
|
"projectId": "mockproject-1234",
|
||||||
|
"appId": "1:123456789000:ios:f1bf012572b04063",
|
||||||
|
"uploadDebugSymbols": true,
|
||||||
|
"fileOutput": "ios/Runner/GoogleService-Info.plist"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dart": {
|
||||||
|
"lib/firebase_options.dart": {
|
||||||
|
"projectId": "mockproject-1234",
|
||||||
|
"configurations": {
|
||||||
|
"android": "1:123456789000:android:f1bf012572b04063",
|
||||||
|
"ios": "1:123456789000:ios:f1bf012572b04063"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
scripts/mocks/mock_firebase_options.dart
Normal file
7
scripts/mocks/mock_firebase_options.dart
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||||
|
|
||||||
|
class DefaultFirebaseOptions {
|
||||||
|
static FirebaseOptions get currentPlatform =>
|
||||||
|
FirebaseOptions(apiKey: '', appId: '', messagingSenderId: '', projectId: '');
|
||||||
|
}
|
12
scripts/setup_fork.sh
Normal file
12
scripts/setup_fork.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
cp "scripts/mocks/mock_constants.dart" "lib/constants.dart"
|
||||||
|
cp "scripts/mocks/mock_firebase_options.dart" "lib/firebase_options.dart"
|
||||||
|
cp "scripts/mocks/mock_firebase.json" "firebase.json"
|
||||||
|
|
||||||
|
curl -H 'Accept: application/vnd.github.v3.raw' \
|
||||||
|
-o "android/app/google-services.json" \
|
||||||
|
-L "https://api.github.com/repos/firebase/quickstart-android/contents/mock-google-services.json"
|
||||||
|
curl -H 'Accept: application/vnd.github.v3.raw' \
|
||||||
|
-o "ios/Runner/GoogleService-Info.plist" \
|
||||||
|
-L "https://api.github.com/repos/firebase/quickstart-ios/contents/mock-GoogleService-Info.plist"
|
||||||
|
|
||||||
|
sh .github/scripts/stub_iap.sh
|
Loading…
Reference in a new issue