Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B34E9F092D776BEB0009AED2 /* Notifications.g.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34E9F082D776BEB0009AED2 /* Notifications.g.swift */; };
F311C174AF9C005CE4AADD72 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EAE3F3F518B95B7BFEB4FE7 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -47,7 +46,6 @@
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B34E9F082D776BEB0009AED2 /* Notifications.g.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notifications.g.swift; sourceTree = "<group>"; };
B3AF53A72CA20BD10039801D /* Zulip.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Zulip.xcconfig; path = Flutter/Zulip.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -112,7 +110,6 @@
3752899A2AF472D400475D9C /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
Expand Down Expand Up @@ -195,7 +192,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
Expand Down Expand Up @@ -316,14 +312,6 @@
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down
5 changes: 5 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import Flutter
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)

// Use `DesignVariables.mainBackground` color as the background color
// of the default UIView.
window?.backgroundColor = UIColor(named: "LaunchBackground");

let controller = window?.rootViewController as! FlutterViewController

// Retrieve the remote notification payload from launch options;
Expand Down
38 changes: 38 additions & 0 deletions ios/Runner/Assets.xcassets/LaunchBackground.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF0",
"green" : "0xF0",
"red" : "0xF0"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x1D",
"green" : "0x1D",
"red" : "0x1D"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 0 additions & 23 deletions ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

This file was deleted.

37 changes: 0 additions & 37 deletions ios/Runner/Base.lproj/LaunchScreen.storyboard

This file was deleted.

7 changes: 5 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string>LaunchBackground</string>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
Expand Down
11 changes: 10 additions & 1 deletion lib/widgets/store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GlobalStoreWidget extends StatefulWidget {
const GlobalStoreWidget({
super.key,
this.blockingFuture,
this.placeholder = const LoadingPlaceholder(),
this.placeholder = const BlankLoadingPlaceholder(),
required this.child,
});

Expand Down Expand Up @@ -341,6 +341,15 @@ class _PerAccountStoreInheritedWidget extends InheritedNotifier<PerAccountStore>
store != oldWidget.store;
}

class BlankLoadingPlaceholder extends StatelessWidget {
const BlankLoadingPlaceholder({super.key});

@override
Widget build(BuildContext context) {
return const SizedBox.shrink();
}
}

class LoadingPlaceholder extends StatelessWidget {
const LoadingPlaceholder({super.key});

Expand Down
10 changes: 10 additions & 0 deletions lib/widgets/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
listMenuItemBg: const Color(0xffcbcdd6),
listMenuItemIcon: const Color(0xff9194a3),
listMenuItemText: const Color(0xff2d303c),

// Keep the color here and the corresponding non-dark mode entry in
// ios/Runner/Assets.xcassets/LaunchBackground.colorset/Contents.json
// in sync.
mainBackground: const Color(0xfff0f0f0),

neutralButtonBg: const Color(0xff8c84ae),
neutralButtonLabel: const Color(0xff433d5c),
radioBorder: Color(0xffbbbdc8),
Expand Down Expand Up @@ -257,7 +262,12 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
listMenuItemBg: const Color(0xff2d303c),
listMenuItemIcon: const Color(0xff767988),
listMenuItemText: const Color(0xffcbcdd6),

// Keep the color here and the corresponding dark mode entry in
// ios/Runner/Assets.xcassets/LaunchBackground.colorset/Contents.json
// in sync.
mainBackground: const Color(0xff1d1d1d),

neutralButtonBg: const Color(0xffd4d1e0),
neutralButtonLabel: const Color(0xffa9a3c2),
radioBorder: Color(0xff626573),
Expand Down
14 changes: 8 additions & 6 deletions test/widgets/store_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ void main() {
return const SizedBox.shrink();
})));
// First, shows a loading page instead of child.
check(find.byType(CircularProgressIndicator)).findsOne();
check(find.byType(BlankLoadingPlaceholder)).findsOne();
check(globalStore).isNull();

await tester.pump();
// Then after loading, mounts child instead, with provided store.
check(find.byType(CircularProgressIndicator)).findsNothing();
check(find.byType(BlankLoadingPlaceholder)).findsNothing();
check(globalStore).identicalTo(testBinding.globalStore);

await testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
Expand All @@ -98,14 +98,15 @@ void main() {
await tester.pump();
// Even after the store must have loaded,
// still shows loading page while blockingFuture is pending.
check(find.byType(CircularProgressIndicator)).findsOne();
check(find.byType(BlankLoadingPlaceholder)).findsOne();
check(find.text('done')).findsNothing();

// Once blockingFuture completes…
completer.complete();
await tester.pump();
await tester.pump(); // TODO why does GlobalStoreWidget need this extra frame?
// … mounts child instead of the loading page.
check(find.byType(CircularProgressIndicator)).findsNothing();
check(find.byType(BlankLoadingPlaceholder)).findsNothing();
check(find.text('done')).findsOne();
});

Expand All @@ -123,14 +124,15 @@ void main() {
await tester.pump();
// Even after the store must have loaded,
// still shows loading page while blockingFuture is pending.
check(find.byType(CircularProgressIndicator)).findsOne();
check(find.byType(BlankLoadingPlaceholder)).findsOne();
check(find.text('done')).findsNothing();

// Once blockingFuture completes, even with an error…
completer.completeError(Exception('oops'));
await tester.pump();
await tester.pump(); // TODO why does GlobalStoreWidget need this extra frame?
// … mounts child instead of the loading page.
check(find.byType(CircularProgressIndicator)).findsNothing();
check(find.byType(BlankLoadingPlaceholder)).findsNothing();
check(find.text('done')).findsOne();
});

Expand Down