-
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
219 additions
and
39 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,78 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AddPost extends StatelessWidget { | ||
const AddPost({Key? key, this.drawerKey}) : super(key: key); | ||
final GlobalKey<ScaffoldState>? drawerKey; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
elevation: 0.9, | ||
centerTitle: true, | ||
title: Text( | ||
'Share News', | ||
style: Theme.of(context).textTheme.headline6!.copyWith( | ||
fontWeight: FontWeight.w600, | ||
fontSize: 20, | ||
), | ||
), | ||
leading: IconButton( | ||
icon: const Icon(Icons.menu), | ||
onPressed: () => drawerKey!.currentState!.openDrawer(), | ||
), | ||
actions: [ | ||
TextButton( | ||
onPressed: () {}, | ||
child: Text( | ||
"Post", | ||
style: Theme.of(context).textTheme.headline5!.copyWith( | ||
fontWeight: FontWeight.w600, | ||
color: Theme.of(context).accentColor), | ||
), | ||
), | ||
], | ||
), | ||
body: Column( | ||
children: <Widget>[ | ||
const ListTile( | ||
leading: CircleAvatar( | ||
radius: 25, | ||
), | ||
title: Text('Rutvik Chandla'), | ||
subtitle: Text('Organization Name'), | ||
), | ||
Row( | ||
children: <Widget>[ | ||
IconButton(onPressed: () {}, icon: const Icon(Icons.photo)), | ||
IconButton( | ||
onPressed: () {}, icon: const Icon(Icons.camera_alt)), | ||
IconButton( | ||
onPressed: () {}, icon: const Icon(Icons.file_upload)), | ||
TextButton( | ||
onPressed: () {}, | ||
child: Text( | ||
'# Add hasthtag', | ||
style: Theme.of(context).textTheme.headline6, | ||
)), | ||
], | ||
), | ||
const Divider(), | ||
const Expanded( | ||
child: Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 16.0), | ||
child: TextField( | ||
maxLines: null, | ||
decoration: InputDecoration( | ||
border: InputBorder.none, | ||
focusedBorder: InputBorder.none, | ||
enabledBorder: InputBorder.none, | ||
errorBorder: InputBorder.none, | ||
disabledBorder: InputBorder.none, | ||
hintText: "Write here what do you want to share"), | ||
), | ||
)) | ||
], | ||
)); | ||
} | ||
} |
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,106 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hive/hive.dart'; | ||
import 'package:talawa/models/user/user_info.dart'; | ||
import 'package:talawa/services/navigation_service.dart'; | ||
import 'package:talawa/services/size_config.dart'; | ||
import 'package:talawa/views/after_auth_screens/add_post_page.dart'; | ||
import 'package:talawa/views/after_auth_screens/events/explore_events.dart'; | ||
import 'package:talawa/views/after_auth_screens/feed_page/organization_feed.dart'; | ||
import 'package:talawa/widgets/raised_round_edge_button.dart'; | ||
|
||
import '../locator.dart'; | ||
|
||
class HomeScreen extends StatefulWidget { | ||
const HomeScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
HomeScreenState createState() => HomeScreenState(); | ||
} | ||
|
||
class HomeScreenState extends State<HomeScreen> { | ||
int _currentIndex = 0; | ||
final List<Widget> _childrenPages = [ | ||
const OrganizationFeed(key: Key("HomeView")), | ||
const ExploreEvents(key: Key('ExploreEvents')), | ||
const AddPost(key: Key('AddPost')), | ||
Container( | ||
child: const Center( | ||
child: Text('Chat Screen'), | ||
), | ||
), | ||
Container( | ||
child: Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
SizedBox( | ||
height: SizeConfig.screenHeight! * 0.4, | ||
), | ||
const Text('Profile Screen'), | ||
SizedBox( | ||
height: SizeConfig.screenHeight! * 0.4, | ||
), | ||
RaisedRoundedButton( | ||
buttonLabel: 'Log out', | ||
onTap: () { | ||
final user = Hive.box<User>('currentUser'); | ||
final url = Hive.box('url'); | ||
user.clear(); | ||
url.clear(); | ||
locator<NavigationService>() | ||
.removeAllAndPush('/selectLang', '/', arguments: '0'); | ||
}, | ||
textColor: const Color(0xFF008A37), | ||
key: const Key('Logout'), | ||
backgroundColor: Colors.white, | ||
), | ||
SizedBox( | ||
height: SizeConfig.screenHeight! * 0.0215, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
]; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: _childrenPages[_currentIndex], | ||
bottomNavigationBar: BottomNavigationBar( | ||
type: BottomNavigationBarType.fixed, | ||
currentIndex: _currentIndex, | ||
onTap: onTabTapped, | ||
selectedItemColor: const Color(0xff34AD64), | ||
items: [ | ||
const BottomNavigationBarItem( | ||
icon: Icon(Icons.home), | ||
label: 'Home', | ||
), | ||
const BottomNavigationBarItem( | ||
icon: Icon(Icons.event_note), | ||
label: 'Events', | ||
), | ||
const BottomNavigationBarItem( | ||
icon: Icon(Icons.add_box), | ||
label: 'Post', | ||
), | ||
const BottomNavigationBarItem( | ||
icon: Icon(Icons.chat_bubble_outline), | ||
label: 'Chat', | ||
), | ||
const BottomNavigationBarItem( | ||
icon: Icon(Icons.account_circle), | ||
label: 'Profile', | ||
) | ||
], | ||
), | ||
); | ||
} | ||
|
||
void onTabTapped(int index) { | ||
setState(() { | ||
_currentIndex = index; | ||
}); | ||
} | ||
} |
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