Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a clean UI page for Open Summer of Code #218

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/open_summer_of_code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
14 changes: 12 additions & 2 deletions lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:opso/programs%20screen/google_season_of_docs_screen.dart';
import 'package:opso/programs%20screen/google_summer_of_code_screen.dart';
import 'package:opso/programs%20screen/linux_foundation.dart';
import 'package:opso/programs%20screen/major_league_hacking_fellowship.dart';
import 'package:opso/programs%20screen/open_summer_of_code.dart';
import 'package:opso/programs%20screen/outreachy.dart';
import 'package:opso/programs%20screen/summer_of_bitcoin.dart';
import 'package:opso/programs%20screen/social_winter_of_code.dart';
Expand Down Expand Up @@ -98,6 +99,10 @@ class _HomePageState extends State<HomePage> {
title: 'Social Winter of Code',
imageAssetPath: 'assets/swoc.png',
),
Program(
title: 'Open Summer of Code',
imageAssetPath: 'assets/open_summer_of_code.png',
),
];

@override
Expand Down Expand Up @@ -356,17 +361,18 @@ class _HomePageState extends State<HomePage> {
case 'Summer of Bitcoin':
Navigator.pushNamed(context, "/summer_of_bitcoin");

case 'Summer of Bitcoin':
case 'Open Summer of Code':
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SummerOfBitcoin(),
builder: (context) => const OpenSummerOfCode(),
),
);

case 'Linux Foundation':
Navigator.push(context,
MaterialPageRoute(builder: (context) => const LinuxFoundation()));

default:
break;
}
Expand Down Expand Up @@ -465,6 +471,10 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
title: 'Social Winter of Code',
imageAssetPath: 'assets/swoc.png',
),
Program(
title: 'Open Summer of Code',
imageAssetPath: 'assets/open_summer_of_code.png',
),
];

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:opso/programs%20screen/google_season_of_docs_screen.dart';
import 'package:opso/programs%20screen/google_summer_of_code_screen.dart';
import 'package:opso/programs%20screen/linux_foundation.dart';
import 'package:opso/programs%20screen/major_league_hacking_fellowship.dart';
import 'package:opso/programs%20screen/open_summer_of_code.dart';
import 'package:opso/programs%20screen/outreachy.dart';
import 'package:opso/programs%20screen/summer_of_bitcoin.dart';
import 'package:opso/programs%20screen/social_winter_of_code.dart';
Expand Down Expand Up @@ -45,6 +46,7 @@ class OpSoApp extends StatelessWidget {
"/google_season_of_docs": (context) =>
GoogleSeasonOfDocsScreen(),
"/summer_of_bitcoin": (context) => const SummerOfBitcoin(),
"/open_summer_of_code": (context) => const OpenSummerOfCode(),
"/outreachy": (context) => const OutReachy(),
"/major_league_hacking_fellowship": (context) =>
const MajorLeagueHackingFellowship(),
Expand Down
83 changes: 83 additions & 0 deletions lib/modals/osoc_modal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first, non_constant_identifier_names
import 'dart:convert';

class OsocModal {
String name = "";
String image_url = "";
String description = "";
String project_url = "";
int year = 0;
OsocModal({
required this.name,
required this.image_url,
required this.description,
required this.project_url,
required this.year,
});

OsocModal copyWith({
String? name,
String? image_url,
String? description,
String? project_url,
int? year,
}) {
return OsocModal(
name: name ?? this.name,
image_url: image_url ?? this.image_url,
description: description ?? this.description,
project_url: project_url ?? this.project_url,
year: year ?? this.year,
);
}

Map<String, dynamic> toMap() {
return <String, dynamic>{
'name': name,
'image_url': image_url,
'description': description,
'project_url': project_url,
'year': year,
};
}

factory OsocModal.fromMap(Map<String, dynamic> map) {
return OsocModal(
name: map['name'] as String,
image_url: map['image_url'] as String,
description: map['description'] as String,
project_url: map['project_url'] as String,
year: map['year'] as int,
);
}

String toJson() => json.encode(toMap());

factory OsocModal.fromJson(String source) =>
OsocModal.fromMap(json.decode(source) as Map<String, dynamic>);

@override
String toString() {
return 'OsocModal(name: $name, image_url: $image_url, description: $description, project_url: $project_url, year: $year)';
}

@override
bool operator ==(covariant OsocModal other) {
if (identical(this, other)) return true;

return other.name == name &&
other.image_url == image_url &&
other.description == description &&
other.project_url == project_url &&
other.year == year;
}

@override
int get hashCode {
return name.hashCode ^
image_url.hashCode ^
description.hashCode ^
project_url.hashCode ^
year.hashCode;
}
}
Loading
Loading