Skip to content

Commit d7a2275

Browse files
authored
Minor fixes (mdanics#76)
* bumped dependencies * update timestamps to use firebase timestamp (now that it is available) * use image_picker compression instead of ad hoc compression code
1 parent f415b8c commit d7a2275

File tree

13 files changed

+120
-132
lines changed

13 files changed

+120
-132
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ android {
2424
defaultConfig {
2525
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2626
applicationId "me.danics.firestoretest"
27-
minSdkVersion 16
27+
minSdkVersion 21
2828
targetSdkVersion 27
2929
versionCode 1
3030
versionName "1.2.2"
@@ -49,7 +49,7 @@ dependencies {
4949
testImplementation 'junit:junit:4.12'
5050
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
5151
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
52-
implementation 'com.google.firebase:firebase-core:16.0.1'
52+
implementation 'com.google.firebase:firebase-core:16.0.4'
5353

5454
}
5555
apply plugin: 'com.google.gms.google-services'

android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ buildscript {
66

77
dependencies {
88
classpath 'com.android.tools.build:gradle:3.3.2'
9-
classpath 'com.google.gms:google-services:4.0.1'
10-
9+
classpath 'com.google.gms:google-services:4.3.0'
1110
}
1211
}
1312

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
android.enableJetifier=true
22
android.useAndroidX=true
33
org.gradle.jvmargs=-Xmx1536M
4+
android.enableR8=true

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11-
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12-
2FAABFC420AB9BC000695C4B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2FAABFC320AB9BC000695C4B /* GoogleService-Info.plist */; };
11+
2FEA05412183A21600873DEA /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2FEA05402183A21600873DEA /* GoogleService-Info.plist */; };
1312
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1413
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
1514
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -43,8 +42,8 @@
4342
/* Begin PBXFileReference section */
4443
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4544
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
46-
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
47-
2FAABFC320AB9BC000695C4B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
45+
172F131D775F5297C2841A96 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
46+
2FEA05402183A21600873DEA /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
4847
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4948
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
5049
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -59,6 +58,7 @@
5958
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6059
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6160
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
61+
A47AA0D76093A7A7D14D1F88 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
6262
A48A54A8F3D8BA3C696BF983 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6363
/* End PBXFileReference section */
6464

@@ -79,14 +79,15 @@
7979
7CB42A7162B3851135A6C52A /* Pods */ = {
8080
isa = PBXGroup;
8181
children = (
82+
A47AA0D76093A7A7D14D1F88 /* Pods-Runner.debug.xcconfig */,
83+
172F131D775F5297C2841A96 /* Pods-Runner.release.xcconfig */,
8284
);
8385
name = Pods;
8486
sourceTree = "<group>";
8587
};
8688
9740EEB11CF90186004384FC /* Flutter */ = {
8789
isa = PBXGroup;
8890
children = (
89-
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9091
3B80C3931E831B6300D905FE /* App.framework */,
9192
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9293
9740EEBA1CF902C7004384FC /* Flutter.framework */,
@@ -100,7 +101,7 @@
100101
97C146E51CF9000F007C117D = {
101102
isa = PBXGroup;
102103
children = (
103-
2FAABFC320AB9BC000695C4B /* GoogleService-Info.plist */,
104+
2FEA05402183A21600873DEA /* GoogleService-Info.plist */,
104105
9740EEB11CF90186004384FC /* Flutter */,
105106
97C146F01CF9000F007C117D /* Runner */,
106107
97C146EF1CF9000F007C117D /* Products */,
@@ -186,6 +187,8 @@
186187
TargetAttributes = {
187188
97C146ED1CF9000F007C117D = {
188189
CreatedOnToolsVersion = 7.3.1;
190+
DevelopmentTeam = XFKDZYYPTU;
191+
ProvisioningStyle = Automatic;
189192
};
190193
};
191194
};
@@ -194,6 +197,7 @@
194197
developmentRegion = English;
195198
hasScannedForEncodings = 0;
196199
knownRegions = (
200+
English,
197201
en,
198202
Base,
199203
);
@@ -213,12 +217,11 @@
213217
buildActionMask = 2147483647;
214218
files = (
215219
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
216-
2FAABFC420AB9BC000695C4B /* GoogleService-Info.plist in Resources */,
220+
2FEA05412183A21600873DEA /* GoogleService-Info.plist in Resources */,
217221
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
218222
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
219223
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
220224
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
221-
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
222225
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
223226
);
224227
runOnlyForDeploymentPostprocessing = 0;
@@ -232,16 +235,16 @@
232235
files = (
233236
);
234237
inputPaths = (
235-
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
236-
"${PODS_ROOT}/.symlinks/flutter/ios/Flutter.framework",
238+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
239+
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
237240
);
238241
name = "[CP] Embed Pods Frameworks";
239242
outputPaths = (
240243
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
241244
);
242245
runOnlyForDeploymentPostprocessing = 0;
243246
shellPath = /bin/sh;
244-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
247+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
245248
showEnvVarsInLog = 0;
246249
};
247250
0AB6CFB15BD839216C341DA3 /* [CP] Check Pods Manifest.lock */ = {
@@ -268,7 +271,7 @@
268271
files = (
269272
);
270273
inputPaths = (
271-
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
274+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
272275
"${PODS_ROOT}/GTMOAuth2/Source/Touch/GTMOAuth2ViewTouch.xib",
273276
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
274277
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
@@ -281,7 +284,7 @@
281284
);
282285
runOnlyForDeploymentPostprocessing = 0;
283286
shellPath = /bin/sh;
284-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
287+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
285288
showEnvVarsInLog = 0;
286289
};
287290
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
@@ -455,6 +458,9 @@
455458
buildSettings = {
456459
ARCHS = arm64;
457460
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
461+
CODE_SIGN_IDENTITY = "iPhone Developer";
462+
CODE_SIGN_STYLE = Automatic;
463+
DEVELOPMENT_TEAM = XFKDZYYPTU;
458464
ENABLE_BITCODE = NO;
459465
FRAMEWORK_SEARCH_PATHS = (
460466
"$(inherited)",
@@ -466,8 +472,10 @@
466472
"$(inherited)",
467473
"$(PROJECT_DIR)/Flutter",
468474
);
469-
PRODUCT_BUNDLE_IDENTIFIER = me.danics.firestoreTest;
475+
PRODUCT_BUNDLE_IDENTIFIER = me.danics.fluttergram;
470476
PRODUCT_NAME = "$(TARGET_NAME)";
477+
PROVISIONING_PROFILE = "";
478+
PROVISIONING_PROFILE_SPECIFIER = "";
471479
};
472480
name = Debug;
473481
};
@@ -477,6 +485,9 @@
477485
buildSettings = {
478486
ARCHS = arm64;
479487
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
488+
CODE_SIGN_IDENTITY = "iPhone Developer";
489+
CODE_SIGN_STYLE = Automatic;
490+
DEVELOPMENT_TEAM = XFKDZYYPTU;
480491
ENABLE_BITCODE = NO;
481492
FRAMEWORK_SEARCH_PATHS = (
482493
"$(inherited)",
@@ -488,8 +499,9 @@
488499
"$(inherited)",
489500
"$(PROJECT_DIR)/Flutter",
490501
);
491-
PRODUCT_BUNDLE_IDENTIFIER = me.danics.firestoreTest;
502+
PRODUCT_BUNDLE_IDENTIFIER = me.danics.fluttergram;
492503
PRODUCT_NAME = "$(TARGET_NAME)";
504+
PROVISIONING_PROFILE_SPECIFIER = "";
493505
};
494506
name = Release;
495507
};

ios/Runner/Base.lproj/LaunchScreen.storyboard

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_1" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
47
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
812
<!--View Controller-->
@@ -14,9 +18,11 @@
1418
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
1519
</layoutGuides>
1620
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1722
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1823
<subviews>
1924
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
25+
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
2026
</imageView>
2127
</subviews>
2228
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -28,7 +34,7 @@
2834
</viewController>
2935
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
3036
</objects>
31-
<point key="canvasLocation" x="53" y="375"/>
37+
<point key="canvasLocation" x="76.811594202898561" y="251.11607142857142"/>
3238
</scene>
3339
</scenes>
3440
<resources>

ios/Runner/Info.plist

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
<string>1.0</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
23+
<key>CFBundleURLTypes</key>
24+
<array>
25+
<dict>
26+
<key>CFBundleTypeRole</key>
27+
<string>Editor</string>
28+
<key>CFBundleURLSchemes</key>
29+
<array>
30+
<string>com.googleusercontent.apps.7019780124-8d9k97bo7jd6gn2fdm8pahj260br014j</string>
31+
<string>com.googleusercontent.apps.7019780124-lrego1vac3jl8a6egvo8efe56o8v2po0</string>
32+
</array>
33+
</dict>
34+
</array>
2335
<key>CFBundleVersion</key>
2436
<string>1</string>
2537
<key>LSRequiresIPhoneOS</key>
@@ -49,36 +61,10 @@
4961
<string>UIInterfaceOrientationLandscapeLeft</string>
5062
<string>UIInterfaceOrientationLandscapeRight</string>
5163
</array>
52-
53-
<key>NSCameraUsageDescription</key>
54-
<string>Used to allow the user to take a photo to upload as a post</string>
55-
<key>NSPhotoLibraryUsageDescription</key>
56-
<string>Used to allow the user to select a photo to upload as a post</string>
57-
58-
<!-- Location access section -->
59-
<key>NSLocationAlwaysUsageDescription</key>
60-
<string>Your location required to post </string>
61-
<key>NSLocationWhenInUseUsageDescription</key>
62-
<string>Your location required to post</string>
63-
64-
<!-- Google Sign-in Section -->
65-
<key>CFBundleURLTypes</key>
66-
<array>
67-
<dict>
68-
<key>CFBundleTypeRole</key>
69-
<string>Editor</string>
70-
<key>CFBundleURLSchemes</key>
71-
<array>
72-
<!-- TODO Replace this value: -->
73-
<!-- Copied from GoogleServices-Info.plist key REVERSE_CLIENT_ID -->
74-
<string>com.googleusercontent.apps.7019780124-8d9k97bo7jd6gn2fdm8pahj260br014j</string>
75-
</array>
76-
</dict>
77-
</array>
78-
<!-- End of the Google Sign-in Section -->
79-
80-
81-
64+
<key>NSLocationAlwaysUsageDescription</key>
65+
<string>Your location required to post </string>
66+
<key>NSLocationWhenInUseUsageDescription</key>
67+
<string>Your location required to post</string>
8268
<key>UIViewControllerBasedStatusBarAppearance</key>
8369
<false/>
8470
</dict>

lib/comment_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class _CommentScreenState extends State<CommentScreen> {
101101
.add({
102102
"username": currentUserModel.username,
103103
"comment": comment,
104-
"timestamp": DateTime.now().toString(),
104+
"timestamp": DateTime.now(),
105105
"avatarUrl": currentUserModel.photoUrl,
106106
"userId": currentUserModel.id
107107
});
@@ -117,7 +117,7 @@ class _CommentScreenState extends State<CommentScreen> {
117117
"type": "comment",
118118
"userProfileImg": currentUserModel.photoUrl,
119119
"commentData": comment,
120-
"timestamp": DateTime.now().toString(),
120+
"timestamp": DateTime.now(),
121121
"postId": postId,
122122
"mediaUrl": postMediaUrl,
123123
});

lib/image_post.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class _ImagePost extends State<ImagePost> {
307307
"type": "like",
308308
"userProfileImg": currentUserModel.photoUrl,
309309
"mediaUrl": mediaUrl,
310-
"timestamp": DateTime.now().toString(),
310+
"timestamp": DateTime.now(),
311311
"postId": postId,
312312
});
313313
}

lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
2323
User currentUserModel;
2424

2525
Future<void> main() async {
26+
27+
WidgetsFlutterBinding.ensureInitialized(); // after upgrading flutter this is now necessary
28+
2629
// enable timestamps in firebase
2730
Firestore.instance.settings(timestampsInSnapshotsEnabled: true).then((_) {
2831
print('[Main] Firestore timestamps in snapshots set');},
@@ -262,7 +265,7 @@ class _HomePageState extends State<HomePage> {
262265
onPageChanged: onPageChanged,
263266
),
264267
bottomNavigationBar: CupertinoTabBar(
265-
activeColor: Colors.orange,
268+
backgroundColor: Colors.white,
266269
items: <BottomNavigationBarItem>[
267270
BottomNavigationBarItem(
268271
icon: Icon(Icons.home,

lib/profile_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class _ProfilePage extends State<ProfilePage>
9696
"userId": currentUserId,
9797
"type": "follow",
9898
"userProfileImg": currentUserModel.photoUrl,
99-
"timestamp": DateTime.now().toString()
99+
"timestamp": DateTime.now()
100100
});
101101
}
102102

0 commit comments

Comments
 (0)