Skip to content

Commit

Permalink
fix: Replaced depreciated members, and update Featured events card (#211
Browse files Browse the repository at this point in the history
)

* fix: replace depreciated members with dart-fix

* update featured_event card (HackNITR 5.0)

* Update HackNITR Date

---------

Co-authored-by: Peeyush Das <peeyushdas@pop-os.localdomain>
  • Loading branch information
PeeyushDas and Peeyush Das authored Oct 26, 2023
1 parent 7c3c68d commit a726312
Show file tree
Hide file tree
Showing 50 changed files with 421 additions and 411 deletions.
2 changes: 1 addition & 1 deletion elaichi/lib/data/remote/graphql/graphql_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class GraphQLService {
variables: {
//change this to 0, 1 to get latest org after PR merge in backend
'pagination': {'skip': 0, 'take': 1},
'orgType': 'FEST'
'orgType': 'FEST',
},
);

Expand Down
2 changes: 1 addition & 1 deletion elaichi/lib/domain/repositories/events_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class EventRepository {
.add(element);
} else {
map['${element.startDate.day} ${format.format(element.startDate)}'] = [
element
element,
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion elaichi/lib/domain/repositories/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class UserRepository {
}

Future<void> getOrCreateUser(
{required String rollNumber, required String mobileNumber}) async {
{required String rollNumber, required String mobileNumber,}) async {
try {
if (user == null) {
final fbUser = _firebaseAuth.currentUser;
Expand Down
17 changes: 8 additions & 9 deletions elaichi/lib/presentation/browse/browse_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import 'package:elaichi/domain/models/event/event.dart';
import 'package:elaichi/presentation/components/custom_app_bar.dart';
import 'package:elaichi/presentation/core/theme/base_theme.dart';
import 'package:elaichi/presentation/core/theme/colors.dart';
import 'package:elaichi/presentation/core/utils/strings.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

///The Browse Page
class BrowsePage extends StatelessWidget {
/// Default constructor
const BrowsePage({Key? key}) : super(key: key);
const BrowsePage({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -32,9 +31,9 @@ class BrowsePage extends StatelessWidget {

class EventCard extends StatelessWidget {
const EventCard({
Key? key,
super.key,
required this.event,
}) : super(key: key);
});

final Event event;
@override
Expand Down Expand Up @@ -70,7 +69,7 @@ class EventCard extends StatelessWidget {
children: [
Text(
jsonDecode(event.name)['subHeading'].toString(),
style: interTextTheme.bodyText2!.copyWith(
style: interTextTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w700,
color: AppColors.grey3,
fontSize: 10,
Expand All @@ -80,7 +79,7 @@ class EventCard extends StatelessWidget {
const SizedBox(height: 6),
Text(
jsonDecode(event.name)['heading'].toString(),
style: interTextTheme.bodyText2!.copyWith(
style: interTextTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w700,
color: AppColors.grey2,
fontSize: 18,
Expand All @@ -91,7 +90,7 @@ class EventCard extends StatelessWidget {
const SizedBox(height: 2),
Text(
'${format.format(event.startDate)} • ',
style: interTextTheme.caption!.copyWith(
style: interTextTheme.bodySmall!.copyWith(
color: AppColors.grey2.withOpacity(0.6),
letterSpacing: 0.05,
fontWeight: FontWeight.w500,
Expand All @@ -106,7 +105,7 @@ class EventCard extends StatelessWidget {
maxLines: 2,
overflow: TextOverflow.ellipsis,
softWrap: true,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: AppColors.grey2,
letterSpacing: 0.05,
fontSize: 12,
Expand All @@ -115,7 +114,7 @@ class EventCard extends StatelessWidget {
),
],
),
)
),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class CustomBottomSheet extends StatelessWidget {
required this.body,
required this.footer,
this.description,
Key? key,
}) : super(key: key);
super.key,
});
final Widget? icon;
final String title;
final String? description;
Expand All @@ -29,7 +29,7 @@ class CustomBottomSheet extends StatelessWidget {
),
),
child: ListView(
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
children: <Widget>[
Padding(
Expand All @@ -51,15 +51,15 @@ class CustomBottomSheet extends StatelessWidget {
Text(
title,
style:
Theme.of(context).textTheme.headline6!.copyWith(
Theme.of(context).textTheme.titleLarge!.copyWith(
fontWeight: FontWeight.w700,
color: AppColors.grey2,
),
),
if (description != null)
Text(
description!,
style: Theme.of(context).textTheme.bodyText2,
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
Expand Down
6 changes: 3 additions & 3 deletions elaichi/lib/presentation/components/buttons/back_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:flutter/material.dart';

class CustomBackButton extends StatelessWidget {
const CustomBackButton({
Key? key,
}) : super(key: key);
super.key,
});

@override
Widget build(BuildContext context) {
Expand All @@ -29,7 +29,7 @@ class CustomBackButton extends StatelessWidget {
const SizedBox(width: 5),
Text(
'Back',
style: interTextTheme.subtitle2!.copyWith(
style: interTextTheme.titleSmall!.copyWith(
color: Colors.white,
fontSize: 15,
height: 1.33,
Expand Down
6 changes: 3 additions & 3 deletions elaichi/lib/presentation/components/buttons/blue_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class BlueButton extends StatelessWidget {
required this.onTapped,
this.leadingIcon,
this.trailingIcon,
Key? key,
}) : super(key: key);
super.key,
});

/// Icon at the starting of button
final Widget? leadingIcon;
Expand Down Expand Up @@ -51,7 +51,7 @@ class BlueButton extends StatelessWidget {
),
Text(
text,
style: Theme.of(context).textTheme.button!.copyWith(
style: Theme.of(context).textTheme.labelLarge!.copyWith(
fontWeight: FontWeight.w600,
fontSize: 16,
letterSpacing: 0.5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class CustomButton extends StatelessWidget {
required this.text,
required this.onTapped,
this.icon,
Key? key,
}) : super(key: key);
super.key,
});

/// Icon at the starting of button
final Widget? icon;
Expand Down Expand Up @@ -48,7 +48,7 @@ class CustomButton extends StatelessWidget {
Text(
text,
style: textStyle ??
Theme.of(context).textTheme.button!.copyWith(
Theme.of(context).textTheme.labelLarge!.copyWith(
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 0.5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class TransparentButton extends StatelessWidget {
required this.text,
required this.onTapped,
this.icon,
Key? key,
}) : super(key: key);
super.key,
});

/// Icon at the starting of button
final Widget? icon;
Expand Down Expand Up @@ -52,7 +52,7 @@ class TransparentButton extends StatelessWidget {
Text(
text,
style: textStyle ??
Theme.of(context).textTheme.button!.copyWith(
Theme.of(context).textTheme.labelLarge!.copyWith(
fontSize: 16,
letterSpacing: 0.5,
),
Expand Down
14 changes: 7 additions & 7 deletions elaichi/lib/presentation/components/buttons/yellow_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import 'package:flutter/material.dart';

class YellowFlatButton extends StatelessWidget {
const YellowFlatButton({
Key? key,
super.key,
required this.text,
required this.onTapped,
this.width = 338,
}) : super(key: key);
});

final String text;

Expand All @@ -28,7 +28,7 @@ class YellowFlatButton extends StatelessWidget {
child: Center(
child: Text(
text,
style: interTextTheme.subtitle2!.copyWith(
style: interTextTheme.titleSmall!.copyWith(
fontSize: 15,
height: 1.33,
color: Colors.black,
Expand All @@ -43,11 +43,11 @@ class YellowFlatButton extends StatelessWidget {

class YellowTextButton extends StatelessWidget {
const YellowTextButton({
Key? key,
super.key,
this.mainAxisAlignment = MainAxisAlignment.start,
required this.onPressed,
required this.text,
}) : super(key: key);
});

final MainAxisAlignment mainAxisAlignment;
final Function onPressed;
Expand All @@ -62,7 +62,7 @@ class YellowTextButton extends StatelessWidget {
children: [
Text(
text,
style: interTextTheme.subtitle1!.copyWith(
style: interTextTheme.titleMedium!.copyWith(
letterSpacing: -0.5,
fontSize: 15,
color: AppColors.yellowButton,
Expand All @@ -72,7 +72,7 @@ class YellowTextButton extends StatelessWidget {
const Icon(
Icons.arrow_forward,
color: AppColors.yellowButton,
)
),
],
),
);
Expand Down
6 changes: 3 additions & 3 deletions elaichi/lib/presentation/components/custom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import 'package:flutter/material.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
/// Constrcutor for CustomAppBar.
const CustomAppBar({
Key? key,
super.key,
required this.title,
this.leftTap,
this.rightTap,
this.leftButton,
this.rightButton,
}) : super(key: key);
});

/// Title of the AppBar
final String title;
Expand All @@ -36,7 +36,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
title,
style: Theme.of(context)
.textTheme
.headline6!
.titleLarge!
.copyWith(fontWeight: FontWeight.w700),
),
elevation: 1,
Expand Down
16 changes: 8 additions & 8 deletions elaichi/lib/presentation/components/custom_cards/devCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class DevCard extends StatelessWidget {
const DevCard({super.key, required this.width, required this.name, required this.link, required this.role, required this.photo});
final double width;
final String name;
final String link;
final String photo;
final String role;
const DevCard({Key? key, required this.width, required this.name, required this.link, required this.role, required this.photo}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -27,7 +27,7 @@ class DevCard extends StatelessWidget {
},
child: Container(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 10),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
child: Row(
children: [
Stack(
Expand All @@ -37,7 +37,7 @@ class DevCard extends StatelessWidget {
height: width*0.19,
width: width*0.19,
decoration: BoxDecoration(
color: Color(0xFF444444),
color: const Color(0xFF444444),
borderRadius: BorderRadius.circular(width*0.095),
),
),
Expand All @@ -57,27 +57,27 @@ class DevCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
SizedBox(
width: width*0.55,
child: AutoSizeText(
name,
style: GoogleFonts.inter(
fontSize: width*0.05,
fontWeight: FontWeight.w600,
color: Color(0xFF202020),
color: const Color(0xFF202020),
),
maxLines: 1,
),
),
SizedBox(height: 2),
Container(
const SizedBox(height: 2),
SizedBox(
width: width*0.55,
child: AutoSizeText(
role,
style: GoogleFonts.inter(
fontSize: width*0.038,
fontWeight: FontWeight.w500,
color: Color(0xFF555555),
color: const Color(0xFF555555),
),
maxLines: 1,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:flutter/material.dart';

class CustomCarousel extends StatefulWidget {
const CustomCarousel({
Key? key,
super.key,
required this.itemBuilder,
required this.itemCount,
required this.pageController,
required this.width,
required this.height,
}) : super(key: key);
});

final Widget Function(BuildContext context, int selectedIndex) itemBuilder;

Expand Down
Loading

0 comments on commit a726312

Please sign in to comment.