Skip to content

Commit 21dc464

Browse files
Further UI Improvements (#155)
* fix: stuff Followup to #152. * chore: refresh podfile Flutter also migrated us to SPM, but it still falls back to CocoaPods. See my work at ThexXTURBOXx/flutter_web_auth_2#150. * chore: refresh ios podfile too Flutter also migrated us to SPM, but it still falls back to CocoaPods. See my work at ThexXTURBOXx/flutter_web_auth_2#150. * ci: do less work Less pub, less build_runner, faster runs. * refactor: stuff * ci: fix * feat: single scaffold Thank god! To be honest, this doesn't look great yet, but it's technically correct. This should make life significantly less buggy. Note: there seems to be a bug when switching between desktop and mobile. Is that really a common situation outside of development? Ehh, hopefully not. * fix: lints * chore: mark ephemeral files as generated Maybe someday they'll be ignored like they ought to be... flutter/flutter#71762, flutter/flutter#76726, & flutter/flutter#149917. * feat: introduce window size classes * feat: guard against logged-in users logging in * fix: auto router * style: format * feat: responsive sign up page * feat: refresh Fixes #80 * wip * fix: 1 wrapper This is perhaps a regression, but nobody cares. --------- Co-authored-by: Matthew Wasser <[email protected]>
1 parent 0f4667f commit 21dc464

File tree

27 files changed

+888
-565
lines changed

27 files changed

+888
-565
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto eol=lf
2+
3+
/packages/app/*/[Ff]lutter/** linguist-generated=true
4+
*.lock linguist-generated=true

.github/workflows/ci.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
packages/*/lib/src/gen/*.gen.dart
5858
packages/*/lib/src/**/*.g.dart
5959
packages/*/lib/src/**/*.freezed.dart
60+
packages/*/test/helpers/**/*.freezed.dart
6061
packages/*/lib/src/app/*.gr.dart
6162
packages/*/lib/src/app/*.gm.dart
6263
packages/*/lib/src/l10n/app_localizations.dart
@@ -137,19 +138,17 @@ jobs:
137138
packages/*/lib/src/gen/*.gen.dart
138139
packages/*/lib/src/**/*.g.dart
139140
packages/*/lib/src/**/*.freezed.dart
141+
packages/*/test/helpers/**/*.freezed.dart
140142
packages/*/lib/src/app/*.gr.dart
141143
packages/*/lib/src/app/*.gm.dart
142144
packages/*/lib/src/l10n/app_localizations.dart
143145
packages/*/lib/src/l10n/app_localizations_*.dart
144146
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
145147
- name: 📦 Install dependencies
146-
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
147-
with:
148-
run-bootstrap: true
149-
enforce-lockfile: true
148+
run: dart pub get --enforce-lockfile
150149
- name: 🔧 Build
151150
run: |
152-
flutter build ${{ matrix.target }} ${{ matrix.flutter-flags }}
151+
flutter build ${{ matrix.target }} --no-pub ${{ matrix.flutter-flags }}
153152
working-directory: packages/app/
154153
- name: ⚙️ Upload build
155154
if: ${{ matrix.target == 'web' }}
@@ -191,16 +190,18 @@ jobs:
191190
packages/*/lib/src/gen/*.gen.dart
192191
packages/*/lib/src/**/*.g.dart
193192
packages/*/lib/src/**/*.freezed.dart
193+
packages/*/test/helpers/**/*.freezed.dart
194194
packages/*/lib/src/app/*.gr.dart
195195
packages/*/lib/src/app/*.gm.dart
196196
packages/*/lib/src/l10n/app_localizations.dart
197197
packages/*/lib/src/l10n/app_localizations_*.dart
198198
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
199-
- name: 📦 Install dependencies
199+
- name: 🌋 Install Melos
200200
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
201201
with:
202-
run-bootstrap: true
203-
enforce-lockfile: true
202+
run-bootstrap: false
203+
- name: 📦 Install dependencies
204+
run: dart pub get --enforce-lockfile
204205
- name: 🕵️ Analyze project source
205206
run: dart analyze --fatal-infos
206207
- name: 🕵️ Run Custom Lint Rules
@@ -238,6 +239,7 @@ jobs:
238239
packages/*/lib/src/gen/*.gen.dart
239240
packages/*/lib/src/**/*.g.dart
240241
packages/*/lib/src/**/*.freezed.dart
242+
packages/*/test/helpers/**/*.freezed.dart
241243
packages/*/lib/src/app/*.gr.dart
242244
packages/*/lib/src/app/*.gm.dart
243245
packages/*/lib/src/l10n/app_localizations.dart
@@ -246,11 +248,12 @@ jobs:
246248
restore-keys: |
247249
${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-
248250
${{ runner.os }}-
249-
- name: 📦 Install dependencies
251+
- name: 🌋 Install Melos
250252
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
251253
with:
252-
run-bootstrap: true
253-
enforce-lockfile: true
254+
run-bootstrap: false
255+
- name: 📦 Install dependencies
256+
run: dart pub get --enforce-lockfile
254257
- name: 🧪 Run tests
255258
run: melos run test
256259
continue-on-error: true

devtools_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages/app/devtools_options.yaml

packages/app/ios/Podfile.lock

Lines changed: 44 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
19+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXContainerItemProxy section */
@@ -72,6 +73,7 @@
7273
isa = PBXFrameworksBuildPhase;
7374
buildActionMask = 2147483647;
7475
files = (
76+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
7577
19C545B048F09A8416396887 /* Pods_Runner.framework in Frameworks */,
7678
);
7779
runOnlyForDeploymentPostprocessing = 0;
@@ -187,6 +189,9 @@
187189
productType = "com.apple.product-type.bundle.unit-test";
188190
};
189191
97C146ED1CF9000F007C117D /* Runner */ = {
192+
packageProductDependencies = (
193+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
194+
);
190195
isa = PBXNativeTarget;
191196
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
192197
buildPhases = (
@@ -212,6 +217,9 @@
212217

213218
/* Begin PBXProject section */
214219
97C146E61CF9000F007C117D /* Project object */ = {
220+
packageReferences = (
221+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
222+
);
215223
isa = PBXProject;
216224
attributes = {
217225
BuildIndependentTargetsInParallel = YES;
@@ -728,6 +736,18 @@
728736
defaultConfigurationName = Release;
729737
};
730738
/* End XCConfigurationList section */
739+
/* Begin XCLocalSwiftPackageReference section */
740+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
741+
isa = XCLocalSwiftPackageReference;
742+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
743+
};
744+
/* End XCLocalSwiftPackageReference section */
745+
/* Begin XCSwiftPackageProductDependency section */
746+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
747+
isa = XCSwiftPackageProductDependency;
748+
productName = FlutterGeneratedPluginSwiftPackage;
749+
};
750+
/* End XCSwiftPackageProductDependency section */
731751
};
732752
rootObject = 97C146E61CF9000F007C117D /* Project object */;
733753
}

