Skip to content

Commit

Permalink
fix OWASP-BLT#48 OWASP-BLT#121 and more app issues
Browse files Browse the repository at this point in the history
  • Loading branch information
justary27 committed Aug 19, 2022
1 parent 49e76e1 commit eeeb593
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 177 deletions.
44 changes: 26 additions & 18 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,35 @@ class BugHeistState extends State<BugHeist> {
@override
Widget build(BuildContext context) {
return ProviderScope(
child: MaterialApp(
scaffoldMessengerKey: _messangerKey,
debugShowCheckedModeBanner: false,
onGenerateRoute: RouteManager.generateRoute,
title: 'BugHeist',
theme: ThemeData(
primarySwatch: Colors.red,
primaryColor: Colors.white,
visualDensity: VisualDensity.adaptivePlatformDensity,
primaryTextTheme: TextTheme(
headline1: TextStyle(
fontSize: 72.0,
fontWeight: FontWeight.bold,
color: Colors.black),
headline6: TextStyle(color: Colors.black),
button: TextStyle(
color: Colors.black,
child: GestureDetector(
onTap: () {
FocusScopeNode currentScope = FocusScope.of(context);
if (!currentScope.hasPrimaryFocus && currentScope.hasFocus) {
FocusManager.instance.primaryFocus!.unfocus();
}
},
child: MaterialApp(
scaffoldMessengerKey: _messangerKey,
debugShowCheckedModeBanner: false,
onGenerateRoute: RouteManager.generateRoute,
title: 'BugHeist',
theme: ThemeData(
primarySwatch: Colors.red,
primaryColor: Colors.white,
visualDensity: VisualDensity.adaptivePlatformDensity,
primaryTextTheme: TextTheme(
headline1: TextStyle(
fontSize: 72.0,
fontWeight: FontWeight.bold,
color: Colors.black),
headline6: TextStyle(color: Colors.black),
button: TextStyle(
color: Colors.black,
),
),
),
home: WelcomePage(),
),
home: WelcomePage(),
),
);
}
Expand Down
9 changes: 3 additions & 6 deletions lib/components/issue_intro_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ class IssueCard extends StatelessWidget {
Container(
width: size.width,
height: 0.2 * size.height,
child: InteractiveViewer(
minScale: 0.05,
child: Image.network(
issue.screenshotLink!,
fit: BoxFit.cover,
),
child: Image.network(
issue.screenshotLink!,
fit: BoxFit.fill,
),
),
Container(
Expand Down
1 change: 1 addition & 0 deletions lib/models/issue_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Issue {
});

factory Issue.fromJson(Map<String, dynamic> responseData) {
print(responseData["user"]);
return Issue(
id: responseData["id"],
user: (responseData["user"] != null)
Expand Down
8 changes: 8 additions & 0 deletions lib/models/post_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class SocialPosts {
final String author;
final userHandle;
final DateTime createdAt;
final String description;

SocialPosts(this.author, this.userHandle, this.createdAt, this.description);
}
26 changes: 0 additions & 26 deletions lib/pages/feed.dart

This file was deleted.

129 changes: 129 additions & 0 deletions lib/pages/home/feed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import 'package:bugheist/global/variables.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
// import '../../providers/issuelist_provider.dart';

class Feed extends ConsumerStatefulWidget {
const Feed({Key? key}) : super(key: key);

@override
_FeedState createState() => _FeedState();
}

class _FeedState extends ConsumerState<Feed> {
@override
Widget build(BuildContext context) {
// final Size size = MediaQuery.of(context).size;
// final issueState = ref.watch(issueListProvider);

return Scaffold(
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FittedBox(
child: Text(
'Goood Afternoon, \n${currentUser!.username}',
style: GoogleFonts.ubuntu(
textStyle: TextStyle(
color: Color(0xFFDC4654),
fontSize: 30,
),
),
),
),
SizedBox(
height: 10,
),
Text(
"Check the latest happenings in the world of BugHeist!",
style: GoogleFonts.aBeeZee(
textStyle: TextStyle(
color: Color(0xFF737373),
),
),
),
SizedBox(
height: 10,
),
Text(
"Latest Issues",
style: GoogleFonts.ubuntu(
textStyle: TextStyle(
color: Color(0xFFDC4654),
fontSize: 20,
),
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10,
),
// Container(
// height: 0.4 * size.height,
// child: issueState!.when(
// data: (List<Issue>? issueList) {
// if (issueList!.isEmpty) {
// return Center(
// child: Text(
// "Looks like you don't have any todos :) \n Yay!",
// textAlign: TextAlign.center,
// ),
// );
// } else {
// return ListView.builder(
// scrollDirection: Axis.horizontal,
// itemCount: issueList.length,
// itemBuilder: (context, index) {
// return IssueCard(
// issue: issueList[index],
// );
// },
// );
// }
// },
// error: (Object error, StackTrace? stackTrace) {
// return Center(
// child: Text(
// 'Something went wrong!',
// style: TextStyle(fontSize: 18),
// ),
// );
// },
// loading: () {
// return Center(
// child: CircularProgressIndicator(),
// );
// },
// ),
// ),
Text(
"Bug Socials!",
style: GoogleFonts.ubuntu(
textStyle: TextStyle(
color: Color(0xFFDC4654),
fontSize: 20,
),
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10,
),
Text(
"Our Sponsors",
style: GoogleFonts.ubuntu(
textStyle: TextStyle(
color: Color(0xFFDC4654),
fontSize: 20,
),
fontWeight: FontWeight.bold,
),
),
],
),
));
}
}
4 changes: 2 additions & 2 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bugheist/global/variables.dart';
// import 'package:bugheist/pages/feed.dart';
// import 'package:bugheist/pages/home/feed.dart';
import 'package:bugheist/pages/home/issues.dart';
import 'package:bugheist/pages/home/leaderboard.dart';
import 'package:bugheist/pages/home/report_bug.dart';
Expand Down Expand Up @@ -27,7 +27,7 @@ class _HomeState extends ConsumerState<Home> {
late int _selectedIndex;
late PageController _pageController;

final List<Widget> _children = [
final List<ConsumerStatefulWidget> _children = [
// Feed(),
PaginatedClass(),
ReportBug(),
Expand Down
Loading

0 comments on commit eeeb593

Please sign in to comment.