Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 276103d

Browse files
committed
Cleanup
1 parent 2f0b7ee commit 276103d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+248
-121
lines changed

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2021 gskinner.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
<br />
2-
<p align="center"><a href="https://flutter.gskinner.com"><img src="https://gskinner.com/flutter_showcase/shared/[email protected]?" width="440px"/></a></p>
3-
<br />
2+
<p align="center"><a href="https://flutter.gskinner.com"><img src="https://flutter.gskinner.com/assets/images/gskinnerxflutter.png?" width="440px"></a></p>
3+
4+
# Flutter Folio
5+
6+
<p align="center"><img src="https://flutter.gskinner.com/assets/images/git_promoimage.png?" width="800px"></p>
7+
8+
A demo app showcasing how Flutter can deliver a great multi-platform experience for developers. Built by [gskinner](https://gskinner.com) in partnership with Google, Flutter Folio purposely considers user expectations, input devices and idioms for each platform, ensuring it feels at home on every device.
9+
10+
In addition to forking and reviewing the [MIT license](LICENSE.md) code available here, you can check out more information on the [Flutter Folio Showcase Website](https://flutter.gskinner.com).
11+
12+
### About gskinner
13+
We exist to build inovative digital experiences for smart clients, and we love how easy Flutter makes that. Don't hesitate to [stop by our site](https://gskinner.com) to learn more about what we do. We'd love to hear from you!
414

5-
[ CHRIS: INSERT WIDE BANNER HERE WITH SHOTS OF ALL PLATFORMS ]
15+
<p align="center"><img src="https://flutter.gskinner.com/assets/images/git_dashes.png?" width="800px"></p>
616

7-
# Flutter Folio
8-
[ CHRIS: ADD LONG_DESC]
9-
[ CHRIS: ADD LINK TO MICROSITE ]
17+
### Demo Builds
18+
To preview the app without needing to run a build process you can download any of the latest released builds
1019

11-
# About gskinner
12-
We exist to build inovative digital experiences for smart clients, and we love how easy Flutter makes that experience. Don't hesitate to stop by our site to learn more about what we do. We'd love to hear from you!
20+
| Target Platfom | Build |
21+
| ------ | ------ |
22+
| Web | [ www.flutterfolio.com ](https://www.flutterfolio.com/) |
23+
| Linux | [tar.gz](https://www.flutterfolio.com/builds/latest/linux-build/linux_build.tar.xz?84) |
24+
| Windows | [.zip](https://www.flutterfolio.com/builds/latest/windows-build/windows_build.zip?84) |
25+
| macOS | [dmg](https://www.flutterfolio.com/builds/latest/macos-build/FlutterFolio.dmg?84) |
26+
| Android | Checkout the repo to install on your local device. |
27+
| iOS | Checkout the repo to install on your local device. |
1328

1429
### Installation
1530

@@ -32,7 +47,7 @@ Once you're on `dev` and desktop is enabled, you're ready to run the app:
3247
* `flutter run -d ios`
3348
* `flutter run -d web`
3449

35-
If you re-start your IDE, you should also see a new launch option for your current desktop
50+
If you re-start your IDE, you should also see a new launch option for your current desktop platform.
3651

3752
### Client Keys
3853
This repo includes a set of Keys for Cloudinary and Firebase that are on the free pricing plans. Depending on traffic, these may reach their limit. If that happens, you will need to to provide your own keys in order to run the app locally, those can be found in `AppKeys.dart`. These limits should refresh each month, so your mileage will vary here.

android/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ android {
3838
}
3939

4040
defaultConfig {
41-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4241
applicationId "com.gskinner.flutterfolio"
4342
minSdkVersion 16
4443
targetSdkVersion 29

lib/_spikes/auth_spike.dart

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import 'package:firebase_auth/firebase_auth.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_folio/_utils/time_utils.dart';
4+
5+
class NativeFirebaseAuthSpike extends StatefulWidget {
6+
@override
7+
_NativeFirebaseAuthSpikeState createState() => _NativeFirebaseAuthSpikeState();
8+
}
9+
10+
class _NativeFirebaseAuthSpikeState extends State<NativeFirebaseAuthSpike> {
11+
@override
12+
void initState() {
13+
super.initState();
14+
testFirebase();
15+
}
16+
17+
Future<void> testFirebase() async {
18+
print("START TEST ${TimeUtils.nowMillis}");
19+
FirebaseAuth.instance.userChanges().listen((User user) {
20+
if (user == null) {
21+
print('NO USER @ ${TimeUtils.nowMillis}');
22+
} else {
23+
print('YES USER! ${TimeUtils.nowMillis}');
24+
}
25+
});
26+
27+
// try {
28+
// UserCredential userCredential =
29+
// await FirebaseAuth.instance.signInWithEmailAndPassword(email: "[email protected]", password: "password");
30+
// } on FirebaseAuthException catch (e) {
31+
// if (e.code == 'user-not-found') {
32+
// print('No user found for that email.');
33+
// } else if (e.code == 'wrong-password') {
34+
// print('Wrong password provided for that user.');
35+
// }
36+
// }
37+
}
38+
39+
@override
40+
Widget build(BuildContext context) {
41+
return Center(
42+
child: Column(
43+
mainAxisSize: MainAxisSize.min,
44+
children: [],
45+
),
46+
);
47+
}
48+
}

lib/_utils/context_utils.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ class ContextUtils {
44
// Utility methods to get the size/pos of our render boxes in global & local space
55
static Size getSize(BuildContext c) {
66
try {
7-
return (c.findRenderObject() as RenderBox)?.size ?? Size.zero;
7+
RenderBox rb = c.findRenderObject() as RenderBox;
8+
return rb?.size ?? Size.zero;
89
} catch (e) {
9-
//print(e);
10+
print(e);
1011
}
1112
return Size(1, 1);
1213
}

lib/_utils/safe_print.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:flutter/foundation.dart';
2+
3+
void safePrint(String value) {
4+
if (kReleaseMode) return;
5+
print(value);
6+
}

lib/_utils/string_utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ class StringUtils {
4545

4646
static String titleCaseSingle(String s) => '${s[0].toUpperCase()}${s.substring(1)}';
4747
static String titleCase(String s) => s.split(" ").map(titleCaseSingle).join(" ");
48+
49+
static String defaultOnEmpty(String value, String fallback) => isEmpty(value) ? fallback : value;
4850
}

lib/_widgets/popover/popover_controller.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ class PopOverControllerState extends State<PopOverController> {
4343
bool _handleNotification(Notification n) {
4444
// Close any open popovers
4545
if (n is ClosePopoverNotification) {
46-
/// TODO: Add some ability for a delay, or an await so we can support transition out effects...
47-
/// The Widget that send the notification, can get the Controller via callback.
48-
/// At that point, it could store the controller.content and controller.barrier, and control them.
49-
/// We'd need some way for the dispatcher to tell the Controller to not manage these overlays, and instead leave it to the dispatcher. Otherwise someone else could close them under us.
5046
_closeOverlay();
5147
return true;
5248
}

lib/_widgets/single_emoji_paint.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class _EmojiPainter extends CustomPainter {
2222
@override
2323
void paint(Canvas canvas, Size size) {
2424
// A bunch of hacks to get emojis right on windows and mac
25-
// TODO: Get a font embedded so we can have consistent behavior across devices: https://github.com/flutter/flutter/issues/76322#issuecomment-782505551
2625
double fontScale = UniversalPlatform.isMacOS ? 1.09 : .88;
2726
double offsetX = UniversalPlatform.isMacOS ? -.04 : -.1;
2827
double offsetY = UniversalPlatform.isMacOS ? -.04 : 0;

lib/commands/app/authenticate_user_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class AuthenticateUserCommand extends BaseAppCommand {
1717
firebase.userId = email;
1818
await firebase.addUser(user);
1919
}
20-
print("Authentication complete, user=$user");
20+
safePrint("Authentication complete, user=$user");
2121
} on Exception catch (e) {
22-
print(e.toString());
22+
safePrint(e.toString());
2323
}
2424
//}
2525
// Login??

0 commit comments

Comments
 (0)