Skip to content

Commit

Permalink
Working on search page
Browse files Browse the repository at this point in the history
  • Loading branch information
p8gonzal committed Dec 3, 2021
1 parent 790e792 commit 23ba8e4
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 173 deletions.
9 changes: 9 additions & 0 deletions lib/backend/student_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class StudentProfile{
static Map<String, List> termMap;

StudentProfile(){
termMap = new Map();
termMap.putIfAbsent("FA19", )
}
)
}
2 changes: 2 additions & 0 deletions lib/ui/calendar/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:webreg_mobile_flutter/app_constants.dart';
import 'package:webreg_mobile_flutter/app_styles.dart';
import 'package:webreg_mobile_flutter/ui/calendar/calendar_card.dart';
import 'package:webreg_mobile_flutter/ui/common/build_info.dart';
import 'package:webreg_mobile_flutter/ui/search/search_bar.dart';

class Calendar extends StatelessWidget {
Calendar(this.color);
Expand Down Expand Up @@ -108,6 +109,7 @@ class Calendar extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 10),
child: Column(
children: <Widget>[
TermDropdown(),
// calendar header
Container(
height: CalendarStyles.calendarHeaderHeight,
Expand Down
48 changes: 48 additions & 0 deletions lib/ui/common/term_dropdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class TermDropdown extends StatefulWidget {
@override
_TermDropdownState createState() => _TermDropdownState();
}

// TODO
class _TermDropdownState extends State<TermDropdown> {
List<String> dropdownItems = ['Fall 19', 'Winter 20', 'Spring 20', 'Fall 20'];
String _dropdownVal = 'Fall 19';

@override
Widget build(BuildContext context) {
return Container(
height: 40,
margin: EdgeInsets.only(top: 10),
padding: EdgeInsets.symmetric(horizontal: 60),
child: Stack(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.alarm, color: Colors.black),
]
),
Center(
child: Text(_dropdownVal, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold))
),
DropdownButton<String>(
isExpanded: true,
underline: Container(height: 0),
icon: Icon(Icons.expand_more, color: Colors.black, size: 30),
onChanged: (String newVal) {
setState(() {
_dropdownVal = newVal;
});
},
items: dropdownItems.map<DropdownMenuItem<String>>((String val) {
return DropdownMenuItem<String>(
value: val,
child: Center(child: Text(val, style: TextStyle(fontSize: 18)))
);
}).toList(),
)
]
)
);
}
}
81 changes: 14 additions & 67 deletions lib/ui/list/course_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,25 @@ import 'package:webreg_mobile_flutter/ui/list/course_card.dart';
import 'package:webreg_mobile_flutter/ui/calendar/calendar.dart';
import 'package:webreg_mobile_flutter/app_constants.dart';
import 'package:webreg_mobile_flutter/app_styles.dart';
import 'package:webreg_mobile_flutter/ui/search/search_bar.dart';

class CourseListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
TermDropdown(),
Expanded(
child: Container(
child: ListView.builder(
itemCount: 10,
padding: EdgeInsets.symmetric(vertical: 8),
itemBuilder: (BuildContext context, int index) {
return Container(
child: CourseCard(),
);
}
),
)
)
]
)
);
}
}

class TermDropdown extends StatefulWidget {
@override
_TermDropdownState createState() => _TermDropdownState();
}

// TODO
class _TermDropdownState extends State<TermDropdown> {
List<String> dropdownItems = ['Fall 19', 'Winter 20', 'Spring 20', 'Fall 20'];
String _dropdownVal = 'Fall 19';

@override
Widget build(BuildContext context) {
return Container(
height: 40,
margin: EdgeInsets.only(top: 10),
padding: EdgeInsets.symmetric(horizontal: 60),
child: Stack(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.alarm, color: Colors.black),
]
),
Center(
child: Text(_dropdownVal, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold))
),
DropdownButton<String>(
isExpanded: true,
underline: Container(height: 0),
icon: Icon(Icons.expand_more, color: Colors.black, size: 30),
onChanged: (String newVal) {
setState(() {
_dropdownVal = newVal;
});
},
items: dropdownItems.map<DropdownMenuItem<String>>((String val) {
return DropdownMenuItem<String>(
value: val,
child: Center(child: Text(val, style: TextStyle(fontSize: 18)))
child: Column(children: <Widget>[
TermDropdown(),
Expanded(
child: Container(
child: ListView.builder(
itemCount: 10,
padding: EdgeInsets.symmetric(vertical: 8),
itemBuilder: (BuildContext context, int index) {
return Container(
child: CourseCard(),
);
}).toList(),
)
]
)
);
}),
))
]));
}
}
Loading

0 comments on commit 23ba8e4

Please sign in to comment.