packages/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"

packages/app/lib/main.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/// This library contains the app's primary entrypoint.
22
library;
33

4-
import 'dart:io';
5-
64
import 'package:flutter/widgets.dart';
75
import 'package:shared_preferences/shared_preferences.dart';
8-
import 'package:window_manager/window_manager.dart';
96

107
import 'src/app/app.dart';
118
import 'src/app/bootstrap.dart';
@@ -14,16 +11,6 @@ import 'src/app/bootstrap.dart';
1411
///
1512
/// This uses [Bootstrap] to launch [App].
1613
Future<void> main() async {
17-
//Set minimum window size for desktop
18-
WidgetsFlutterBinding.ensureInitialized();
19-
20-
// Only initialize window manager on desktop platforms
21-
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
22-
await windowManager.ensureInitialized();
23-
await WindowManager.instance.setMinimumSize(const Size(1200, 600));
24-
await WindowManager.instance.setMaximumSize(const Size(1920, 1080));
25-
}
26-
2714
await const App().bootstrap((
2815
runApp: runApp,
2916
getSharedPreferences: SharedPreferencesWithCache.create,

packages/app/lib/src/app/bootstrap.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import 'package:flutter/widgets.dart';
99
import 'package:flutter_native_splash/flutter_native_splash.dart';
1010
import 'package:flutter_web_plugins/url_strategy.dart';
1111
import 'package:hooks_riverpod/hooks_riverpod.dart';
12+
import 'package:os_detect/os_detect.dart';
1213
import 'package:shared_preferences/shared_preferences.dart';
14+
import 'package:window_manager/window_manager.dart';
1315

1416
import '../features/settings/application/settings_service.dart';
1517
import '../features/settings/data/preferences_repository.dart';
@@ -47,6 +49,13 @@ mixin Bootstrap implements Widget {
4749
// Bind Flutter to the native platform.
4850
WidgetsFlutterBinding.ensureInitialized();
4951

52+
// Constrain the window size on desktop.
53+
if (isWindows || isLinux || isMacOS) {
54+
await windowManager.ensureInitialized();
55+
await WindowManager.instance.setMinimumSize(const Size(1200, 600));
56+
await WindowManager.instance.setMaximumSize(const Size(1920, 1080));
57+
}
58+
5059
// Load the user's preferences.
5160
final prefs = await getSharedPreferences(
5261
cacheOptions: const SharedPreferencesWithCacheOptions(),

0 commit comments

Comments
 (0)