-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/FEUP-ESOF-2020-21/open-cx…
- Loading branch information
Showing
15 changed files
with
332 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:confnect/model/User.dart'; | ||
|
||
class Forum { | ||
final User _author; | ||
final String _title; | ||
final String _description; | ||
Forum(this._author, this._title, this._description); | ||
|
||
User getAuthor() { | ||
return _author; | ||
} | ||
|
||
String getTitle() { | ||
return _title; | ||
} | ||
|
||
String getDescription() { | ||
return _description; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class AppRouter { | ||
static const LOGIN = '/user-login'; | ||
static const WELCOME_SCREEN = '/hello'; | ||
static const REGISTER = '/user-register'; | ||
static const USER_START_PAGE = '/user-start-page'; | ||
static const MAIN_PAGE = '/user-main-page'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter/material.dart'; | ||
import '../Page.dart'; | ||
import '../../controller/Controller.dart'; | ||
import './WelcomeScreen.dart'; | ||
import './UserSection.dart'; | ||
|
||
class HomePage extends StatefulPage { | ||
HomePage(Controller controller, {Key key}) : super(controller, key: key); | ||
|
||
_HomePageState createState() => _HomePageState(super.getController()); | ||
} | ||
|
||
class _HomePageState extends State<HomePage> { | ||
final Controller _controller; | ||
_HomePageState(this._controller) { | ||
this._controller.setOnSessionChange(this._onSessionChange); | ||
} | ||
|
||
void _onSessionChange() { | ||
setState(() {}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
if (this._controller.getLoggedInUserName() == null) | ||
return WelcomeScreen(this._controller); | ||
else | ||
return UserSection(this._controller); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:flutter/material.dart'; | ||
import '../Page.dart'; | ||
import '../../controller/Controller.dart'; | ||
import '../widgets/forum/Forums.dart'; | ||
|
||
class UserSection extends StatefulPage { | ||
UserSection(Controller controller, {Key key}) : super(controller, key: key); | ||
|
||
@override | ||
_UserSectionState createState() => _UserSectionState(); | ||
} | ||
|
||
class _UserSectionState extends State<UserSection> { | ||
int _selectedIndex = 0; | ||
|
||
static final List<Widget> _options = [ | ||
Forums(), | ||
Text("Search..."), | ||
Text("Profile..."), | ||
]; | ||
|
||
void _onItemTapped(int idx) { | ||
setState(() { | ||
this._selectedIndex = idx; | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(), | ||
body: _UserSectionState._options[this._selectedIndex], | ||
bottomNavigationBar: BottomNavigationBar( | ||
items: const <BottomNavigationBarItem>[ | ||
BottomNavigationBarItem( | ||
icon: Icon(Icons.forum), | ||
label: 'Forums', | ||
), | ||
BottomNavigationBarItem( | ||
icon: Icon(Icons.search), | ||
label: 'Search', | ||
), | ||
BottomNavigationBarItem( | ||
icon: Icon(Icons.person), | ||
label: 'Profile', | ||
), | ||
], | ||
currentIndex: this._selectedIndex, | ||
selectedItemColor: Colors.blue[800], | ||
onTap: this._onItemTapped, | ||
), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:confnect/controller/database/MockAdapter.dart'; | ||
import './ForumTile.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ForumList extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
//final Users users = Provider.of(context); | ||
return ListView( | ||
children: [ | ||
ForumTile(MockAdapter.getForums()[0]), | ||
ForumTile(MockAdapter.getForums()[1]) | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.