Skip to content

Commit

Permalink
Merge branch 'development' into feat/badge-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Apr 1, 2023
2 parents 14d984e + db8283d commit f7df4ee
Show file tree
Hide file tree
Showing 18 changed files with 188 additions and 117 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ jobs:
- name: Build iOS app
env:
IOS_GOOGLESERVICE_INFO_PLIST: ${{ github.ref == 'refs/heads/master' && secrets.IOS_GOOGLESERVICE_INFO_PLIST || secrets.IOS_GOOGLESERVICE_INFO_PLIST_DEV }}
IOS_GOOGLESERVICE_INFO_PLIST: ${{ secrets.IOS_GOOGLESERVICE_INFO_PLIST }}
run: |
echo ${{ secrets.ENV }} | base64 -d > .env
echo $IOS_GOOGLESERVICE_INFO_PLIST | base64 --decode > ios/Runner/GoogleService-Info.plist
flutter build ipa --release --export-options-plist=ExportOptions.plist --build-number $GITHUB_RUN_NUMBER --no-tree-shake-icons
cp release_notes.txt build/ios/ipa/
Expand Down
Binary file modified assets/fonts/icons/CollactionIcons.ttf
Binary file not shown.
14 changes: 14 additions & 0 deletions assets/fonts/icons/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,20 @@
"search": [
"heart-sm"
]
},
{
"uid": "6555d0250a6170b636ae88f62a3bf3a4",
"css": "logo",
"code": 59491,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M42.8 785.8L419.3 998.5 417.2 777.7C416.8 734.2 393.3 694.3 355.6 672.8H355.6C317.6 651.1 270.9 651.5 233.2 673.7L42.8 785.8ZM867.6 783.9L493 1000 493.1 779.2C493.1 735.8 516.2 695.6 553.8 673.7H553.8C591.6 651.7 638.3 651.6 676.2 673.5L867.6 783.9ZM0.7 720.3L0 287.9 191.4 398C229 419.6 252.4 459.7 252.6 503.1H252.6C252.8 546.9 229.6 587.4 191.8 609.4L0.7 720.3ZM870.1 214.2L493.5 1.5 495.6 222.3C496 265.8 519.5 305.7 557.2 327.2H557.2C595.2 348.9 641.9 348.5 679.6 326.3L870.1 214.2ZM45.2 216.1L419.8 0 419.7 220.8C419.7 264.2 396.6 304.4 359 326.3H359C321.2 348.3 274.5 348.4 236.6 326.5L45.2 216.1Z",
"width": 870
},
"search": [
"logo"
]
}
]
}
16 changes: 8 additions & 8 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ PODS:
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreExtension (10.6.0):
- FirebaseCoreExtension (10.7.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.6.0):
- FirebaseCoreInternal (10.7.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseCrashlytics (10.6.0):
- FirebaseCore (~> 10.5)
Expand All @@ -41,12 +41,12 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (~> 2.1)
- FirebaseInstallations (10.6.0):
- FirebaseInstallations (10.7.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseSessions (10.6.0):
- FirebaseSessions (10.7.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
Expand Down Expand Up @@ -198,11 +198,11 @@ SPEC CHECKSUMS:
firebase_crashlytics: 5f6296621a0e8ed7d15a7499c8131fbdcf176e3b
FirebaseAuth: 743e5cd568af59d6d99a91ea9300843672515cf7
FirebaseCore: fa80ad16a62d52f67274b5b88304c3a318bbf9a4
FirebaseCoreExtension: 318e5ee9ad4092b00423c2bddd51c3f5c3585973
FirebaseCoreInternal: c7cd505e2136811096b225ac388d6254a2622362
FirebaseCoreExtension: f17247ba8c61e4d3c8d136b5e2de3cb4ac6a85b6
FirebaseCoreInternal: 8845798510aae74703467480f71ac613788d0696
FirebaseCrashlytics: ede07e7f433a0a2270112baf2d156b111cfb422d
FirebaseInstallations: 13dde135fa0524e15bddb133ccc8465c53a1b3f3
FirebaseSessions: 60e877d5159eb571a3d82df68947a7941b475a20
FirebaseInstallations: 59c0e4c7a816a0f76710d83f77e5369b3e45eb96
FirebaseSessions: 34e5c084da010ef3802cbc062b822e513c9e6318
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleDataTransport: ea169759df570f4e37bdee1623ec32a7e64e67c4
Expand Down
3 changes: 1 addition & 2 deletions lib/infrastructure/crowdaction/crowdaction_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ class CommitmentDto with _$CommitmentDto {
const CommitmentDto._();

factory CommitmentDto({
// ignore: invalid_annotation_target
@JsonKey(name: '_id') required String id,
required String id,
required String label,
required int points,
required List<String> blocks,
Expand Down
1 change: 1 addition & 0 deletions lib/presentation/core/collaction_icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ class CollactionIcons {
static const IconData trash = IconData(0xe832, fontFamily: _kFontFam);
static const IconData heart_filled = IconData(0xe833, fontFamily: _kFontFam);
static const IconData heart = IconData(0xe834, fontFamily: _kFontFam);
static const IconData logo = IconData(0xe863, fontFamily: _kFontFam);
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CrowdActionDetailsBanner extends StatelessWidget {
right: 10,
child: Row(
children: [
if (crowdAction?.hasPassword ?? false)
if (crowdAction?.hasPassword ?? false) ...[
CustomFAB(
heroTag: 'locked',
isMini: true,
Expand All @@ -89,11 +89,17 @@ class CrowdActionDetailsBanner extends StatelessWidget {
color: kPrimaryColor300,
),
),
if (crowdAction?.location != null)
],
if ((crowdAction?.hasPassword ?? false) &&
(crowdAction?.location != null)) ...[
const SizedBox(width: 6),
],
if (crowdAction?.location != null) ...[
CountryIcon(
countryCode: crowdAction?.location.code ?? 'nl',
radius: 20,
)
),
],
],
)),
],
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 @@ -32,7 +32,7 @@ class HomePage extends StatelessWidget {
elevation: 0,
items: const [
BottomNavigationBarItem(
icon: Icon(CollactionIcons.collaction),
icon: Icon(CollactionIcons.logo),
label: '',
),
BottomNavigationBarItem(
Expand Down
48 changes: 23 additions & 25 deletions lib/presentation/home/widgets/password_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ class PasswordModal extends StatefulWidget {

@override
State<PasswordModal> createState() => _PasswordModalState();

static Future<void> show(
BuildContext context,
CrowdAction crowdAction,
) async {
final settingsRepository = getIt<ISettingsRepository>();
final accessList = await settingsRepository.getCrowdActionAccessList();

if (accessList.contains(crowdAction.id)) {
context.router.push(
CrowdActionDetailsRoute(crowdAction: crowdAction),
);
} else {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
constraints: const BoxConstraints(maxHeight: 350),
builder: (context) => PasswordModal(crowdAction: crowdAction),
);
}
}
}

class _PasswordModalState extends State<PasswordModal> {
Expand Down Expand Up @@ -92,9 +114,7 @@ class _PasswordModalState extends State<PasswordModal> {
borderRadius: BorderRadius.circular(20.0),
borderSide: const BorderSide(width: 2, color: Colors.red),
),
errorText: _validated != null && _validated == false
? "Invalid password"
: null,
errorText: _validated == false ? "Invalid password" : null,
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
borderSide: const BorderSide(width: 2, color: Colors.red),
Expand Down Expand Up @@ -170,25 +190,3 @@ class _PasswordModalState extends State<PasswordModal> {
super.dispose();
}
}

Future<void> showPasswordModal(
BuildContext context,
CrowdAction crowdAction,
) async {
final settingsRepository = getIt<ISettingsRepository>();
final accessList = await settingsRepository.getCrowdActionAccessList();

if (accessList.contains(crowdAction.id)) {
context.router.push(
CrowdActionDetailsRoute(crowdAction: crowdAction),
);
} else {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
constraints: const BoxConstraints(maxHeight: 350),
builder: (context) => PasswordModal(crowdAction: crowdAction),
);
}
}
2 changes: 1 addition & 1 deletion lib/presentation/profile/widget/commitments_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CommitmentsTab extends StatelessWidget {
),
const SizedBox(height: 20),
...crowdActions!
.where((crowdAction) => crowdAction.isRunning)
.where((crowdAction) => !crowdAction.isClosed)
.map(
(crowdAction) => GestureDetector(
onTap: () => context.router.push(
Expand Down
13 changes: 9 additions & 4 deletions lib/presentation/shared_widgets/crowdaction_card.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:auto_route/auto_route.dart';
import 'package:cached_network_image/cached_network_image.dart';

// ignore: depend_on_referenced_packages
import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -45,7 +46,7 @@ class _CrowdActionCardState extends State<CrowdActionCard>
onTap: widget.onTap ??
() {
if (widget.crowdAction.hasPassword) {
showPasswordModal(context, widget.crowdAction);
PasswordModal.show(context, widget.crowdAction);
} else {
context.router.push(
CrowdActionDetailsRoute(crowdAction: widget.crowdAction),
Expand Down Expand Up @@ -92,10 +93,14 @@ class _CrowdActionCardState extends State<CrowdActionCard>
CollactionIcons.lock,
color: kPrimaryColor300,
),
elevation: 0,
),
Padding(
padding: const EdgeInsets.only(top: 3.0),
child: CountryIcon(
countryCode: widget.crowdAction.location.code,
radius: 20,
),
CountryIcon(
countryCode: widget.crowdAction.location.code,
radius: 20,
)
]),
)
Expand Down
18 changes: 10 additions & 8 deletions lib/presentation/shared_widgets/custom_fab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ class CustomFAB extends StatelessWidget {
final String? heroTag;
final GestureTapCallback? onPressed;
final Color? color;
final double? elevation;

const CustomFAB({
super.key,
required this.child,
this.isMini = false,
this.heroTag = "fabBtn",
this.onPressed,
this.color,
});
const CustomFAB(
{super.key,
required this.child,
this.isMini = false,
this.heroTag = "fabBtn",
this.onPressed,
this.color,
this.elevation});

@override
Widget build(BuildContext context) {
Expand All @@ -27,6 +28,7 @@ class CustomFAB extends StatelessWidget {
color ?? (onPressed != null ? kAccentColor : kDisabledButtonColor),
mini: isMini,
child: child,
elevation: elevation ?? 6,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MicroCrowdActionCard extends StatelessWidget {
borderRadius: BorderRadius.circular(20),
onTap: () {
if (crowdAction.hasPassword) {
showPasswordModal(context, crowdAction);
PasswordModal.show(context, crowdAction);
} else {
context.router.push(
CrowdActionDetailsRoute(
Expand Down
Loading

0 comments on commit f7df4ee

Please sign in to comment.