Skip to content

Commit

Permalink
Implemented the Companies leaderboard (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uttkarsh-raj committed Jun 5, 2024
1 parent b42f1bc commit b132e9a
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 152 deletions.
3 changes: 3 additions & 0 deletions lib/src/models/company_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Company {
String? facebook;
int? openIssues;
int? closedIssues;
int? issueCount;
final DateTime lastModified;
final String logoLink;
final String topTester;
Expand All @@ -24,6 +25,7 @@ class Company {
this.hexcolor,
this.openIssues,
this.closedIssues,
this.issueCount,
this.lastModified,
this.logoLink,
this.topTester,
Expand Down Expand Up @@ -53,6 +55,7 @@ class Company {
parsedJson["color"] ?? null,
parsedJson["open"] ?? 0,
parsedJson["closed"] ?? 0,
parsedJson["issue_count"] ?? 0,
DateTime.parse(parsedJson["modified"]),
parsedJson["logo"].toString(),
parsedJson["top"] ?? "",
Expand Down
7 changes: 3 additions & 4 deletions lib/src/pages/companies/company_details_and_issues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class CompanyDetailWithIssuesState
onTap: () {
Navigator.pushNamed(
context,
RouteManager.closedIssues,
RouteManager.openIssues,
arguments: company,
);
},
Expand Down Expand Up @@ -356,9 +356,8 @@ class CompanyDetailWithIssuesState
child: InkWell(
onTap: () {
Navigator.pushNamed(
context,
RouteManager.monthlyLeaderboardPage,
);
context, RouteManager.closedIssues,
arguments: company);
},
child: ListView.builder(
padding: EdgeInsets.zero,
Expand Down
21 changes: 20 additions & 1 deletion lib/src/pages/companies/company_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ class CompanyListPageState extends ConsumerState<CompanyListPage>
fontSize: 20,
),
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: GestureDetector(
onTap: () {
Navigator.pushNamed(
context,
RouteManager.companyScoreboardPage,
);
},
child: Icon(
Icons.leaderboard,
size: 23,
color: Colors.white,
),
),
),
],
),
body: RefreshIndicator(
onRefresh: () async {
Expand Down Expand Up @@ -128,7 +146,7 @@ class CompanyListPageState extends ConsumerState<CompanyListPage>
if (companyList!.isEmpty) {
return Center(
child: Text(
"${AppLocalizations.of(context)!.notManyBugs}:) \n ${AppLocalizations.of(context)!.yay}",
"No companies found !!",
textAlign: TextAlign.center,
),
);
Expand Down Expand Up @@ -187,6 +205,7 @@ class CompanyListElement extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
print(company.logoLink);
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
Expand Down
Loading

0 comments on commit b132e9a

Please sign in to comment.