Skip to content

Commit

Permalink
Merge branch 'development' into test/application
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham-gt authored Jun 29, 2022
2 parents 3b75b91 + 1420b0f commit d371019
Show file tree
Hide file tree
Showing 17 changed files with 362 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
workflow_dispatch:

env:
flutter_version: "2.10.x"
flutter_version: "3.0.x"
flutter_channel: "stable"
java_version: "12.x"

Expand Down
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ To generate the OpenSource licenses dart file via [flutter_oss_licenses](https:/

>Note: Run `flutter format .` once [oss_licenses.dart](../lib/presentation/licenses/oss_licenses.dart) is created.
## Running tests and generating Test Report

- Step 1: Just for the 1st time, to make sure that all files are included, run ```./.github/scripts/coverage_gen.sh``` to generate a report for the whole project.
- Step 2: Run ```flutter test --coverage```. This will generate the report locally.
- Step 3: Run ```genhtml coverage/lcov.info -o coverage```.
- Step 4: Run ``` firefox coverage/index.html``` (or run ```coverage/index.html``` to any of your web browser).
#### You should see the coverage of your tests line-wise in Codecov.

## Getting Started with Flutter

A few resources to get you started if this is your first Flutter project:
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/user/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class User with _$User {
@visibleForTesting
// ignore: avoid_positional_boolean_parameters
static Future<String?> getAnonymousIdToken([bool forceRefresh = false]) =>
Future.value(null);
Future.value();

static const User anonymous = User(
id: 'anonymous',
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance?.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
checkAndMaybeShowOnboarding();
});
}
Expand Down
28 changes: 15 additions & 13 deletions lib/presentation/shared_widgets/photo_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,31 @@ class _PhotoSelectorState extends State<PhotoSelector> {

final _compression = 100;
Future<void> _cropImage(XFile image) async {
final File? croppedFile = await ImageCropper.cropImage(
final CroppedFile? croppedFile = await ImageCropper().cropImage(
sourcePath: image.path,
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
aspectRatioPresets: [CropAspectRatioPreset.square],
compressFormat: ImageCompressFormat.png,
maxWidth: 1023,
maxHeight: 1023,
compressQuality: _compression,
androidUiSettings: const AndroidUiSettings(
toolbarTitle: 'Profile Photo',
toolbarColor: kAccentColor,
toolbarWidgetColor: Colors.white,
lockAspectRatio: true,
),
iosUiSettings: const IOSUiSettings(
minimumAspectRatio: 1.0,
aspectRatioLockEnabled: true,
title: 'Profile Photo',
),
uiSettings: [
AndroidUiSettings(
toolbarTitle: 'Profile Photo',
toolbarColor: kAccentColor,
toolbarWidgetColor: Colors.white,
lockAspectRatio: true,
),
IOSUiSettings(
minimumAspectRatio: 1.0,
aspectRatioLockEnabled: true,
title: 'Profile Photo',
),
],
);

if (widget.onSelected != null && croppedFile != null) {
widget.onSelected!(croppedFile);
widget.onSelected!(File(croppedFile.path));
}
}

Expand Down
Loading

0 comments on commit d371019

Please sign in to comment.