├── .flutter-plugins-dependencies ├── .gitignore ├── .metadata ├── README.md ├── assets ├── apk │ └── app-release.apk ├── font │ └── nunito │ │ ├── nunito-bold.ttf │ │ ├── nunito-light.ttf │ │ └── nunito-regular.ttf ├── img │ ├── angry.gif │ ├── angry2.png │ ├── haha.gif │ ├── haha2.png │ ├── ic_like.png │ ├── ic_like_fill.png │ ├── like.gif │ ├── love.gif │ ├── love2.png │ ├── running_girl.jpeg │ ├── sad.gif │ ├── sad2.png │ ├── wow.gif │ └── wow2.png └── sounds │ ├── box_down.mp3 │ ├── box_up.mp3 │ ├── icon_choose.mp3 │ ├── icon_focus.mp3 │ └── short_press_like.mp3 ├── lib ├── custom │ ├── fab_bottom_app_bar.dart │ └── layout.dart ├── main.dart ├── postpage │ ├── postdetail_page.dart │ └── widgets.dart └── ui │ ├── home.dart │ ├── libraryPage │ ├── library.dart │ ├── libraryBloc.dart │ └── libraryWodgets.dart │ ├── locator.dart │ ├── loginPage │ └── login.dart │ ├── messagePage │ ├── messageBloc.dart │ ├── messageWidgets.dart │ └── messages.dart │ ├── newsFeedPage │ ├── FeedLatestArticle.dart │ ├── NewsFeed.dart │ └── widgets │ │ ├── ThumsUpReactions.dart │ │ ├── category_list.dart │ │ ├── feedBloc.dart │ │ ├── feedCard.dart │ │ └── widgetFeed.dart │ └── servicesPage │ ├── services.dart │ ├── servicesBloc.dart │ └── servicesWidgets.dart ├── pubspec.lock ├── pubspec.yaml └── screenshots ├── gif.gif ├── login1.png ├── login2.png ├── login3.png ├── menu.png ├── news_1.png ├── news_2.png ├── news_3.png ├── news_4.png ├── news_5.png ├── post1.png ├── post2.png ├── post3.png ├── post4.png ├── post5.png └── share.png /.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audioplayers","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.7/","dependencies":["path_provider"]},{"name":"flutter_country_picker","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_country_picker-0.1.6/","dependencies":[]},{"name":"path_provider","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.14/","dependencies":[]},{"name":"share","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/","dependencies":[]}],"android":[{"name":"audioplayers","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.7/","dependencies":["path_provider"]},{"name":"flutter_country_picker","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_country_picker-0.1.6/","dependencies":[]},{"name":"path_provider","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.14/","dependencies":[]},{"name":"share","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Library/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]}],"windows":[],"web":[]},"dependencyGraph":[{"name":"audioplayers","dependencies":["path_provider"]},{"name":"flutter_country_picker","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"share","dependencies":[]}],"date_created":"2020-09-03 01:37:06.095206","version":"1.20.3"} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: ba2111186f3cf688762a5dd7040ce94c6517c902 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Healthnest 3 | 4 | A new Flutter application made To make aware people of world bout the diseases and symptoms of the diseases. Questions & answer sessions and more. 5 | 6 | afrer downloading completes 7 | 8 | do first step. generate android and ios directory 9 | 10 | ``` 11 | cd project. // go to the project dir 12 | flutter create . 13 | ``` 14 | 15 | ## Getting Started 16 | 17 | This project is a starting point for a Flutter application. 18 | 19 | 20 | 21 | 22 | Screenshots: 23 | 24 | .. .. .. .. .. .. .. .. .. .. .. .. .. .. 25 | 26 | 27 | Download and install [APK](https://github.com/ishaileshmishra/healthnest/blob/master/assets/apk/app-release.apk?raw=true) to your android phone. 28 | 29 | ### [DOWNLOAD](https://github.com/ishaileshmishra/healthnest/blob/master/assets/apk/app-release.apk?raw=true) 30 | 31 | 32 | -------------------------------------------------------------------------------- /assets/apk/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/apk/app-release.apk -------------------------------------------------------------------------------- /assets/font/nunito/nunito-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/font/nunito/nunito-bold.ttf -------------------------------------------------------------------------------- /assets/font/nunito/nunito-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/font/nunito/nunito-light.ttf -------------------------------------------------------------------------------- /assets/font/nunito/nunito-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/font/nunito/nunito-regular.ttf -------------------------------------------------------------------------------- /assets/img/angry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/angry.gif -------------------------------------------------------------------------------- /assets/img/angry2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/angry2.png -------------------------------------------------------------------------------- /assets/img/haha.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/haha.gif -------------------------------------------------------------------------------- /assets/img/haha2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/haha2.png -------------------------------------------------------------------------------- /assets/img/ic_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/ic_like.png -------------------------------------------------------------------------------- /assets/img/ic_like_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/ic_like_fill.png -------------------------------------------------------------------------------- /assets/img/like.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/like.gif -------------------------------------------------------------------------------- /assets/img/love.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/love.gif -------------------------------------------------------------------------------- /assets/img/love2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/love2.png -------------------------------------------------------------------------------- /assets/img/running_girl.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/running_girl.jpeg -------------------------------------------------------------------------------- /assets/img/sad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/sad.gif -------------------------------------------------------------------------------- /assets/img/sad2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/sad2.png -------------------------------------------------------------------------------- /assets/img/wow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/wow.gif -------------------------------------------------------------------------------- /assets/img/wow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/img/wow2.png -------------------------------------------------------------------------------- /assets/sounds/box_down.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/sounds/box_down.mp3 -------------------------------------------------------------------------------- /assets/sounds/box_up.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/sounds/box_up.mp3 -------------------------------------------------------------------------------- /assets/sounds/icon_choose.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/sounds/icon_choose.mp3 -------------------------------------------------------------------------------- /assets/sounds/icon_focus.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/sounds/icon_focus.mp3 -------------------------------------------------------------------------------- /assets/sounds/short_press_like.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/assets/sounds/short_press_like.mp3 -------------------------------------------------------------------------------- /lib/custom/fab_bottom_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FABBottomAppBarItem { 4 | FABBottomAppBarItem({this.iconData, this.text}); 5 | IconData iconData; 6 | String text; 7 | } 8 | 9 | class FABBottomAppBar extends StatefulWidget { 10 | FABBottomAppBar({ 11 | this.items, 12 | this.centerItemText, 13 | this.height: 60.0, 14 | this.iconSize: 20.0, 15 | this.backgroundColor, 16 | this.color, 17 | this.selectedColor, 18 | this.notchedShape, 19 | this.onTabSelected, 20 | }) { 21 | assert(this.items.length == 2 || this.items.length == 4); 22 | } 23 | final List items; 24 | final String centerItemText; 25 | final double height; 26 | final double iconSize; 27 | final Color backgroundColor; 28 | final Color color; 29 | final Color selectedColor; 30 | final NotchedShape notchedShape; 31 | final ValueChanged onTabSelected; 32 | 33 | @override 34 | State createState() => FABBottomAppBarState(); 35 | } 36 | 37 | class FABBottomAppBarState extends State { 38 | int _selectedIndex = 0; 39 | 40 | _updateIndex(int index) { 41 | widget.onTabSelected(index); 42 | setState(() { 43 | _selectedIndex = index; 44 | }); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | List items = List.generate(widget.items.length, (int index) { 50 | return _buildTabItem( 51 | item: widget.items[index], 52 | index: index, 53 | onPressed: _updateIndex, 54 | ); 55 | }); 56 | items.insert(items.length >> 1, _buildMiddleTabItem()); 57 | 58 | return BottomAppBar( 59 | shape: widget.notchedShape, 60 | child: Row( 61 | mainAxisSize: MainAxisSize.max, 62 | mainAxisAlignment: MainAxisAlignment.spaceAround, 63 | children: items, 64 | ), 65 | color: widget.backgroundColor, 66 | ); 67 | } 68 | 69 | Widget _buildMiddleTabItem() { 70 | return Expanded( 71 | child: SizedBox( 72 | height: widget.height, 73 | child: Column( 74 | mainAxisSize: MainAxisSize.min, 75 | mainAxisAlignment: MainAxisAlignment.center, 76 | children: [ 77 | SizedBox(height: widget.iconSize), 78 | Text( 79 | widget.centerItemText ?? '', 80 | style: TextStyle(color: widget.color), 81 | ), 82 | ], 83 | ), 84 | ), 85 | ); 86 | } 87 | 88 | Widget _buildTabItem({ 89 | FABBottomAppBarItem item, 90 | int index, 91 | ValueChanged onPressed, 92 | }) { 93 | Color color = _selectedIndex == index ? widget.selectedColor : widget.color; 94 | return Expanded( 95 | child: SizedBox( 96 | height: widget.height, 97 | child: Material( 98 | type: MaterialType.transparency, 99 | child: InkWell( 100 | onTap: () => onPressed(index), 101 | child: Column( 102 | mainAxisSize: MainAxisSize.min, 103 | mainAxisAlignment: MainAxisAlignment.center, 104 | children: [ 105 | Icon(item.iconData, color: color, size: widget.iconSize), 106 | Text( 107 | item.text, 108 | style: TextStyle(color: color), 109 | ) 110 | ], 111 | ), 112 | ), 113 | ), 114 | ), 115 | ); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/custom/layout.dart: -------------------------------------------------------------------------------- 1 | // creating facebook like emoji 2 | import 'package:flutter/material.dart'; 3 | 4 | 5 | class AnchoredOverlay extends StatelessWidget { 6 | 7 | final bool showOverlay; 8 | final Widget Function(BuildContext, Offset anchor) overlayBuilder; 9 | final Widget child; 10 | 11 | AnchoredOverlay({ this.showOverlay, this.overlayBuilder, this.child }); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return new Container( 16 | child: new LayoutBuilder( 17 | builder: (BuildContext context, BoxConstraints constraints) { 18 | return new OverlayBuilder( 19 | showOverlay: showOverlay, 20 | overlayBuilder: (BuildContext overlayContext) { 21 | RenderBox box = context.findRenderObject() as RenderBox; 22 | final center = box.size.center(box.localToGlobal(const Offset(0.0, 0.0))); 23 | return overlayBuilder(overlayContext, center); 24 | }, 25 | child: child, 26 | ); 27 | }), 28 | ); 29 | } 30 | } 31 | 32 | class OverlayBuilder extends StatefulWidget { 33 | final bool showOverlay; 34 | final Function(BuildContext) overlayBuilder; 35 | final Widget child; 36 | 37 | OverlayBuilder({ 38 | this.showOverlay = false, 39 | this.overlayBuilder, 40 | this.child, 41 | }); 42 | 43 | @override 44 | _OverlayBuilderState createState() => new _OverlayBuilderState(); 45 | } 46 | 47 | class _OverlayBuilderState extends State { 48 | OverlayEntry overlayEntry; 49 | 50 | @override 51 | void initState() { 52 | super.initState(); 53 | 54 | if (widget.showOverlay) { 55 | WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); 56 | } 57 | } 58 | 59 | @override 60 | void didUpdateWidget(OverlayBuilder oldWidget) { 61 | super.didUpdateWidget(oldWidget); 62 | WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); 63 | } 64 | 65 | @override 66 | void reassemble() { 67 | super.reassemble(); 68 | WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); 69 | } 70 | 71 | @override 72 | void dispose() { 73 | if (isShowingOverlay()) { 74 | hideOverlay(); 75 | } 76 | 77 | super.dispose(); 78 | } 79 | 80 | bool isShowingOverlay() => overlayEntry != null; 81 | 82 | void showOverlay() { 83 | overlayEntry = new OverlayEntry( 84 | builder: widget.overlayBuilder, 85 | ); 86 | addToOverlay(overlayEntry); 87 | } 88 | 89 | void addToOverlay(OverlayEntry entry) async { 90 | print('addToOverlay'); 91 | Overlay.of(context).insert(entry); 92 | } 93 | 94 | void hideOverlay() { 95 | print('hideOverlay'); 96 | overlayEntry.remove(); 97 | overlayEntry = null; 98 | } 99 | 100 | void syncWidgetAndOverlay() { 101 | if (isShowingOverlay() && !widget.showOverlay) { 102 | hideOverlay(); 103 | } else if (!isShowingOverlay() && widget.showOverlay) { 104 | showOverlay(); 105 | } 106 | } 107 | 108 | @override 109 | Widget build(BuildContext context) { 110 | return widget.child; 111 | } 112 | } 113 | 114 | class CenterAbout extends StatelessWidget { 115 | final Offset position; 116 | final Widget child; 117 | 118 | CenterAbout({ 119 | this.position, 120 | this.child, 121 | }); 122 | 123 | @override 124 | Widget build(BuildContext context) { 125 | return new Positioned( 126 | top: position.dy, 127 | left: position.dx, 128 | child: new FractionalTranslation( 129 | translation: const Offset(-0.5, -0.5), 130 | child: child, 131 | ), 132 | ); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:healthnest/ui/loginPage/login.dart'; 4 | 5 | void main() => runApp(MaterialApp( 6 | title: 'HealthNest', 7 | debugShowCheckedModeBanner: false, 8 | theme: ThemeData( 9 | primaryColor: Colors.grey, 10 | accentColor: Colors.teal, 11 | fontFamily: 'nunito'), 12 | home: HealthNestLogin(), 13 | )); 14 | -------------------------------------------------------------------------------- /lib/postpage/postdetail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:healthnest/postpage/widgets.dart'; 3 | import 'package:healthnest/ui/newsFeedPage/widgets/feedBloc.dart'; 4 | import 'package:healthnest/ui/newsFeedPage/widgets/widgetFeed.dart'; 5 | 6 | class PostPageDetails extends StatefulWidget { 7 | PostPageDetails({Key key}) : super(key: key); 8 | 9 | @override 10 | _PostPageDetailsState createState() => _PostPageDetailsState(); 11 | } 12 | 13 | class _PostPageDetailsState extends State { 14 | @override 15 | 16 | Widget build(BuildContext context) { 17 | Widget _buildMessageComposer() { 18 | return Container( 19 | padding: EdgeInsets.symmetric(horizontal: 8.0), 20 | height: 70.0, 21 | color: Colors.white, 22 | child: Row( 23 | children: [ 24 | IconButton( 25 | icon: Icon(Icons.photo), 26 | iconSize: 25.0, 27 | color: Theme.of(context).primaryColor, 28 | onPressed: () {}, 29 | ), 30 | Expanded( 31 | child: TextField( 32 | textCapitalization: TextCapitalization.sentences, 33 | onChanged: (value) {}, 34 | decoration: 35 | InputDecoration.collapsed(hintText: 'Add a cheerful comment'), 36 | )), 37 | IconButton( 38 | icon: Icon(Icons.send), 39 | iconSize: 25.0, 40 | color: Theme.of(context).primaryColor, 41 | onPressed: () {}, 42 | ), 43 | ], 44 | ), 45 | ); 46 | } 47 | 48 | return Scaffold( 49 | backgroundColor: Colors.white, 50 | appBar: AppBar( 51 | title: Text('Questions'), 52 | elevation: 0, 53 | backgroundColor: Colors.white, 54 | ), 55 | body: SafeArea( 56 | child: GestureDetector( 57 | onTap: FocusScope.of(context).unfocus, 58 | child: SingleChildScrollView( 59 | padding: EdgeInsets.all(10), 60 | child: Column( 61 | mainAxisAlignment: MainAxisAlignment.end, 62 | children: [ 63 | feedNewsCardItem(context, FeedBloc().feedList[1]), 64 | 65 | //Reply and comment 1 66 | SizedBox(height: 30), 67 | othersComment(context, FeedBloc().feedList[2]), 68 | 69 | //Reply and comment 1 70 | SizedBox(height: 30), 71 | othersCommentWithImageSlider(context, FeedBloc().feedList[2]), 72 | 73 | //Reply and comment 1 74 | SizedBox(height: 30), 75 | othersComment(context, FeedBloc().feedList[2]), 76 | 77 | SizedBox(height: 30), 78 | othersComment(context, FeedBloc().feedList[2]), 79 | 80 | SizedBox(height: 30), 81 | commentReply(context, FeedBloc().feedList[2]), 82 | 83 | SizedBox(height: 30), 84 | othersComment(context, FeedBloc().feedList[2]), 85 | 86 | SizedBox(height: 30), 87 | othersCommentWithImageSlider(context, FeedBloc().feedList[2]), 88 | 89 | SizedBox(height: 30), 90 | othersComment(context, FeedBloc().feedList[2]), 91 | 92 | _buildMessageComposer() 93 | ], 94 | ), 95 | ), 96 | ), 97 | ), 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/postpage/widgets.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 3 | import 'package:healthnest/ui/newsFeedPage/widgets/feedBloc.dart'; 4 | import 'package:healthnest/ui/newsFeedPage/widgets/feedCard.dart'; 5 | import 'package:share/share.dart'; 6 | import 'package:carousel_slider/carousel_slider.dart'; 7 | 8 | Widget linearProgressIndicator() { 9 | return LinearProgressIndicator( 10 | backgroundColor: Colors.red, 11 | ); 12 | } 13 | 14 | Widget othersComment(BuildContext context, Feed feed) { 15 | return Container( 16 | child: Row( 17 | mainAxisAlignment: MainAxisAlignment.spaceAround, 18 | crossAxisAlignment: CrossAxisAlignment.start, 19 | children: [ 20 | CircleAvatar( 21 | backgroundColor: Colors.grey, 22 | child: ClipOval( 23 | child: Image.network( 24 | 'https://www.w3schools.com/w3images/avatar4.png')), 25 | radius: 20), 26 | SizedBox(width: 20), 27 | Expanded( 28 | child: Container( 29 | decoration: BoxDecoration( 30 | borderRadius: BorderRadius.all(Radius.circular(8)), 31 | border: Border.all( 32 | style: BorderStyle.solid, color: Colors.grey, width: 0.5)), 33 | child: Card( 34 | elevation: 0, 35 | child: Padding( 36 | padding: const EdgeInsets.all(10.0), 37 | child: Column( 38 | children: [ 39 | usernameSectionWithoutAvatar(context), 40 | space15(), 41 | Text( 42 | 'Not sure about rights. Looks like its matter of concern that our shool dont take it seriously such matters and trats it like lightly that it is fault of student', 43 | softWrap: true, 44 | maxLines: 3, 45 | style: TextStyle(fontSize: 14)), 46 | space15(), 47 | Divider(thickness: 1), 48 | SizedBox(height: 10), 49 | menuReply(feed), 50 | space15(), 51 | ], 52 | ), 53 | ), 54 | ), 55 | ) 56 | //commentReply(context, FeedBloc().feedList[2]), 57 | ) 58 | ], 59 | ), 60 | ); 61 | } 62 | 63 | Widget othersCommentWithImageSlider(BuildContext context, Feed feed) { 64 | return Container( 65 | child: Row( 66 | mainAxisAlignment: MainAxisAlignment.spaceAround, 67 | crossAxisAlignment: CrossAxisAlignment.start, 68 | children: [ 69 | CircleAvatar( 70 | backgroundColor: Colors.grey, 71 | child: ClipOval( 72 | child: Image.network( 73 | 'https://www.w3schools.com/w3images/avatar4.png')), 74 | radius: 20), 75 | SizedBox(width: 20), 76 | Expanded( 77 | child: Container( 78 | decoration: BoxDecoration( 79 | borderRadius: BorderRadius.all(Radius.circular(8)), 80 | border: Border.all( 81 | style: BorderStyle.solid, color: Colors.grey, width: 0.5)), 82 | child: Card( 83 | elevation: 0, 84 | child: Padding( 85 | padding: const EdgeInsets.all(10.0), 86 | child: Column( 87 | children: [ 88 | usernameSectionWithoutAvatar(context), 89 | space15(), 90 | Text( 91 | 'Not sure about rights. Looks like its matter of concern that our shool dont take it seriously such matters and trats it like lightly that it is fault of student', 92 | softWrap: true, 93 | maxLines: 3, 94 | style: TextStyle(fontSize: 14)), 95 | space15(), 96 | imageCarouselSlider(), 97 | Divider(thickness: 1), 98 | SizedBox(height: 10), 99 | menuReply(feed), 100 | space15(), 101 | ], 102 | ), 103 | ), 104 | ), 105 | ) 106 | //commentReply(context, FeedBloc().feedList[2]), 107 | ) 108 | ], 109 | ), 110 | ); 111 | } 112 | 113 | Widget imageCarouselSlider() { 114 | var imageSlider = [ 115 | 'https://cdn.pixabay.com/photo/2015/06/08/15/13/race-801940__340.jpg', 116 | 'https://images.pexels.com/photos/618612/pexels-photo-618612.jpeg', 117 | 'https://2rdnmg1qbg403gumla1v9i2h-wpengine.netdna-ssl.com/wp-content/uploads/sites/3/2019/05/kidsRaceAge-891544116-770x553-650x428.jpg', 118 | 'https://media.gettyimages.com/photos/working-out-by-the-ocean-picture-id621494554?s=612x612' 119 | ]; 120 | return CarouselSlider( 121 | height: 150.0, 122 | enableInfiniteScroll: true, 123 | autoPlay: true, 124 | scrollDirection: Axis.horizontal, 125 | autoPlayAnimationDuration: Duration(milliseconds: 800), 126 | autoPlayCurve: Curves.fastOutSlowIn, 127 | items: imageSlider.map((i) { 128 | return Builder( 129 | builder: (BuildContext context) { 130 | return Container( 131 | width: MediaQuery.of(context).size.width, 132 | margin: EdgeInsets.symmetric(horizontal: 5.0), 133 | decoration: BoxDecoration(color: Colors.grey[300]), 134 | child: Image.network( 135 | i, 136 | fit: BoxFit.cover, 137 | )); 138 | }, 139 | ); 140 | }).toList(), 141 | ); 142 | } 143 | 144 | Widget menuReply(Feed listFeed) { 145 | return Column( 146 | crossAxisAlignment: CrossAxisAlignment.start, 147 | children: [ 148 | Row( 149 | mainAxisAlignment: MainAxisAlignment.spaceAround, 150 | crossAxisAlignment: CrossAxisAlignment.center, 151 | children: [ 152 | GestureDetector( 153 | onTap: () => debugPrint('${listFeed.likes} tapped'), 154 | child: Row( 155 | children: [ 156 | Icon( 157 | FontAwesomeIcons.arrowUp, 158 | size: 16, 159 | color: Colors.teal, 160 | ), 161 | SizedBox(width: 5), 162 | Text( 163 | '${listFeed.likes}', 164 | style: TextStyle( 165 | color: Colors.teal, 166 | fontSize: 12, 167 | fontWeight: FontWeight.bold), 168 | ) 169 | ], 170 | )), 171 | Row( 172 | mainAxisAlignment: MainAxisAlignment.spaceAround, 173 | crossAxisAlignment: CrossAxisAlignment.center, 174 | children: [ 175 | GestureDetector( 176 | onTap: () => debugPrint('Comment Tapped'), 177 | child: Row( 178 | children: [ 179 | Icon(FontAwesomeIcons.arrowDown, size: 16), 180 | SizedBox(width: 5), 181 | Text( 182 | listFeed.comments, 183 | style: TextStyle( 184 | fontSize: 12, fontWeight: FontWeight.bold), 185 | ) 186 | ], 187 | )) 188 | ]), 189 | GestureDetector( 190 | onTap: () { 191 | Share.share('check out my website https://example.com'); 192 | }, 193 | child: Icon(Icons.share, size: 18)), 194 | Text('Reply', 195 | style: TextStyle( 196 | color: Colors.teal, 197 | fontSize: 16, 198 | fontWeight: FontWeight.bold)) 199 | ], 200 | ), 201 | SizedBox(height: 20), 202 | Container( 203 | padding: EdgeInsets.only(left: 20), 204 | child: Text('2 Replies', 205 | style: TextStyle(color: Colors.teal, fontSize: 14)), 206 | ) 207 | ], 208 | ); 209 | } 210 | 211 | Widget usernameSectionWithoutAvatar(BuildContext context) { 212 | return Row( 213 | children: [ 214 | Expanded( 215 | child: Row( 216 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 217 | children: [ 218 | Row( 219 | children: [ 220 | Column( 221 | crossAxisAlignment: CrossAxisAlignment.start, 222 | children: [ 223 | Row( 224 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 225 | children: [ 226 | Text('username1275', 227 | style: TextStyle( 228 | fontSize: 16, fontWeight: FontWeight.bold)), 229 | SizedBox( 230 | width: 10, 231 | ), 232 | Text('1Min', 233 | style: TextStyle(fontSize: 14, color: Colors.grey)) 234 | ], 235 | ), 236 | SizedBox(height: 4), 237 | Text('DIAGNOSE RECENTRLY', 238 | style: TextStyle(fontSize: 12, color: Colors.teal)), 239 | ], 240 | ) 241 | ], 242 | ), 243 | moreOptions3Dots(context), 244 | ], 245 | ), 246 | ) 247 | ], 248 | ); 249 | } 250 | 251 | Widget commentReply(BuildContext context, Feed feed) { 252 | return Container( 253 | child: Row( 254 | mainAxisAlignment: MainAxisAlignment.spaceAround, 255 | crossAxisAlignment: CrossAxisAlignment.start, 256 | children: [ 257 | Expanded( 258 | child: Container( 259 | decoration: BoxDecoration( 260 | borderRadius: BorderRadius.all(Radius.circular(8)), 261 | border: Border.all( 262 | style: BorderStyle.solid, color: Colors.grey, width: 0.5)), 263 | child: Container( 264 | color: Colors.grey[300], 265 | child: Padding( 266 | padding: const EdgeInsets.all(10.0), 267 | child: Column( 268 | children: [ 269 | //usernameSectionWithoutAvatar(context), 270 | //space15(), 271 | Text( 272 | 'Not sure about rights. Looks like its matter of concern that our shool dont take it seriously such matters and trats it like lightly that it is fault of student', 273 | softWrap: true, 274 | maxLines: 3, 275 | style: TextStyle(fontSize: 14)), 276 | space15(), 277 | 278 | Divider(thickness: 1), 279 | SizedBox(height: 10), 280 | menuCommentReply(feed), 281 | space15(), 282 | ], 283 | ), 284 | ), 285 | ), 286 | ) 287 | //commentReply(context, FeedBloc().feedList[2]), 288 | ), 289 | SizedBox(width: 20), 290 | CircleAvatar( 291 | backgroundColor: Colors.grey, 292 | child: ClipOval( 293 | child: Image.network( 294 | 'https://www.w3schools.com/w3images/avatar4.png')), 295 | radius: 20), 296 | ], 297 | ), 298 | ); 299 | } 300 | 301 | Widget menuCommentReply(Feed listFeed) { 302 | return Row( 303 | mainAxisAlignment: MainAxisAlignment.spaceAround, 304 | crossAxisAlignment: CrossAxisAlignment.center, 305 | children: [ 306 | GestureDetector( 307 | onTap: () => debugPrint('${listFeed.likes} tapped'), 308 | child: Row( 309 | children: [ 310 | Icon( 311 | FontAwesomeIcons.arrowUp, 312 | size: 16, 313 | color: Colors.teal, 314 | ), 315 | SizedBox(width: 5), 316 | Text( 317 | '${listFeed.likes}', 318 | style: TextStyle( 319 | color: Colors.teal, 320 | fontSize: 12, 321 | fontWeight: FontWeight.bold), 322 | ) 323 | ], 324 | )), 325 | Row( 326 | mainAxisAlignment: MainAxisAlignment.spaceAround, 327 | crossAxisAlignment: CrossAxisAlignment.center, 328 | children: [ 329 | GestureDetector( 330 | onTap: () => debugPrint('Comment Tapped'), 331 | child: Row( 332 | children: [ 333 | Icon(FontAwesomeIcons.arrowDown, size: 16), 334 | SizedBox(width: 5), 335 | Text( 336 | listFeed.comments, 337 | style: 338 | TextStyle(fontSize: 12, fontWeight: FontWeight.bold), 339 | ) 340 | ], 341 | )) 342 | ]), 343 | GestureDetector( 344 | onTap: () { 345 | Share.share('check out my website https://example.com'); 346 | }, 347 | child: Icon(Icons.share, size: 18)), 348 | GestureDetector(onTap: () {}, child: Icon(Icons.linear_scale, size: 18)), 349 | ], 350 | ); 351 | } 352 | -------------------------------------------------------------------------------- /lib/ui/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:healthnest/custom/fab_bottom_app_bar.dart'; 4 | import 'package:healthnest/ui/libraryPage/library.dart'; 5 | import 'package:healthnest/ui/messagePage/messages.dart'; 6 | import 'package:healthnest/ui/servicesPage/services.dart'; 7 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 8 | import 'package:healthnest/ui/newsFeedPage/NewsFeed.dart'; 9 | 10 | class HomePage extends StatefulWidget { 11 | @override 12 | _HomePageState createState() => new _HomePageState(); 13 | } 14 | 15 | class _HomePageState extends State with TickerProviderStateMixin { 16 | int _selectedDrawerIndex = 0; 17 | List bottomMenuItems = new List(); 18 | 19 | _selectedTab(int pos) { 20 | setState(() { 21 | _onSelectItem(pos); 22 | }); 23 | 24 | switch (pos) { 25 | case 0: 26 | return NewsFeed(); 27 | case 1: 28 | return LibraryPage(); 29 | case 2: 30 | return MessagesPage(); 31 | case 3: 32 | return ServicePage(); 33 | default: 34 | return Text("Invalid screen requested"); 35 | } 36 | } 37 | 38 | _onSelectItem(int index) { 39 | setState(() => _selectedDrawerIndex = index); 40 | } 41 | 42 | @override 43 | void initState() { 44 | super.initState(); 45 | 46 | _selectedTab(_selectedDrawerIndex); 47 | bottomMenuItems.add(new MenuModel('Create a post', 48 | 'share your thoughts with the community', Icons.colorize)); 49 | bottomMenuItems.add(new MenuModel( 50 | 'Ask a Question', 'Any doubts? As the community', Icons.info)); 51 | bottomMenuItems.add(new MenuModel( 52 | 'Start a Poll', 'Need the opiniun of the many', Icons.equalizer)); 53 | bottomMenuItems.add(new MenuModel('Organise an Event', 54 | 'Start a meet with people to share your joys', Icons.event)); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Scaffold( 60 | backgroundColor: Colors.white, 61 | body: _selectedTab(_selectedDrawerIndex), 62 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, 63 | floatingActionButton: FloatingActionButton( 64 | tooltip: 'Create Post', 65 | splashColor: Colors.teal, 66 | onPressed: _modalBottomSheetMenu, 67 | child: Icon(CupertinoIcons.add), 68 | elevation: 0, 69 | ), 70 | bottomNavigationBar: FABBottomAppBar( 71 | color: Colors.grey[700], 72 | selectedColor: Theme.of(context).accentColor, 73 | notchedShape: CircularNotchedRectangle(), 74 | iconSize: 20.0, 75 | onTabSelected: _selectedTab, 76 | items: [ 77 | FABBottomAppBarItem(iconData: FontAwesomeIcons.listAlt, text: 'Feed'), 78 | FABBottomAppBarItem(iconData: FontAwesomeIcons.book, text: 'Library'), 79 | FABBottomAppBarItem( 80 | iconData: FontAwesomeIcons.comments, text: 'Messages'), 81 | FABBottomAppBarItem( 82 | iconData: FontAwesomeIcons.businessTime, text: 'Services'), 83 | ], 84 | ), 85 | ); 86 | } 87 | 88 | _modalBottomSheetMenu() { 89 | showModalBottomSheet( 90 | context: context, 91 | builder: (BuildContext context) { 92 | return Container( 93 | height: 440.0, 94 | color: Color(0xFF737373), 95 | child: Column( 96 | children: [ 97 | Container( 98 | height: 300.0, 99 | margin: EdgeInsets.symmetric(horizontal: 15), 100 | decoration: new BoxDecoration( 101 | color: Colors.white, //Color(0xFF737373), 102 | borderRadius: BorderRadius.all(Radius.circular(10.0))), 103 | child: ListView.builder( 104 | itemCount: bottomMenuItems.length, 105 | itemBuilder: (context, index) { 106 | return ListTile( 107 | leading: Container( 108 | padding: EdgeInsets.all(8), 109 | decoration: BoxDecoration( 110 | borderRadius: 111 | BorderRadius.all(Radius.circular(30)), 112 | color: Colors.teal[100], 113 | ), 114 | child: Icon( 115 | bottomMenuItems[index].icon, 116 | color: Colors.teal, 117 | ), 118 | ), 119 | trailing: Icon( 120 | Icons.arrow_forward_ios, 121 | size: 15, 122 | ), 123 | title: Text( 124 | bottomMenuItems[index].title, 125 | style: TextStyle(color: Colors.teal, fontSize: 18), 126 | ), 127 | subtitle: Text(bottomMenuItems[index].subtitle), 128 | onTap: () { 129 | Navigator.pop(context); 130 | debugPrint(bottomMenuItems[index].title); 131 | }, 132 | ); 133 | }), 134 | ), 135 | 136 | //SizedBox(height: 10), 137 | 138 | Container( 139 | height: 60, width: 60, 140 | decoration: BoxDecoration( 141 | color: Colors.white, 142 | borderRadius: BorderRadius.all(Radius.circular(30))), 143 | margin: EdgeInsets.symmetric(vertical: 30), 144 | child: GestureDetector( 145 | onTap: () => Navigator.pop(context), 146 | child: Icon(Icons.close, 147 | size: 25, color: Colors.grey[900]))), 148 | ], 149 | ), 150 | ); 151 | }); 152 | } 153 | } 154 | 155 | class MenuModel { 156 | String title; 157 | String subtitle; 158 | IconData icon; 159 | 160 | MenuModel(this.title, this.subtitle, this.icon); 161 | } 162 | -------------------------------------------------------------------------------- /lib/ui/libraryPage/library.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LibraryPage extends StatefulWidget { 4 | @override 5 | _LibraryPageState createState() => _LibraryPageState(); 6 | } 7 | 8 | class _LibraryPageState extends State { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Padding( 13 | padding: const EdgeInsets.all(18.0), 14 | child: SafeArea( 15 | child: Container( 16 | child: Text('LIBRARY', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/ui/libraryPage/libraryBloc.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/libraryPage/libraryBloc.dart -------------------------------------------------------------------------------- /lib/ui/libraryPage/libraryWodgets.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/libraryPage/libraryWodgets.dart -------------------------------------------------------------------------------- /lib/ui/locator.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/locator.dart -------------------------------------------------------------------------------- /lib/ui/loginPage/login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_country_picker/flutter_country_picker.dart'; 4 | import 'package:healthnest/ui/home.dart'; 5 | 6 | class HealthNestLogin extends StatefulWidget { 7 | @override 8 | _HealthNestLoginState createState() => _HealthNestLoginState(); 9 | } 10 | 11 | class _HealthNestLoginState extends State { 12 | 13 | Country _selectedCountry; 14 | final controller = TextEditingController(); 15 | GlobalKey _key = new GlobalKey(); 16 | bool _validate = false; 17 | String consumerMobileNumber; 18 | Color color = Colors.grey; 19 | 20 | @override 21 | void initState() { 22 | _selectedCountry = Country.IN; 23 | super.initState(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Form( 29 | key: _key, 30 | autovalidate: _validate, 31 | child: Align( 32 | alignment: Alignment.bottomCenter, 33 | child: formUI(), 34 | ) 35 | ); 36 | } 37 | 38 | Widget formUI() { 39 | return GestureDetector( 40 | onTap: () => FocusScope.of(context).requestFocus(new FocusNode()), 41 | child: Scaffold( 42 | body: SingleChildScrollView( 43 | child: Container( 44 | padding: const EdgeInsets.only(top: 180, left: 20, right: 20), 45 | 46 | child: SafeArea( 47 | child: Column( 48 | crossAxisAlignment: CrossAxisAlignment.start, 49 | mainAxisAlignment: MainAxisAlignment.end, 50 | children: [ 51 | appIcon(), 52 | SizedBox(height: 20), 53 | welcomeText(), 54 | SizedBox(height: 20), 55 | editTextWithCountryCode(), 56 | SizedBox(height: 20), 57 | textDescription(), 58 | SizedBox(height: 20), 59 | sendOTPButtonWidget(), 60 | ], 61 | ), 62 | ), 63 | ), 64 | ), 65 | ), 66 | ); 67 | } 68 | 69 | String _validateMobile(String value) { 70 | String patttern = r'(^[0-9]*$)'; 71 | RegExp regExp = new RegExp(patttern); 72 | if (value.length == 0) { 73 | return "Mobile is Required"; 74 | } else if (value.length != 10) { 75 | return "Mobile number must 10 digits"; 76 | } else if (!regExp.hasMatch(value)) { 77 | return "Mobile Number must be digits"; 78 | } 79 | 80 | return null; 81 | } 82 | 83 | _sendToServer() { 84 | if (_key.currentState.validate()) { 85 | _key.currentState.save(); 86 | print("Mobile $consumerMobileNumber"); 87 | print('Country ${_selectedCountry.name}'); 88 | 89 | Navigator.push( 90 | context, MaterialPageRoute(builder: (context) => HomePage())); 91 | } else { 92 | // validation error 93 | setState(() { 94 | _validate = true; 95 | }); 96 | } 97 | } 98 | 99 | Widget sendOTPButtonWidget() { 100 | return Container( 101 | width: double.infinity, 102 | height: 45, 103 | child: RaisedButton( 104 | color: color, 105 | onPressed: _sendToServer, 106 | child: Text('Send OTP', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white)), 107 | //color: Theme.of(context).accentColor, 108 | elevation: 5, 109 | ), 110 | ); 111 | } 112 | 113 | Widget textDescription() { 114 | return Container( 115 | child: Text( 116 | 'We never compromise on security!\nHelp us create a safe place by providing your mobile number to maintain authenticity', 117 | style: TextStyle( 118 | fontSize: 15, fontWeight: FontWeight.normal, color: Colors.grey), 119 | )); 120 | } 121 | 122 | Widget editTextWithCountryCode() { 123 | return Row( 124 | crossAxisAlignment: CrossAxisAlignment.center, 125 | mainAxisAlignment: MainAxisAlignment.start, 126 | children: [ 127 | Expanded( 128 | flex: 1, 129 | child: CountryPicker( 130 | showDialingCode: true, 131 | showName: false, 132 | showCurrencyISO: false, 133 | onChanged: (Country country) { 134 | setState(() { 135 | _selectedCountry = country; 136 | }); 137 | }, 138 | selectedCountry: _selectedCountry, 139 | ), 140 | ), 141 | SizedBox(width: 20), 142 | Expanded( 143 | flex: 2, 144 | child: TextFormField( 145 | 146 | maxLength: 10, 147 | keyboardType: TextInputType.number, 148 | onChanged: (String newVal) { 149 | setState(() { 150 | if(newVal.length==10){ 151 | color = Colors.teal; 152 | }else{ 153 | color = Colors.grey; 154 | } 155 | }); 156 | }, 157 | decoration: InputDecoration( 158 | labelText: 'Enter phone number', 159 | suffixIcon: Icon(CupertinoIcons.phone)), 160 | validator: _validateMobile, 161 | controller: controller, 162 | onSaved: (String phoneNumber) { 163 | debugPrint('find the input length ${phoneNumber.length}'); 164 | consumerMobileNumber = phoneNumber; 165 | }, 166 | ), 167 | ) 168 | ], 169 | ); 170 | } 171 | 172 | Widget appIcon() { 173 | return Align( 174 | alignment: Alignment.topLeft, 175 | child: Image.asset('assets/img/doctor.png', 176 | width: 80, height: 80, color: Colors.teal)); 177 | } 178 | 179 | Widget welcomeText() { 180 | return Container( 181 | child: const Text( 182 | 'Welcome to\nHealthNest', 183 | style: TextStyle( 184 | fontSize: 30, 185 | fontStyle: FontStyle.normal, 186 | fontWeight: FontWeight.bold), 187 | ), 188 | ); 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /lib/ui/messagePage/messageBloc.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/messagePage/messageBloc.dart -------------------------------------------------------------------------------- /lib/ui/messagePage/messageWidgets.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/messagePage/messageWidgets.dart -------------------------------------------------------------------------------- /lib/ui/messagePage/messages.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MessagesPage extends StatefulWidget { 4 | @override 5 | _MessagesPageState createState() => _MessagesPageState(); 6 | } 7 | 8 | class _MessagesPageState extends State { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Padding( 13 | padding: const EdgeInsets.all(18.0), 14 | child: SafeArea( 15 | child: Container( 16 | child: Text('MESSAGE', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/FeedLatestArticle.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | 4 | class LatestArticleModel { 5 | 6 | String imageIcon; 7 | String drName; 8 | String drDescription; 9 | 10 | LatestArticleModel({this.imageIcon, this.drName, this.drDescription}); 11 | } 12 | 13 | class LatestArticle extends StatefulWidget { 14 | @override 15 | _LatestArticleState createState() => _LatestArticleState(); 16 | } 17 | 18 | class _LatestArticleState extends State { 19 | List articleModel = new List(); 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | 25 | articleModel.add(LatestArticleModel( 26 | imageIcon: 'https://www.w3schools.com/w3images/avatar2.png', 27 | drName: 'Dr. Shukla', 28 | drDescription: 29 | 'Generic testing plays an important role in preventing the cancer orem ipsum...')); 30 | articleModel.add(LatestArticleModel( 31 | imageIcon: 'https://www.w3schools.com/w3images/avatar3.png', 32 | drName: 'Dr. Mishra', 33 | drDescription: 34 | 'Generic testing plays an important role in preventing the cancer orem ipsum...')); 35 | articleModel.add(LatestArticleModel( 36 | imageIcon: 'https://www.w3schools.com/w3images/avatar5.png', 37 | drName: 'Dr. Tripathi', 38 | drDescription: 39 | 'Generic testing plays an important role in preventing the cancer orem ipsum...')); 40 | } 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return ListView.builder( 45 | scrollDirection: Axis.horizontal, 46 | itemCount: articleModel.length, 47 | itemBuilder: (context, index) { 48 | return Container( 49 | margin: EdgeInsets.only(left: 20), 50 | decoration: BoxDecoration( 51 | borderRadius: BorderRadius.all(Radius.circular(8)), 52 | border: Border.all(style: BorderStyle.solid, color: Colors.grey, width: 0.5) 53 | ), 54 | child: Card( 55 | elevation: 0, 56 | child: Container( 57 | height: 200, 58 | width: 300, 59 | padding: EdgeInsets.all(8), 60 | decoration: BoxDecoration( 61 | borderRadius: BorderRadius.all(Radius.circular(8))), 62 | child: Column( 63 | crossAxisAlignment: CrossAxisAlignment.start, 64 | mainAxisAlignment: MainAxisAlignment.spaceAround, 65 | children: [ 66 | Row( 67 | children: [ 68 | CircleAvatar( 69 | backgroundColor: Colors.grey, 70 | child: ClipOval( 71 | child: 72 | Image.network(articleModel[index].imageIcon)), 73 | radius: 20), 74 | SizedBox(width: 10), 75 | Text(articleModel[index].drName, 76 | style: TextStyle( 77 | fontSize: 18, fontWeight: FontWeight.bold)) 78 | ], 79 | ), 80 | Text(articleModel[index].drDescription, 81 | maxLines: 3, style: TextStyle(fontSize: 15)), 82 | Divider( 83 | height: 1, 84 | color: Colors.blue, 85 | ), 86 | 87 | Row( 88 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 89 | children: [ 90 | Text('READ ARTICLE', 91 | style: TextStyle( 92 | fontSize: 14, 93 | fontWeight: FontWeight.bold, 94 | color: Colors.teal)), 95 | Icon( 96 | Icons.arrow_forward_ios, 97 | size: 15, 98 | color: Colors.teal, 99 | ) 100 | ], 101 | ), 102 | 103 | ], 104 | ), 105 | ), 106 | ), 107 | ); 108 | }); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/NewsFeed.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:healthnest/postpage/postdetail_page.dart'; 3 | import 'package:healthnest/ui/newsFeedPage/widgets/category_list.dart'; 4 | import 'package:healthnest/ui/newsFeedPage/widgets/feedBloc.dart'; 5 | import 'package:healthnest/ui/newsFeedPage/widgets/widgetFeed.dart'; 6 | import 'package:healthnest/ui/newsFeedPage/FeedLatestArticle.dart'; 7 | 8 | class NewsFeed extends StatefulWidget { 9 | 10 | @override 11 | _NewsFeedState createState() => _NewsFeedState(); 12 | } 13 | 14 | class _NewsFeedState extends State { 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | 19 | return Scaffold( 20 | backgroundColor: Colors.white, 21 | appBar: AppBar( 22 | title: actionBarRow(), 23 | centerTitle: false, 24 | elevation: 0, 25 | automaticallyImplyLeading: false, 26 | backgroundColor: Colors.white, 27 | ), 28 | 29 | body: SafeArea( 30 | child: Column( 31 | children: [ 32 | Container( 33 | margin: EdgeInsets.all(10), 34 | child: Column( 35 | children: [ 36 | topSpace(), 37 | searchTextField(), 38 | topSpace(), 39 | Container(height: 55, child: CategoryList()), 40 | ], 41 | ), 42 | ), 43 | Expanded( 44 | child: Container( 45 | color: Colors.white, 46 | padding: EdgeInsets.symmetric(horizontal: 10), 47 | 48 | child: SingleChildScrollView( 49 | 50 | child: Column( 51 | crossAxisAlignment: CrossAxisAlignment.start, 52 | children: [ 53 | // List section for the News Feed. 54 | GestureDetector( 55 | onTap: viewDetailPage, 56 | child: 57 | feedNewsCardItem(context, FeedBloc().feedList[0]), 58 | ), 59 | 60 | topSpace(), 61 | GestureDetector( 62 | onTap: viewDetailPage, 63 | child: 64 | feedNewsCardItem(context, FeedBloc().feedList[1]), 65 | ), 66 | 67 | topSpace(), 68 | GestureDetector( 69 | onTap: viewDetailPage, 70 | child: feedNewsCardItemQuestion( 71 | context, FeedBloc().feedList[2]), 72 | ), 73 | 74 | topSpace(), 75 | GestureDetector( 76 | onTap: viewDetailPage, 77 | child: feedNewsCardWithImageItem( 78 | context, FeedBloc().feedList[3]), 79 | ), 80 | 81 | SizedBox(height: 20), 82 | 83 | Container( 84 | padding: EdgeInsets.symmetric(horizontal: 10), 85 | child: Text('LATEST ARTICLE', 86 | style: TextStyle( 87 | fontSize: 16, fontWeight: FontWeight.bold))), 88 | 89 | topSpace(), 90 | 91 | Container( 92 | height: 200, 93 | padding: EdgeInsets.all(10), 94 | child: LatestArticle()), 95 | 96 | topSpace(), 97 | pollingCard(context, FeedBloc().feedList[4]), 98 | 99 | topSpace(), 100 | GestureDetector( 101 | onTap: viewDetailPage, 102 | child: feedNewsCardItem(context, FeedBloc().feedList[1]), 103 | ), 104 | ], 105 | ), 106 | ), 107 | ), 108 | ), 109 | ], 110 | ), 111 | ), 112 | ); 113 | } 114 | 115 | Widget viewDetailPage() { 116 | print('Go To Detail Screen'); 117 | Navigator.push(context, 118 | new MaterialPageRoute(builder: (context) => PostPageDetails())); 119 | return null; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/widgets/ThumsUpReactions.dart: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | written by ishaileshmishra 5 | 6 | * Reactions are Facebook’s line-up of emoji that allow you to react to 7 | * posts with six different animated emotions: Love, Haha, Wow, Sad, Angry, 8 | * and the classic Like. I think these are interesting and very cool, now let’s get started! 9 | * */ 10 | 11 | import 'dart:async'; 12 | import 'dart:io'; 13 | import 'package:audioplayers/audioplayers.dart'; 14 | import 'package:flutter/material.dart'; 15 | import 'package:flutter/services.dart'; 16 | import 'package:path_provider/path_provider.dart'; 17 | 18 | class FbReactionBox extends StatelessWidget { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar( 23 | title: Text( 24 | 'FB REACTION', style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), 25 | ), 26 | centerTitle: true, 27 | ), 28 | body: FbReaction()); 29 | } 30 | } 31 | 32 | class FbReaction extends StatefulWidget { 33 | @override 34 | createState() => FbReactionState(); 35 | } 36 | 37 | class FbReactionState extends State with TickerProviderStateMixin { 38 | AudioPlayer audioPlayer; 39 | 40 | int durationAnimationBox = 500; 41 | int durationAnimationBtnLongPress = 150; 42 | int durationAnimationBtnShortPress = 500; 43 | int durationAnimationIconWhenDrag = 150; 44 | int durationAnimationIconWhenRelease = 1000; 45 | 46 | // For long press btn 47 | AnimationController animControlBtnLongPress, animControlBox; 48 | Animation zoomIconLikeInBtn, tiltIconLikeInBtn, zoomTextLikeInBtn; 49 | Animation fadeInBox; 50 | Animation moveRightGroupIcon; 51 | Animation pushIconLikeUp, pushIconLoveUp, pushIconHahaUp, pushIconWowUp, pushIconSadUp, pushIconAngryUp; 52 | Animation zoomIconLike, zoomIconLove, zoomIconHaha, zoomIconWow, zoomIconSad, zoomIconAngry; 53 | 54 | // For short press btn 55 | AnimationController animControlBtnShortPress; 56 | Animation zoomIconLikeInBtn2, tiltIconLikeInBtn2; 57 | 58 | // For zoom icon when drag 59 | AnimationController animControlIconWhenDrag; 60 | AnimationController animControlIconWhenDragInside; 61 | AnimationController animControlIconWhenDragOutside; 62 | AnimationController animControlBoxWhenDragOutside; 63 | Animation zoomIconChosen, zoomIconNotChosen; 64 | Animation zoomIconWhenDragOutside; 65 | Animation zoomIconWhenDragInside; 66 | Animation zoomBoxWhenDragOutside; 67 | Animation zoomBoxIcon; 68 | 69 | // For jump icon when release 70 | AnimationController animControlIconWhenRelease; 71 | Animation zoomIconWhenRelease, moveUpIconWhenRelease; 72 | Animation moveLeftIconLikeWhenRelease, 73 | moveLeftIconLoveWhenRelease, 74 | moveLeftIconHahaWhenRelease, 75 | moveLeftIconWowWhenRelease, 76 | moveLeftIconSadWhenRelease, 77 | moveLeftIconAngryWhenRelease; 78 | 79 | Duration durationLongPress = Duration(milliseconds: 250); 80 | Timer holdTimer; 81 | bool isLongPress = false; 82 | bool isLiked = false; 83 | 84 | // 0 = nothing, 1 = like, 2 = love, 3 = haha, 4 = wow, 5 = sad, 6 = angry 85 | int whichIconUserChoose = 0; 86 | 87 | // 0 = nothing, 1 = like, 2 = love, 3 = haha, 4 = wow, 5 = sad, 6 = angry 88 | int currentIconFocus = 0; 89 | int previousIconFocus = 0; 90 | bool isDragging = false; 91 | bool isDraggingOutside = false; 92 | bool isJustDragInside = true; 93 | 94 | @override 95 | void initState() { 96 | super.initState(); 97 | 98 | audioPlayer = AudioPlayer(); 99 | 100 | // Button Like 101 | initAnimationBtnLike(); 102 | 103 | // Box and Icons 104 | initAnimationBoxAndIcons(); 105 | 106 | // Icon when drag 107 | initAnimationIconWhenDrag(); 108 | 109 | // Icon when drag outside 110 | initAnimationIconWhenDragOutside(); 111 | 112 | // Box when drag outside 113 | initAnimationBoxWhenDragOutside(); 114 | 115 | // Icon when first drag 116 | initAnimationIconWhenDragInside(); 117 | 118 | // Icon when release 119 | initAnimationIconWhenRelease(); 120 | } 121 | 122 | initAnimationBtnLike() { 123 | // long press 124 | animControlBtnLongPress = 125 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationBtnLongPress)); 126 | zoomIconLikeInBtn = Tween(begin: 1.0, end: 0.85).animate(animControlBtnLongPress); 127 | tiltIconLikeInBtn = Tween(begin: 0.0, end: 0.2).animate(animControlBtnLongPress); 128 | zoomTextLikeInBtn = Tween(begin: 1.0, end: 0.85).animate(animControlBtnLongPress); 129 | 130 | zoomIconLikeInBtn.addListener(() { 131 | setState(() {}); 132 | }); 133 | tiltIconLikeInBtn.addListener(() { 134 | setState(() {}); 135 | }); 136 | zoomTextLikeInBtn.addListener(() { 137 | setState(() {}); 138 | }); 139 | 140 | // short press 141 | animControlBtnShortPress = 142 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationBtnShortPress)); 143 | zoomIconLikeInBtn2 = Tween(begin: 1.0, end: 0.2).animate(animControlBtnShortPress); 144 | tiltIconLikeInBtn2 = Tween(begin: 0.0, end: 0.8).animate(animControlBtnShortPress); 145 | 146 | zoomIconLikeInBtn2.addListener(() { 147 | setState(() {}); 148 | }); 149 | tiltIconLikeInBtn2.addListener(() { 150 | setState(() {}); 151 | }); 152 | } 153 | 154 | initAnimationBoxAndIcons() { 155 | animControlBox = AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationBox)); 156 | 157 | // General 158 | moveRightGroupIcon = Tween(begin: 0.0, end: 10.0).animate( 159 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 1.0)), 160 | ); 161 | moveRightGroupIcon.addListener(() { 162 | setState(() {}); 163 | }); 164 | 165 | // Box 166 | fadeInBox = Tween(begin: 0.0, end: 1.0).animate( 167 | CurvedAnimation(parent: animControlBox, curve: Interval(0.7, 1.0)), 168 | ); 169 | fadeInBox.addListener(() { 170 | setState(() {}); 171 | }); 172 | 173 | // Icons 174 | pushIconLikeUp = Tween(begin: 30.0, end: 60.0).animate( 175 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 176 | ); 177 | zoomIconLike = Tween(begin: 0.0, end: 1.0).animate( 178 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 179 | ); 180 | 181 | pushIconLoveUp = Tween(begin: 30.0, end: 60.0).animate( 182 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 183 | ); 184 | zoomIconLove = Tween(begin: 0.0, end: 1.0).animate( 185 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 186 | ); 187 | 188 | pushIconHahaUp = Tween(begin: 30.0, end: 60.0).animate( 189 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 190 | ); 191 | zoomIconHaha = Tween(begin: 0.0, end: 1.0).animate( 192 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 193 | ); 194 | 195 | pushIconWowUp = Tween(begin: 30.0, end: 60.0).animate( 196 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 197 | ); 198 | zoomIconWow = Tween(begin: 0.0, end: 1.0).animate( 199 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 200 | ); 201 | 202 | pushIconSadUp = Tween(begin: 30.0, end: 60.0).animate( 203 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 204 | ); 205 | zoomIconSad = Tween(begin: 0.0, end: 1.0).animate( 206 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 207 | ); 208 | 209 | pushIconAngryUp = Tween(begin: 30.0, end: 60.0).animate( 210 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 211 | ); 212 | zoomIconAngry = Tween(begin: 0.0, end: 1.0).animate( 213 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 214 | ); 215 | 216 | pushIconLikeUp.addListener(() { 217 | setState(() {}); 218 | }); 219 | zoomIconLike.addListener(() { 220 | setState(() {}); 221 | }); 222 | pushIconLoveUp.addListener(() { 223 | setState(() {}); 224 | }); 225 | zoomIconLove.addListener(() { 226 | setState(() {}); 227 | }); 228 | pushIconHahaUp.addListener(() { 229 | setState(() {}); 230 | }); 231 | zoomIconHaha.addListener(() { 232 | setState(() {}); 233 | }); 234 | pushIconWowUp.addListener(() { 235 | setState(() {}); 236 | }); 237 | zoomIconWow.addListener(() { 238 | setState(() {}); 239 | }); 240 | pushIconSadUp.addListener(() { 241 | setState(() {}); 242 | }); 243 | zoomIconSad.addListener(() { 244 | setState(() {}); 245 | }); 246 | pushIconAngryUp.addListener(() { 247 | setState(() {}); 248 | }); 249 | zoomIconAngry.addListener(() { 250 | setState(() {}); 251 | }); 252 | } 253 | 254 | initAnimationIconWhenDrag() { 255 | animControlIconWhenDrag = 256 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationIconWhenDrag)); 257 | 258 | zoomIconChosen = Tween(begin: 1.0, end: 1.8).animate(animControlIconWhenDrag); 259 | zoomIconNotChosen = Tween(begin: 1.0, end: 0.8).animate(animControlIconWhenDrag); 260 | zoomBoxIcon = Tween(begin: 50.0, end: 40.0).animate(animControlIconWhenDrag); 261 | 262 | zoomIconChosen.addListener(() { 263 | setState(() {}); 264 | }); 265 | zoomIconNotChosen.addListener(() { 266 | setState(() {}); 267 | }); 268 | zoomBoxIcon.addListener(() { 269 | setState(() {}); 270 | }); 271 | } 272 | 273 | initAnimationIconWhenDragOutside() { 274 | animControlIconWhenDragOutside = 275 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationIconWhenDrag)); 276 | zoomIconWhenDragOutside = Tween(begin: 0.8, end: 1.0).animate(animControlIconWhenDragOutside); 277 | zoomIconWhenDragOutside.addListener(() { 278 | setState(() {}); 279 | }); 280 | } 281 | 282 | initAnimationBoxWhenDragOutside() { 283 | animControlBoxWhenDragOutside = 284 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationIconWhenDrag)); 285 | zoomBoxWhenDragOutside = Tween(begin: 40.0, end: 50.0).animate(animControlBoxWhenDragOutside); 286 | zoomBoxWhenDragOutside.addListener(() { 287 | setState(() {}); 288 | }); 289 | } 290 | 291 | initAnimationIconWhenDragInside() { 292 | animControlIconWhenDragInside = 293 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationIconWhenDrag)); 294 | zoomIconWhenDragInside = Tween(begin: 1.0, end: 0.8).animate(animControlIconWhenDragInside); 295 | zoomIconWhenDragInside.addListener(() { 296 | setState(() {}); 297 | }); 298 | animControlIconWhenDragInside.addStatusListener((status) { 299 | if (status == AnimationStatus.completed) { 300 | isJustDragInside = false; 301 | } 302 | }); 303 | } 304 | 305 | initAnimationIconWhenRelease() { 306 | animControlIconWhenRelease = 307 | AnimationController(vsync: this, duration: Duration(milliseconds: durationAnimationIconWhenRelease)); 308 | 309 | zoomIconWhenRelease = Tween(begin: 1.8, end: 0.0) 310 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 311 | 312 | moveUpIconWhenRelease = Tween(begin: 180.0, end: 0.0) 313 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 314 | 315 | moveLeftIconLikeWhenRelease = Tween(begin: 20.0, end: 10.0) 316 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 317 | moveLeftIconLoveWhenRelease = Tween(begin: 68.0, end: 10.0) 318 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 319 | moveLeftIconHahaWhenRelease = Tween(begin: 116.0, end: 10.0) 320 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 321 | moveLeftIconWowWhenRelease = Tween(begin: 164.0, end: 10.0) 322 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 323 | moveLeftIconSadWhenRelease = Tween(begin: 212.0, end: 10.0) 324 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 325 | moveLeftIconAngryWhenRelease = Tween(begin: 260.0, end: 10.0) 326 | .animate(CurvedAnimation(parent: animControlIconWhenRelease, curve: Curves.decelerate)); 327 | 328 | zoomIconWhenRelease.addListener(() { 329 | setState(() {}); 330 | }); 331 | moveUpIconWhenRelease.addListener(() { 332 | setState(() {}); 333 | }); 334 | 335 | moveLeftIconLikeWhenRelease.addListener(() { 336 | setState(() {}); 337 | }); 338 | moveLeftIconLoveWhenRelease.addListener(() { 339 | setState(() {}); 340 | }); 341 | moveLeftIconHahaWhenRelease.addListener(() { 342 | setState(() {}); 343 | }); 344 | moveLeftIconWowWhenRelease.addListener(() { 345 | setState(() {}); 346 | }); 347 | moveLeftIconSadWhenRelease.addListener(() { 348 | setState(() {}); 349 | }); 350 | moveLeftIconAngryWhenRelease.addListener(() { 351 | setState(() {}); 352 | }); 353 | } 354 | 355 | @override 356 | void dispose() { 357 | super.dispose(); 358 | animControlBtnLongPress.dispose(); 359 | animControlBox.dispose(); 360 | animControlIconWhenDrag.dispose(); 361 | animControlIconWhenDragInside.dispose(); 362 | animControlIconWhenDragOutside.dispose(); 363 | animControlBoxWhenDragOutside.dispose(); 364 | animControlIconWhenRelease.dispose(); 365 | } 366 | 367 | @override 368 | Widget build(BuildContext context) { 369 | return GestureDetector( 370 | child: Column( 371 | children: [ 372 | // Just a top space 373 | Container( 374 | width: double.infinity, 375 | height: 100.0, 376 | ), 377 | 378 | // main content 379 | Container( 380 | child: Stack( 381 | children: [ 382 | // Box and icons 383 | Stack( 384 | children: [ 385 | // Box 386 | renderBox(), 387 | 388 | // Icons 389 | renderIcons(), 390 | ], 391 | alignment: Alignment.bottomCenter, 392 | ), 393 | 394 | // Button like 395 | renderBtnLike(), 396 | 397 | // Icons when jump 398 | // Icon like 399 | whichIconUserChoose == 1 && !isDragging 400 | ? Container( 401 | child: Transform.scale( 402 | child: Image.asset( 403 | 'assets/img/like.gif', 404 | width: 40.0, 405 | height: 40.0, 406 | ), 407 | scale: this.zoomIconWhenRelease.value, 408 | ), 409 | margin: EdgeInsets.only( 410 | top: processTopPosition(this.moveUpIconWhenRelease.value), 411 | left: this.moveLeftIconLikeWhenRelease.value, 412 | ), 413 | ) 414 | : Container(), 415 | 416 | // Icon love 417 | whichIconUserChoose == 2 && !isDragging 418 | ? Container( 419 | child: Transform.scale( 420 | child: Image.asset( 421 | 'assets/img/love.gif', 422 | width: 40.0, 423 | height: 40.0, 424 | ), 425 | scale: this.zoomIconWhenRelease.value, 426 | ), 427 | margin: EdgeInsets.only( 428 | top: processTopPosition(this.moveUpIconWhenRelease.value), 429 | left: this.moveLeftIconLoveWhenRelease.value, 430 | ), 431 | ) 432 | : Container(), 433 | 434 | // Icon haha 435 | whichIconUserChoose == 3 && !isDragging 436 | ? Container( 437 | child: Transform.scale( 438 | child: Image.asset( 439 | 'assets/img/haha.gif', 440 | width: 40.0, 441 | height: 40.0, 442 | ), 443 | scale: this.zoomIconWhenRelease.value, 444 | ), 445 | margin: EdgeInsets.only( 446 | top: processTopPosition(this.moveUpIconWhenRelease.value), 447 | left: this.moveLeftIconHahaWhenRelease.value, 448 | ), 449 | ) 450 | : Container(), 451 | 452 | // Icon Wow 453 | whichIconUserChoose == 4 && !isDragging 454 | ? Container( 455 | child: Transform.scale( 456 | child: Image.asset( 457 | 'assets/img/wow.gif', 458 | width: 40.0, 459 | height: 40.0, 460 | ), 461 | scale: this.zoomIconWhenRelease.value, 462 | ), 463 | margin: EdgeInsets.only( 464 | top: processTopPosition(this.moveUpIconWhenRelease.value), 465 | left: this.moveLeftIconWowWhenRelease.value, 466 | ), 467 | ) 468 | : Container(), 469 | 470 | // Icon sad 471 | whichIconUserChoose == 5 && !isDragging 472 | ? Container( 473 | child: Transform.scale( 474 | child: Image.asset( 475 | 'assets/img/sad.gif', 476 | width: 40.0, 477 | height: 40.0, 478 | ), 479 | scale: this.zoomIconWhenRelease.value, 480 | ), 481 | margin: EdgeInsets.only( 482 | top: processTopPosition(this.moveUpIconWhenRelease.value), 483 | left: this.moveLeftIconSadWhenRelease.value, 484 | ), 485 | ) 486 | : Container(), 487 | 488 | // Icon angry 489 | whichIconUserChoose == 6 && !isDragging 490 | ? Container( 491 | child: Transform.scale( 492 | child: Image.asset( 493 | 'assets/img/angry.gif', 494 | width: 40.0, 495 | height: 40.0, 496 | ), 497 | scale: this.zoomIconWhenRelease.value, 498 | ), 499 | margin: EdgeInsets.only( 500 | top: processTopPosition(this.moveUpIconWhenRelease.value), 501 | left: this.moveLeftIconAngryWhenRelease.value, 502 | ), 503 | ) 504 | : Container(), 505 | ], 506 | ), 507 | margin: EdgeInsets.only(left: 20.0, right: 20.0), 508 | // Area of the content can drag 509 | // decoration: BoxDecoration(border: Border.all(color: Colors.grey)), 510 | width: double.infinity, 511 | height: 350.0, 512 | ), 513 | ], 514 | ), 515 | onHorizontalDragEnd: onHorizontalDragEndBoxIcon, 516 | onHorizontalDragUpdate: onHorizontalDragUpdateBoxIcon, 517 | ); 518 | } 519 | 520 | Widget renderBox() { 521 | return Opacity( 522 | child: Container( 523 | decoration: BoxDecoration( 524 | color: Colors.white, 525 | borderRadius: BorderRadius.circular(30.0), 526 | border: Border.all(color: Colors.grey[300], width: 0.3), 527 | boxShadow: [ 528 | BoxShadow( 529 | color: Colors.grey, 530 | blurRadius: 5.0, 531 | // LTRB 532 | offset: Offset.lerp(Offset(0.0, 0.0), Offset(0.0, 0.5), 10.0)), 533 | ], 534 | ), 535 | width: 300.0, 536 | height: isDragging 537 | ? (previousIconFocus == 0 ? this.zoomBoxIcon.value : 40.0) 538 | : isDraggingOutside ? this.zoomBoxWhenDragOutside.value : 50.0, 539 | margin: EdgeInsets.only(bottom: 130.0, left: 10.0), 540 | ), 541 | opacity: this.fadeInBox.value, 542 | ); 543 | } 544 | 545 | Widget renderIcons() { 546 | return Container( 547 | child: Row( 548 | children: [ 549 | // icon like 550 | Transform.scale( 551 | child: Container( 552 | child: Column( 553 | children: [ 554 | currentIconFocus == 1 555 | ? Container( 556 | child: Text( 557 | 'Like', 558 | style: TextStyle(fontSize: 8.0, color: Colors.white), 559 | ), 560 | decoration: BoxDecoration( 561 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 562 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 563 | margin: EdgeInsets.only(bottom: 8.0), 564 | ) 565 | : Container(), 566 | Image.asset( 567 | 'assets/img/like.gif', 568 | width: 40.0, 569 | height: 40.0, 570 | fit: BoxFit.contain, 571 | ), 572 | ], 573 | ), 574 | margin: EdgeInsets.only(bottom: pushIconLikeUp.value), 575 | width: 40.0, 576 | height: currentIconFocus == 1 ? 70.0 : 40.0, 577 | ), 578 | scale: isDragging 579 | ? (currentIconFocus == 1 580 | ? this.zoomIconChosen.value 581 | : (previousIconFocus == 1 582 | ? this.zoomIconNotChosen.value 583 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 584 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconLike.value, 585 | ), 586 | 587 | // icon love 588 | Transform.scale( 589 | child: Container( 590 | child: Column( 591 | children: [ 592 | currentIconFocus == 2 593 | ? Container( 594 | child: Text( 595 | 'Love', 596 | style: TextStyle(fontSize: 8.0, color: Colors.white), 597 | ), 598 | decoration: BoxDecoration( 599 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 600 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 601 | margin: EdgeInsets.only(bottom: 8.0), 602 | ) 603 | : Container(), 604 | Image.asset( 605 | 'assets/img/love.gif', 606 | width: 40.0, 607 | height: 40.0, 608 | fit: BoxFit.contain, 609 | ), 610 | ], 611 | ), 612 | margin: EdgeInsets.only(bottom: pushIconLoveUp.value), 613 | width: 40.0, 614 | height: currentIconFocus == 2 ? 70.0 : 40.0, 615 | ), 616 | scale: isDragging 617 | ? (currentIconFocus == 2 618 | ? this.zoomIconChosen.value 619 | : (previousIconFocus == 2 620 | ? this.zoomIconNotChosen.value 621 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 622 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconLove.value, 623 | ), 624 | 625 | // icon haha 626 | Transform.scale( 627 | child: Container( 628 | child: Column( 629 | children: [ 630 | currentIconFocus == 3 631 | ? Container( 632 | child: Text( 633 | 'Haha', 634 | style: TextStyle(fontSize: 8.0, color: Colors.white), 635 | ), 636 | decoration: BoxDecoration( 637 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 638 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 639 | margin: EdgeInsets.only(bottom: 8.0), 640 | ) 641 | : Container(), 642 | Image.asset( 643 | 'assets/img/haha.gif', 644 | width: 40.0, 645 | height: 40.0, 646 | fit: BoxFit.contain, 647 | ), 648 | ], 649 | ), 650 | margin: EdgeInsets.only(bottom: pushIconHahaUp.value), 651 | width: 40.0, 652 | height: currentIconFocus == 3 ? 70.0 : 40.0, 653 | ), 654 | scale: isDragging 655 | ? (currentIconFocus == 3 656 | ? this.zoomIconChosen.value 657 | : (previousIconFocus == 3 658 | ? this.zoomIconNotChosen.value 659 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 660 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconHaha.value, 661 | ), 662 | 663 | // icon wow 664 | Transform.scale( 665 | child: Container( 666 | child: Column( 667 | children: [ 668 | currentIconFocus == 4 669 | ? Container( 670 | child: Text( 671 | 'Wow', 672 | style: TextStyle(fontSize: 8.0, color: Colors.white), 673 | ), 674 | decoration: BoxDecoration( 675 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 676 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 677 | margin: EdgeInsets.only(bottom: 8.0), 678 | ) 679 | : Container(), 680 | Image.asset( 681 | 'assets/img/wow.gif', 682 | width: 40.0, 683 | height: 40.0, 684 | fit: BoxFit.contain, 685 | ), 686 | ], 687 | ), 688 | margin: EdgeInsets.only(bottom: pushIconWowUp.value), 689 | width: 40.0, 690 | height: currentIconFocus == 4 ? 70.0 : 40.0, 691 | ), 692 | scale: isDragging 693 | ? (currentIconFocus == 4 694 | ? this.zoomIconChosen.value 695 | : (previousIconFocus == 4 696 | ? this.zoomIconNotChosen.value 697 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 698 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconWow.value, 699 | ), 700 | 701 | // icon sad 702 | Transform.scale( 703 | child: Container( 704 | child: Column( 705 | children: [ 706 | currentIconFocus == 5 707 | ? Container( 708 | child: Text( 709 | 'Sad', 710 | style: TextStyle(fontSize: 8.0, color: Colors.white), 711 | ), 712 | decoration: BoxDecoration( 713 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 714 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 715 | margin: EdgeInsets.only(bottom: 8.0), 716 | ) 717 | : Container(), 718 | Image.asset( 719 | 'assets/img/sad.gif', 720 | width: 40.0, 721 | height: 40.0, 722 | fit: BoxFit.contain, 723 | ), 724 | ], 725 | ), 726 | margin: EdgeInsets.only(bottom: pushIconSadUp.value), 727 | width: 40.0, 728 | height: currentIconFocus == 5 ? 70.0 : 40.0, 729 | ), 730 | scale: isDragging 731 | ? (currentIconFocus == 5 732 | ? this.zoomIconChosen.value 733 | : (previousIconFocus == 5 734 | ? this.zoomIconNotChosen.value 735 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 736 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconSad.value, 737 | ), 738 | 739 | // icon angry 740 | Transform.scale( 741 | child: Container( 742 | child: Column( 743 | children: [ 744 | currentIconFocus == 6 745 | ? Container( 746 | child: Text( 747 | 'Angry', 748 | style: TextStyle(fontSize: 8.0, color: Colors.white), 749 | ), 750 | decoration: BoxDecoration( 751 | borderRadius: BorderRadius.circular(10.0), color: Colors.black.withOpacity(0.3)), 752 | padding: EdgeInsets.only(left: 7.0, right: 7.0, top: 2.0, bottom: 2.0), 753 | margin: EdgeInsets.only(bottom: 8.0), 754 | ) 755 | : Container(), 756 | Image.asset( 757 | 'assets/img/angry.gif', 758 | width: 40.0, 759 | height: 40.0, 760 | fit: BoxFit.contain, 761 | ), 762 | ], 763 | ), 764 | margin: EdgeInsets.only(bottom: pushIconAngryUp.value), 765 | width: 40.0, 766 | height: currentIconFocus == 6 ? 70.0 : 40.0, 767 | ), 768 | scale: isDragging 769 | ? (currentIconFocus == 6 770 | ? this.zoomIconChosen.value 771 | : (previousIconFocus == 6 772 | ? this.zoomIconNotChosen.value 773 | : isJustDragInside ? this.zoomIconWhenDragInside.value : 0.8)) 774 | : isDraggingOutside ? this.zoomIconWhenDragOutside.value : this.zoomIconAngry.value, 775 | ), 776 | ], 777 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 778 | crossAxisAlignment: CrossAxisAlignment.center, 779 | ), 780 | width: 300.0, 781 | height: 250.0, 782 | margin: EdgeInsets.only(left: this.moveRightGroupIcon.value, top: 50.0), 783 | // uncomment here to see area of draggable 784 | // color: Colors.amber.withOpacity(0.5), 785 | ); 786 | } 787 | 788 | Widget renderBtnLike() { 789 | return Container( 790 | child: GestureDetector( 791 | onTapDown: onTapDownBtn, 792 | onTapUp: onTapUpBtn, 793 | onTap: onTapBtn, 794 | child: Container( 795 | child: Row( 796 | children: [ 797 | // Icon like 798 | Transform.scale( 799 | child: Transform.rotate( 800 | child: Image.asset( 801 | getImageIconBtn(), 802 | width: 25.0, 803 | height: 25.0, 804 | fit: BoxFit.contain, 805 | color: getTintColorIconBtn(), 806 | ), 807 | angle: 808 | !isLongPress ? handleOutputRangeTiltIconLike(tiltIconLikeInBtn2.value) : tiltIconLikeInBtn.value, 809 | ), 810 | scale: 811 | !isLongPress ? handleOutputRangeZoomInIconLike(zoomIconLikeInBtn2.value) : zoomIconLikeInBtn.value, 812 | ), 813 | 814 | // Text like 815 | Transform.scale( 816 | child: Text( 817 | getTextBtn(), 818 | style: TextStyle( 819 | color: getColorTextBtn(), 820 | fontSize: 14.0, 821 | fontWeight: FontWeight.bold, 822 | ), 823 | ), 824 | scale: 825 | !isLongPress ? handleOutputRangeZoomInIconLike(zoomIconLikeInBtn2.value) : zoomTextLikeInBtn.value, 826 | ), 827 | ], 828 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 829 | ), 830 | padding: EdgeInsets.all(10.0), 831 | color: Colors.transparent, 832 | ), 833 | ), 834 | width: 100.0, 835 | decoration: BoxDecoration( 836 | borderRadius: BorderRadius.circular(4.0), 837 | color: Colors.white, 838 | border: Border.all(color: getColorBorderBtn()), 839 | ), 840 | margin: EdgeInsets.only(top: 190.0), 841 | ); 842 | } 843 | 844 | String getTextBtn() { 845 | if (isDragging) { 846 | return 'Like'; 847 | } 848 | switch (whichIconUserChoose) { 849 | case 1: 850 | return 'Like'; 851 | case 2: 852 | return 'Love'; 853 | case 3: 854 | return 'Haha'; 855 | case 4: 856 | return 'Wow'; 857 | case 5: 858 | return 'Sad'; 859 | case 6: 860 | return 'Angry'; 861 | default: 862 | return 'Like'; 863 | } 864 | } 865 | 866 | Color getColorTextBtn() { 867 | if ((!isLongPress && isLiked)) { 868 | return Color(0xff3b5998); 869 | } else if (!isDragging) { 870 | switch (whichIconUserChoose) { 871 | case 1: 872 | return Color(0xff3b5998); 873 | case 2: 874 | return Color(0xffED5167); 875 | case 3: 876 | case 4: 877 | case 5: 878 | return Color(0xffFFD96A); 879 | case 6: 880 | return Color(0xffF6876B); 881 | default: 882 | return Colors.grey; 883 | } 884 | } else { 885 | return Colors.grey; 886 | } 887 | } 888 | 889 | String getImageIconBtn() { 890 | if (!isLongPress && isLiked) { 891 | return 'images/ic_like_fill.png'; 892 | } else if (!isDragging) { 893 | switch (whichIconUserChoose) { 894 | case 1: 895 | return 'assets/img/ic_like_fill.png'; 896 | case 2: 897 | return 'assets/img/love2.png'; 898 | case 3: 899 | return 'assets/img/haha2.png'; 900 | case 4: 901 | return 'assets/img/wow2.png'; 902 | case 5: 903 | return 'assets/img/sad2.png'; 904 | case 6: 905 | return 'assets/img/angry2.png'; 906 | default: 907 | return 'assets/img/ic_like.png'; 908 | } 909 | } else { 910 | return 'assets/img/ic_like.png'; 911 | } 912 | } 913 | 914 | Color getTintColorIconBtn() { 915 | if (!isLongPress && isLiked) { 916 | return Color(0xff3b5998); 917 | } else if (!isDragging && whichIconUserChoose != 0) { 918 | return null; 919 | } else { 920 | return Colors.grey; 921 | } 922 | } 923 | 924 | double processTopPosition(double value) { 925 | // margin top 100 -> 40 -> 160 (value from 180 -> 0) 926 | if (value >= 120.0) { 927 | return value - 80.0; 928 | } else { 929 | return 160.0 - value; 930 | } 931 | } 932 | 933 | Color getColorBorderBtn() { 934 | if ((!isLongPress && isLiked)) { 935 | return Color(0xff3b5998); 936 | } else if (!isDragging) { 937 | switch (whichIconUserChoose) { 938 | case 1: 939 | return Color(0xff3b5998); 940 | case 2: 941 | return Color(0xffED5167); 942 | case 3: 943 | case 4: 944 | case 5: 945 | return Color(0xffFFD96A); 946 | case 6: 947 | return Color(0xffF6876B); 948 | default: 949 | return Colors.grey; 950 | } 951 | } else { 952 | return Colors.grey[400]; 953 | } 954 | } 955 | 956 | void onHorizontalDragEndBoxIcon(DragEndDetails dragEndDetail) { 957 | isDragging = false; 958 | isDraggingOutside = false; 959 | isJustDragInside = true; 960 | previousIconFocus = 0; 961 | currentIconFocus = 0; 962 | 963 | onTapUpBtn(null); 964 | } 965 | 966 | void onHorizontalDragUpdateBoxIcon(DragUpdateDetails dragUpdateDetail) { 967 | // return if the drag is drag without press button 968 | if (!isLongPress) return; 969 | 970 | // the margin top the box is 150 971 | // and plus the height of toolbar and the status bar 972 | // so the range we check is about 200 -> 500 973 | 974 | if (dragUpdateDetail.globalPosition.dy >= 200 && dragUpdateDetail.globalPosition.dy <= 500) { 975 | isDragging = true; 976 | isDraggingOutside = false; 977 | 978 | if (isJustDragInside && !animControlIconWhenDragInside.isAnimating) { 979 | animControlIconWhenDragInside.reset(); 980 | animControlIconWhenDragInside.forward(); 981 | } 982 | 983 | if (dragUpdateDetail.globalPosition.dx >= 20 && dragUpdateDetail.globalPosition.dx < 83) { 984 | if (currentIconFocus != 1) { 985 | handleWhenDragBetweenIcon(1); 986 | } 987 | } else if (dragUpdateDetail.globalPosition.dx >= 83 && dragUpdateDetail.globalPosition.dx < 126) { 988 | if (currentIconFocus != 2) { 989 | handleWhenDragBetweenIcon(2); 990 | } 991 | } else if (dragUpdateDetail.globalPosition.dx >= 126 && dragUpdateDetail.globalPosition.dx < 180) { 992 | if (currentIconFocus != 3) { 993 | handleWhenDragBetweenIcon(3); 994 | } 995 | } else if (dragUpdateDetail.globalPosition.dx >= 180 && dragUpdateDetail.globalPosition.dx < 233) { 996 | if (currentIconFocus != 4) { 997 | handleWhenDragBetweenIcon(4); 998 | } 999 | } else if (dragUpdateDetail.globalPosition.dx >= 233 && dragUpdateDetail.globalPosition.dx < 286) { 1000 | if (currentIconFocus != 5) { 1001 | handleWhenDragBetweenIcon(5); 1002 | } 1003 | } else if (dragUpdateDetail.globalPosition.dx >= 286 && dragUpdateDetail.globalPosition.dx < 340) { 1004 | if (currentIconFocus != 6) { 1005 | handleWhenDragBetweenIcon(6); 1006 | } 1007 | } 1008 | } else { 1009 | whichIconUserChoose = 0; 1010 | previousIconFocus = 0; 1011 | currentIconFocus = 0; 1012 | isJustDragInside = true; 1013 | 1014 | if (isDragging && !isDraggingOutside) { 1015 | isDragging = false; 1016 | isDraggingOutside = true; 1017 | animControlIconWhenDragOutside.reset(); 1018 | animControlIconWhenDragOutside.forward(); 1019 | animControlBoxWhenDragOutside.reset(); 1020 | animControlBoxWhenDragOutside.forward(); 1021 | } 1022 | } 1023 | } 1024 | 1025 | void handleWhenDragBetweenIcon(int currentIcon) { 1026 | playSound('icon_focus.mp3'); 1027 | whichIconUserChoose = currentIcon; 1028 | previousIconFocus = currentIconFocus; 1029 | currentIconFocus = currentIcon; 1030 | animControlIconWhenDrag.reset(); 1031 | animControlIconWhenDrag.forward(); 1032 | } 1033 | 1034 | void onTapDownBtn(TapDownDetails tapDownDetail) { 1035 | holdTimer = Timer(durationLongPress, showBox); 1036 | } 1037 | 1038 | void onTapUpBtn(TapUpDetails tapUpDetail) { 1039 | if (isLongPress) { 1040 | if (whichIconUserChoose == 0) { 1041 | playSound('box_down.mp3'); 1042 | } else { 1043 | playSound('icon_choose.mp3'); 1044 | } 1045 | } 1046 | 1047 | Timer(Duration(milliseconds: durationAnimationBox), () { 1048 | isLongPress = false; 1049 | }); 1050 | 1051 | holdTimer.cancel(); 1052 | 1053 | animControlBtnLongPress.reverse(); 1054 | 1055 | setReverseValue(); 1056 | animControlBox.reverse(); 1057 | 1058 | animControlIconWhenRelease.reset(); 1059 | animControlIconWhenRelease.forward(); 1060 | } 1061 | 1062 | // when user short press the button 1063 | void onTapBtn() { 1064 | if (!isLongPress) { 1065 | if (whichIconUserChoose == 0) { 1066 | isLiked = !isLiked; 1067 | } else { 1068 | whichIconUserChoose = 0; 1069 | } 1070 | if (isLiked) { 1071 | playSound('short_press_like.mp3'); 1072 | animControlBtnShortPress.forward(); 1073 | } else { 1074 | animControlBtnShortPress.reverse(); 1075 | } 1076 | } 1077 | } 1078 | 1079 | double handleOutputRangeZoomInIconLike(double value) { 1080 | if (value >= 0.8) { 1081 | return value; 1082 | } else if (value >= 0.4) { 1083 | return 1.6 - value; 1084 | } else { 1085 | return 0.8 + value; 1086 | } 1087 | } 1088 | 1089 | double handleOutputRangeTiltIconLike(double value) { 1090 | if (value <= 0.2) { 1091 | return value; 1092 | } else if (value <= 0.6) { 1093 | return 0.4 - value; 1094 | } else { 1095 | return -(0.8 - value); 1096 | } 1097 | } 1098 | 1099 | void showBox() { 1100 | playSound('box_up.mp3'); 1101 | isLongPress = true; 1102 | 1103 | animControlBtnLongPress.forward(); 1104 | 1105 | setForwardValue(); 1106 | animControlBox.forward(); 1107 | } 1108 | 1109 | // We need to set the value for reverse because if not 1110 | // the angry-icon will be pulled down first, not the like-icon 1111 | void setReverseValue() { 1112 | // Icons 1113 | pushIconLikeUp = Tween(begin: 30.0, end: 60.0).animate( 1114 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 1115 | ); 1116 | zoomIconLike = Tween(begin: 0.0, end: 1.0).animate( 1117 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 1118 | ); 1119 | 1120 | pushIconLoveUp = Tween(begin: 30.0, end: 60.0).animate( 1121 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 1122 | ); 1123 | zoomIconLove = Tween(begin: 0.0, end: 1.0).animate( 1124 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 1125 | ); 1126 | 1127 | pushIconHahaUp = Tween(begin: 30.0, end: 60.0).animate( 1128 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 1129 | ); 1130 | zoomIconHaha = Tween(begin: 0.0, end: 1.0).animate( 1131 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 1132 | ); 1133 | 1134 | pushIconWowUp = Tween(begin: 30.0, end: 60.0).animate( 1135 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 1136 | ); 1137 | zoomIconWow = Tween(begin: 0.0, end: 1.0).animate( 1138 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 1139 | ); 1140 | 1141 | pushIconSadUp = Tween(begin: 30.0, end: 60.0).animate( 1142 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 1143 | ); 1144 | zoomIconSad = Tween(begin: 0.0, end: 1.0).animate( 1145 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 1146 | ); 1147 | 1148 | pushIconAngryUp = Tween(begin: 30.0, end: 60.0).animate( 1149 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 1150 | ); 1151 | zoomIconAngry = Tween(begin: 0.0, end: 1.0).animate( 1152 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 1153 | ); 1154 | } 1155 | 1156 | // When set the reverse value, we need set value to normal for the forward 1157 | void setForwardValue() { 1158 | // Icons 1159 | pushIconLikeUp = Tween(begin: 30.0, end: 60.0).animate( 1160 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 1161 | ); 1162 | zoomIconLike = Tween(begin: 0.0, end: 1.0).animate( 1163 | CurvedAnimation(parent: animControlBox, curve: Interval(0.0, 0.5)), 1164 | ); 1165 | 1166 | pushIconLoveUp = Tween(begin: 30.0, end: 60.0).animate( 1167 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 1168 | ); 1169 | zoomIconLove = Tween(begin: 0.0, end: 1.0).animate( 1170 | CurvedAnimation(parent: animControlBox, curve: Interval(0.1, 0.6)), 1171 | ); 1172 | 1173 | pushIconHahaUp = Tween(begin: 30.0, end: 60.0).animate( 1174 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 1175 | ); 1176 | zoomIconHaha = Tween(begin: 0.0, end: 1.0).animate( 1177 | CurvedAnimation(parent: animControlBox, curve: Interval(0.2, 0.7)), 1178 | ); 1179 | 1180 | pushIconWowUp = Tween(begin: 30.0, end: 60.0).animate( 1181 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 1182 | ); 1183 | zoomIconWow = Tween(begin: 0.0, end: 1.0).animate( 1184 | CurvedAnimation(parent: animControlBox, curve: Interval(0.3, 0.8)), 1185 | ); 1186 | 1187 | pushIconSadUp = Tween(begin: 30.0, end: 60.0).animate( 1188 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 1189 | ); 1190 | zoomIconSad = Tween(begin: 0.0, end: 1.0).animate( 1191 | CurvedAnimation(parent: animControlBox, curve: Interval(0.4, 0.9)), 1192 | ); 1193 | 1194 | pushIconAngryUp = Tween(begin: 30.0, end: 60.0).animate( 1195 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 1196 | ); 1197 | zoomIconAngry = Tween(begin: 0.0, end: 1.0).animate( 1198 | CurvedAnimation(parent: animControlBox, curve: Interval(0.5, 1.0)), 1199 | ); 1200 | } 1201 | 1202 | Future playSound(String nameSound) async { 1203 | // Sometimes multiple sound will play the same time, so we'll stop all before play the 1204 | await audioPlayer.stop(); 1205 | final file = File('${(await getTemporaryDirectory()).path}/$nameSound'); 1206 | await file.writeAsBytes((await loadAsset(nameSound)).buffer.asUint8List()); 1207 | await audioPlayer.play(file.path, isLocal: true); 1208 | } 1209 | 1210 | Future loadAsset(String nameSound) async { 1211 | return await rootBundle.load('assets/sounds/$nameSound'); 1212 | } 1213 | } 1214 | -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/widgets/category_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:healthnest/ui/newsFeedPage/widgets/widgetFeed.dart'; 3 | 4 | class CategoryList extends StatefulWidget { 5 | 6 | CategoryList({Key key}) : super(key: key); 7 | 8 | @override 9 | _CategoryListState createState() => _CategoryListState(); 10 | } 11 | 12 | class _CategoryListState extends State { 13 | 14 | List listCategory = [ 15 | 'All posts', 16 | 'News', 17 | 'Doctor', 18 | 'Lifestyle', 19 | 'Symptom', 20 | 'Entertainment', 21 | 'Love' 22 | ]; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Container( 27 | child: ListView.builder( 28 | itemCount: listCategory.length, 29 | scrollDirection: Axis.horizontal, 30 | itemBuilder: (context, index) { 31 | return GestureDetector( 32 | onTap: () { 33 | debugPrint('${listCategory[index]} Tapped'); 34 | }, 35 | child: Container( 36 | padding: EdgeInsets.all(8), 37 | margin: EdgeInsets.all(8), 38 | decoration: index == 0 ? selectedBoxDecoration() : boxDecoration(), 39 | child: Text( 40 | listCategory[index], 41 | textAlign: TextAlign.center, 42 | style: TextStyle(color: Colors.teal, fontSize: 14), 43 | ), 44 | ), 45 | ); 46 | }), 47 | ); 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/widgets/feedBloc.dart: -------------------------------------------------------------------------------- 1 | // Bloc Pattern for the feed. 2 | // STEP-1: Imports 3 | // STEP-2: List of Feeds 4 | // STEP-3: Stream controller 5 | // STEP-4: Stream sink getter 6 | // STEP-5: Constructor - Add Likes, Listen to the changes 7 | // STEP-6: Core functions 8 | // STEP-7: Dispose 9 | //Stream Is Already Been Cooked In Flutter 10 | 11 | import 'dart:async'; 12 | 13 | 14 | class Feed { 15 | 16 | int feedId, type, likes; 17 | String title, description, category, subcategory, time, name, avatarImg, bannerImg, location, comments, members; 18 | 19 | Feed({this.feedId, this.type, this.title, this.description, this.category, this.subcategory, this.time, this.name, this.avatarImg, this.bannerImg, this.location, this.likes, this.comments, this.members}); 20 | } 21 | 22 | 23 | class QuestionModel { 24 | 25 | String question; 26 | 27 | QuestionModel({this.question}); 28 | } 29 | 30 | 31 | 32 | class Category { 33 | bool isSelected = false; 34 | String categoryType; 35 | 36 | Category({this.categoryType}); 37 | } 38 | 39 | 40 | class FeedBloc { 41 | 42 | 43 | List feedList = [ 44 | 45 | Feed( 46 | feedId: 1, 47 | type: 0, 48 | title: 'rohit.shetty12', 49 | description: 50 | 'I have been facing a few possible symptoms of skin cancer. I have googled the possibilities but i can thought i did asked the community instead...', 51 | category: 'DIET', 52 | subcategory: 'Asked a question', 53 | time: '1 min', 54 | name: 'What Are The Sign And Symptoms Of Skin Cancer?', 55 | avatarImg: 'https://www.w3schools.com/w3images/avatar1.png', 56 | bannerImg: 'https://www.w3schools.com/w3images/avatar1.png', 57 | location: 'Peninsula park Andheri, Mumbai', 58 | likes: 24, 59 | comments: '24', 60 | members: '24'), 61 | 62 | Feed( 63 | feedId: 2, 64 | type: 0, 65 | title: 'rohit.shetty02', 66 | description: 67 | 'My husband has his 3 days transpalnt assessment in Newcastle next month, strange mix of emotions. for those that have been thought this how long did it take following assessment was it intil you were t...', 68 | category: 'DIET', 69 | subcategory: 'Asked a question', 70 | time: '10 min', 71 | name: '', 72 | avatarImg: 'https://www.w3schools.com/w3images/avatar1.png', 73 | bannerImg: 'https://www.w3schools.com/w3images/avatar1.png', 74 | location: 'Peninsula park Andheri, Mumbai', 75 | likes: 23, 76 | comments: '2', 77 | members: '12'), 78 | 79 | Feed( 80 | feedId: 3, 81 | type: 0, 82 | title: 'username1275', 83 | description: '', 84 | category: 'DIET', 85 | subcategory: 'Asked a question', 86 | time: '10 min', 87 | name: 'Cancer Meet At Rajiv Gandhi National Park', 88 | avatarImg: 'https://www.w3schools.com/w3images/avatar1.png', 89 | bannerImg: 'https://www.w3schools.com/w3images/avatar1.png', 90 | location: 'Peninsula park Andheri, Mumbai', 91 | likes: 23, 92 | comments: '2', 93 | members: '12'), 94 | 95 | Feed( 96 | feedId: 4, 97 | type: 0, 98 | title: 'super987', 99 | description: '#itsokeyto #cancerserviver', 100 | category: 'LIFESTYLE', 101 | subcategory: 'Asked a question', 102 | time: '10 min', 103 | name: 'Something To Motivate You', 104 | avatarImg: 'https://www.w3schools.com/w3images/avatar4.png', 105 | bannerImg: 'https://www.w3schools.com/w3images/avatar4.png', 106 | location: 'Peninsula park Andheri, Mumbai', 107 | likes: 25, 108 | comments: '24', 109 | members: '18'), 110 | 111 | Feed( 112 | feedId: 5, 113 | type: 0, 114 | title: 'username1275', 115 | description: '#itsokeyto #cancerserviver', 116 | category: 'LIFESTYLE', 117 | subcategory: 'created a poll', 118 | time: '1 min', 119 | name: 'What is the best hospital in india for the cancer?', 120 | avatarImg: 'https://www.w3schools.com/w3images/avatar4.png', 121 | bannerImg: 'https://www.w3schools.com/w3images/avatar4.png', 122 | location: 'Peninsula park Andheri, Mumbai', 123 | likes: 25, 124 | comments: '24', 125 | members: '18'), 126 | ]; 127 | 128 | 129 | // 2. Stream controller 130 | final _feedListStreamController = StreamController>(); 131 | final _feedLikeIncrementController = StreamController(); 132 | final _feedLikeDecrementController = StreamController(); 133 | 134 | // 3. Stream Sink Getter 135 | Stream> get feedListStream => _feedListStreamController.stream; 136 | StreamSink> get feedListSink => _feedListStreamController.sink; 137 | 138 | StreamSink get feedLikeIncrement => _feedLikeIncrementController.sink; 139 | StreamSink get feedLikeDecrement => _feedLikeDecrementController.sink; 140 | 141 | // Constructor 142 | FeedBloc() 143 | { 144 | _feedListStreamController.add(feedList); 145 | _feedLikeIncrementController.stream.listen(_incrementLike); 146 | _feedLikeDecrementController.stream.listen(_decrementLike); 147 | } 148 | 149 | _incrementLike(Feed feed) 150 | { 151 | int like = feed.likes; 152 | int incrementLike = like + 1; 153 | feedList[feed.feedId - 1].likes = like + incrementLike; 154 | feedListSink.add(feedList); 155 | } 156 | 157 | _decrementLike(Feed feed) 158 | { 159 | int like = feed.likes; 160 | int decrementLike = like - 1; 161 | feedList[feed.feedId - 1].likes = like - decrementLike; 162 | feedListSink.add(feedList); 163 | } 164 | 165 | dispose() 166 | { 167 | _feedLikeDecrementController.close(); 168 | _feedLikeIncrementController.close(); 169 | _feedListStreamController.close(); 170 | } 171 | } 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | // List _feedListModel = [ 189 | // Feed( 190 | // feedId: 1, 191 | // type: 0, 192 | // title: 'rohit.shetty02', 193 | // description: _descriptionIsLong, 194 | // category: 'Entertainment', 195 | // subcategory: 'Asked a question', 196 | // time: '21:29', 197 | // name: 'What Are The Sign And Symptoms Of Skin Cancer!', 198 | // avatarImg: 'https://www.w3schools.com/w3images/avatar1.png', 199 | // bannerImg: 'https://www.w3schools.com/w3images/avatar1.png', 200 | // location: 'Peninsula park Andheri, Mumbai', 201 | // likes: 23, 202 | // comments: '2', 203 | // members: '12'), 204 | // Feed( 205 | // feedId: 2, 206 | // type: 1, 207 | // title: 'ishaileshmishra', 208 | // description: _descriptionIsLong, 209 | // category: 'Medical', 210 | // subcategory: 'Asked a question', 211 | // time: '21:29', 212 | // name: 'What Are The Sign And Symptoms Of Skin Cancer !', 213 | // avatarImg: 'https://www.w3schools.com/w3images/avatar2.png', 214 | // bannerImg: 'https://www.w3schools.com/w3images/avatar2.png', 215 | // location: 'Peninsula park Andheri, Mumbai', 216 | // likes: 23, 217 | // comments: '2', 218 | // members: '12'), 219 | // Feed( 220 | // feedId: 3, 221 | // type: 0, 222 | // title: 'mahesh.rawat2121', 223 | // description: _descriptionIsLong, 224 | // category: 'Love', 225 | // subcategory: 'Asked a question', 226 | // time: '21:29', 227 | // name: 'What are the problem in love affairs', 228 | // avatarImg: 'https://www.w3schools.com/w3images/avatar3.png', 229 | // bannerImg: 'https://www.w3schools.com/w3images/avatar3.png', 230 | // location: 'virar, Thakur College, Mumbai', 231 | // likes: 23, 232 | // comments: '2', 233 | // members: '12'), 234 | // Feed( 235 | // feedId: 4, 236 | // type: 0, 237 | // title: 'rohit.mishra242', 238 | // description: _descriptionIsLong, 239 | // category: 'Jobs', 240 | // subcategory: 'Asked a question', 241 | // time: '21:29', 242 | // name: 'What Are The Sign And Symptoms Of Skin Cancer !', 243 | // avatarImg: 'https://www.w3schools.com/w3images/avatar4.png', 244 | // bannerImg: 'https://www.w3schools.com/w3images/avatar4.png', 245 | // location: 'Kandivali, lokhandwala, Mumbai', 246 | // likes: 23, 247 | // comments: '2', 248 | // members: '12'), 249 | // Feed( 250 | // feedId: 5, 251 | // type: 0, 252 | // title: 'ram.ramesh099', 253 | // description: 'Now that we’ve covered creating, manipulating and listening to streams, Let’s talk about how to put them to work with widgets in Flutter', 254 | // category: 'News', 255 | // subcategory: 'Information', 256 | // time: '21:29', 257 | // name: 'Using Text inside the StreamBuilder!', 258 | // avatarImg: 'https://www.w3schools.com/w3images/avatar5.png', 259 | // bannerImg: 'https://www.w3schools.com/w3images/avatar5.png', 260 | // location: 'Peninsula park Andheri, Mumbai', 261 | // likes: 23, 262 | // comments: '2', 263 | // members: '12'), 264 | // ]; -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/widgets/feedCard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 3 | import 'package:healthnest/ui/newsFeedPage/widgets/ThumsUpReactions.dart'; 4 | import 'package:healthnest/ui/newsFeedPage/widgets/feedBloc.dart'; 5 | import 'package:healthnest/postpage/postdetail_page.dart'; 6 | import 'package:share/share.dart'; 7 | 8 | Widget feedCard(BuildContext context, Feed listFeed) { 9 | return Card( 10 | child: GestureDetector( 11 | onTap: () => Navigator.push( 12 | context, MaterialPageRoute(builder: (context) => PostPageDetails())), 13 | child: Container( 14 | padding: EdgeInsets.all(8), 15 | child: Column( 16 | crossAxisAlignment: CrossAxisAlignment.start, 17 | children: [ 18 | renderCategoryTime(listFeed), 19 | space10(), 20 | userAvatarSection(context, listFeed), 21 | space15(), 22 | Text(listFeed.name, 23 | softWrap: true, 24 | maxLines: 2, 25 | style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), 26 | space15(), 27 | Text(listFeed.description, style: TextStyle(fontSize: 14, color: Colors.grey)), 28 | space15(), 29 | setLocation(listFeed), 30 | Divider(thickness: 1), 31 | Row( 32 | children: [ 33 | Icon(FontAwesomeIcons.addressBook), 34 | SizedBox(width: 10), 35 | Text( 36 | '${listFeed.members} Members have this questions', 37 | style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor), 38 | ), 39 | ], 40 | ), 41 | Divider(thickness: 1), 42 | SizedBox(height: 10), 43 | likeCommentShare(listFeed), 44 | space15(), 45 | ], 46 | )), 47 | ), 48 | ); 49 | } 50 | 51 | 52 | 53 | 54 | 55 | 56 | Widget likeCommentShare(Feed listFeed) { 57 | 58 | return Row( 59 | mainAxisAlignment: MainAxisAlignment.spaceAround, 60 | crossAxisAlignment: CrossAxisAlignment.center, 61 | children: [ 62 | GestureDetector( 63 | onTap: () { 64 | print('FB Reactions Tapped'); 65 | FbReactionBox(); 66 | }, 67 | child: Row( 68 | children: [ 69 | Icon( 70 | FontAwesomeIcons.thumbsUp, 71 | size: 18, 72 | ), 73 | SizedBox(width: 5), 74 | Text('${listFeed.likes}') 75 | ], 76 | )), 77 | Row( 78 | mainAxisAlignment: MainAxisAlignment.spaceAround, 79 | crossAxisAlignment: CrossAxisAlignment.center, 80 | children: [ 81 | GestureDetector( 82 | onTap: () => debugPrint('Comment Tapped'), 83 | child: Row( 84 | children: [ 85 | Icon(FontAwesomeIcons.comment, size: 18), 86 | SizedBox(width: 5), 87 | Text(listFeed.comments) 88 | ], 89 | )) 90 | ]), 91 | Icon(FontAwesomeIcons.bookmark, size: 18), 92 | GestureDetector( 93 | onTap: () { 94 | Share.share('check out my website https://example.com'); 95 | }, 96 | child: Icon(FontAwesomeIcons.shareAlt, size: 18)) 97 | ], 98 | ); 99 | } 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Widget setLocation(Feed listFeed) { 108 | return Row( 109 | children: [ 110 | Icon(Icons.location_on, color: Colors.teal), 111 | SizedBox(width: 15), 112 | Text( 113 | listFeed.location, 114 | style: TextStyle(fontSize: 12, color: Colors.teal), 115 | ), 116 | ], 117 | ); 118 | } 119 | 120 | Widget userAvatarSection(BuildContext context, Feed listFeed) { 121 | return Row( 122 | children: [ 123 | Expanded( 124 | child: Row( 125 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 126 | children: [ 127 | Row( 128 | children: [ 129 | CircleAvatar( 130 | backgroundColor: Colors.grey, 131 | child: ClipOval(child: Image.network(listFeed.avatarImg)), 132 | radius: 20), 133 | SizedBox(width: 10), 134 | Column( 135 | crossAxisAlignment: CrossAxisAlignment.start, 136 | children: [ 137 | Row( 138 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 139 | children: [ 140 | Text(listFeed.title, 141 | style: TextStyle( 142 | fontSize: 16, fontWeight: FontWeight.bold)), 143 | SizedBox( 144 | width: 10, 145 | ), 146 | Text(listFeed.subcategory, 147 | softWrap: true, 148 | style: TextStyle(fontSize: 14, color: Colors.grey)) 149 | ], 150 | ), 151 | SizedBox(height: 4), 152 | Text('DIAGNOSED RECENTALLY', 153 | style: TextStyle(fontSize: 12, color: Colors.teal)), 154 | ], 155 | ) 156 | ], 157 | ), 158 | moreOptions3Dots(context), 159 | ], 160 | ), 161 | ) 162 | ], 163 | ); 164 | } 165 | 166 | Widget moreOptions3Dots(BuildContext context) { 167 | return GestureDetector( 168 | // Just For Demo, Doesn't Work As Needed 169 | onTap: () => 170 | _onCenterBottomMenuOn3DotsPressed(context), //_showPopupMenu(context), 171 | child: Container( 172 | child: Icon(FontAwesomeIcons.ellipsisV, size: 18), 173 | ), 174 | ); 175 | } 176 | 177 | Widget space10() { 178 | return SizedBox(height: 10); 179 | } 180 | 181 | Widget space15() { 182 | return SizedBox(height: 10); 183 | } 184 | 185 | Widget renderCategoryTime(Feed listFeed) { 186 | return Row( 187 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 188 | children: [ 189 | Text(listFeed.category, 190 | style: TextStyle(fontSize: 14, color: Colors.grey[700])), 191 | Text(listFeed.time, 192 | style: TextStyle(fontSize: 14, color: Colors.grey[700])), 193 | ], 194 | ); 195 | } 196 | 197 | _onCenterBottomMenuOn3DotsPressed(BuildContext context) { 198 | 199 | showModalBottomSheet( 200 | context: context, 201 | builder: (context) { 202 | return Container( 203 | color: Color(0xFF737373), 204 | child: _buildBottomNavMenu(context), 205 | ); 206 | }); 207 | } 208 | 209 | Widget _buildBottomNavMenu(BuildContext context) { 210 | 211 | List listMore = []; 212 | listMore.add(Menu3DotsModel('Hide ', 'See fewer posts like this', Icons.block)); 213 | listMore.add(Menu3DotsModel('Unfollow ', 'See fewer posts like this', Icons.person_add)); 214 | listMore.add(Menu3DotsModel('Report ', 'See fewer posts like this', Icons.info)); 215 | listMore.add(Menu3DotsModel('Copy link', 'See fewer posts like this', Icons.insert_link)); 216 | 217 | 218 | return Container( 219 | height: 300, 220 | decoration: BoxDecoration( 221 | color: Theme.of(context).canvasColor, 222 | borderRadius: BorderRadius.only( 223 | topLeft: const Radius.circular(10), 224 | topRight: const Radius.circular(10), 225 | ), 226 | ), 227 | 228 | child: ListView.builder( 229 | itemCount: listMore.length, 230 | itemBuilder: (BuildContext context, int index){ 231 | return ListTile( 232 | title: Text(listMore[index].title, style: TextStyle(fontSize: 18),), 233 | subtitle: Text(listMore[index].subtitle), 234 | leading: Icon(listMore[index].icons, size: 20, color: Colors.teal,), 235 | ); 236 | }) 237 | 238 | 239 | ); 240 | } 241 | 242 | 243 | class Menu3DotsModel{ 244 | 245 | String title; 246 | String subtitle; 247 | IconData icons; 248 | 249 | Menu3DotsModel(this.title, this.subtitle, this.icons); 250 | 251 | } -------------------------------------------------------------------------------- /lib/ui/newsFeedPage/widgets/widgetFeed.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:healthnest/ui/newsFeedPage/widgets/feedBloc.dart'; 5 | import 'package:healthnest/ui/newsFeedPage/widgets/feedCard.dart'; 6 | 7 | Widget actionBarRow() {return Row( 8 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 9 | crossAxisAlignment: CrossAxisAlignment.center, 10 | children: [ 11 | Column( 12 | crossAxisAlignment: CrossAxisAlignment.start, 13 | children: [ 14 | Text('COMMUNITY', 15 | style: TextStyle( 16 | fontSize: 14, 17 | fontWeight: FontWeight.normal, 18 | color: Colors.grey)), 19 | Row( 20 | children: [ 21 | Text('All Communities', 22 | style: TextStyle( 23 | fontSize: 14, 24 | fontWeight: FontWeight.bold, 25 | color: Colors.teal)), 26 | SizedBox(width: 6), 27 | Icon( 28 | Icons.arrow_drop_down, 29 | color: Colors.teal, 30 | ) 31 | ], 32 | ) 33 | ], 34 | ), 35 | CircleAvatar( 36 | child: ClipOval(child: Image.network('https://www.w3schools.com/w3images/avatar3.png')), 37 | radius: 20, 38 | backgroundColor: Colors.grey) 39 | ], 40 | );} 41 | 42 | Widget searchTextField() { 43 | return Row( 44 | mainAxisAlignment: MainAxisAlignment.end, 45 | children: [ 46 | Expanded( 47 | child: TextField( 48 | maxLines: 1, 49 | decoration: new InputDecoration( 50 | suffixIcon: Icon(CupertinoIcons.search), 51 | contentPadding: EdgeInsets.all(12), 52 | hintText: 'Search posts and members', 53 | border: OutlineInputBorder( 54 | borderRadius: const BorderRadius.all( 55 | Radius.circular(4.0), 56 | ), 57 | borderSide: new BorderSide(color: Colors.grey[300], width: 0.5), 58 | ), 59 | ), 60 | ), 61 | ), 62 | Container( 63 | margin: EdgeInsets.all(15), 64 | child: Icon(FontAwesomeIcons.bell, size: 26), 65 | ) 66 | ], 67 | ); 68 | } 69 | 70 | BoxDecoration boxDecoration() { 71 | return BoxDecoration( 72 | borderRadius: BorderRadius.all(Radius.circular(30)), 73 | border: 74 | Border.all(width: 1, style: BorderStyle.solid, color: Colors.teal)); 75 | } 76 | 77 | BoxDecoration selectedBoxDecoration() { 78 | return BoxDecoration( 79 | borderRadius: BorderRadius.all(Radius.circular(30)), 80 | color: Colors.teal[200], 81 | border: 82 | Border.all(width: 1, style: BorderStyle.solid, color: Colors.teal)); 83 | } 84 | 85 | Widget topSpace() { 86 | return SizedBox(height: 10); 87 | } 88 | 89 | Widget feedNewsCardItem(BuildContext context, Feed feed) { 90 | return Container( 91 | decoration: BoxDecoration( 92 | borderRadius: BorderRadius.all(Radius.circular(8)), 93 | border: Border.all(style: BorderStyle.solid, color: Colors.grey, width: 0.5) 94 | ), 95 | child: Card( 96 | elevation: 0, 97 | child: Padding( 98 | padding: const EdgeInsets.all(8.0), 99 | child: Column( 100 | children: [ 101 | renderCategoryTime(feed), 102 | space10(), 103 | userAvatarSection(context, feed), 104 | space15(), 105 | Visibility( 106 | visible: feed.name.isEmpty == true ? false : true, 107 | child: Text(feed.name, 108 | softWrap: true, 109 | maxLines: 2, 110 | style: 111 | TextStyle(fontSize: 16, fontWeight: FontWeight.bold))), 112 | space15(), 113 | Visibility( 114 | visible: feed.description.isEmpty == true ? false : true, 115 | child: Text(feed.description, 116 | style: TextStyle(fontSize: 14, color: Colors.grey))), 117 | space15(), 118 | setLocation(feed), 119 | Divider(thickness: 1), 120 | Row( 121 | children: [ 122 | Icon(FontAwesomeIcons.addressBook), 123 | SizedBox(width: 10), 124 | Text( 125 | '${feed.members} Members have this questions', 126 | style: TextStyle( 127 | fontSize: 14, color: Theme.of(context).primaryColor), 128 | ), 129 | ], 130 | ), 131 | Divider(thickness: 1), 132 | SizedBox(height: 10), 133 | likeCommentShare(feed), 134 | space15(), 135 | ], 136 | ), 137 | ), 138 | ), 139 | ); 140 | } 141 | 142 | Widget feedNewsCardItemQuestion(BuildContext context, Feed feed) { 143 | return Container( 144 | decoration: BoxDecoration( 145 | borderRadius: BorderRadius.all(Radius.circular(8)), 146 | border: Border.all(style: BorderStyle.solid, color: Colors.grey, width: 0.5) 147 | ), 148 | child: Card( 149 | elevation: 0, 150 | child: Padding( 151 | padding: const EdgeInsets.all(8.0), 152 | child: Column( 153 | children: [ 154 | renderCategoryTime(feed), 155 | space10(), 156 | userAvatarSection(context, feed), 157 | space15(), 158 | Visibility( 159 | visible: feed.name.isEmpty == true ? false : true, 160 | child: Text(feed.name, 161 | softWrap: true, 162 | maxLines: 2, 163 | style: 164 | TextStyle(fontSize: 16, fontWeight: FontWeight.bold))), 165 | space15(), 166 | setLocation(feed), 167 | space15(), 168 | questionPallet(), 169 | space15(), 170 | Divider(thickness: 1), 171 | Row( 172 | children: [ 173 | Icon(FontAwesomeIcons.addressBook), 174 | SizedBox(width: 10), 175 | Text( 176 | '${feed.members} Members have this questions', 177 | style: TextStyle( 178 | fontSize: 14, color: Theme.of(context).primaryColor), 179 | ), 180 | ], 181 | ), 182 | Divider(thickness: 1), 183 | SizedBox(height: 10), 184 | likeCommentShare(feed), 185 | space15(), 186 | ], 187 | ), 188 | ), 189 | ), 190 | ); 191 | } 192 | 193 | Widget feedNewsCardWithImageItem(BuildContext context,Feed feed) { 194 | return Container( 195 | decoration: BoxDecoration( 196 | borderRadius: BorderRadius.all(Radius.circular(8)), 197 | border: Border.all(style: BorderStyle.solid, color: Colors.grey, width: 0.5) 198 | ), 199 | child: Card( 200 | elevation: 0, 201 | child: Padding( 202 | padding: const EdgeInsets.all(8.0), 203 | child: Column( 204 | crossAxisAlignment: CrossAxisAlignment.start, 205 | children: [ 206 | renderCategoryTime(feed), 207 | space10(), 208 | userAvatarSection(context, feed), 209 | space15(), 210 | Text(feed.name, 211 | softWrap: true, 212 | maxLines: 2, 213 | style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), 214 | space15(), 215 | Text(feed.description, 216 | style: TextStyle(fontSize: 14, color: Colors.blue)), 217 | space15(), 218 | // show Image Preview 219 | 220 | Image.asset('assets/img/running_girl.jpeg', fit: BoxFit.cover, height: 180, width: double.infinity), 221 | 222 | space15(), 223 | // shows location 224 | setLocation(feed), 225 | Divider(thickness: 1), 226 | Row( 227 | children: [ 228 | Icon(FontAwesomeIcons.addressBook), 229 | SizedBox(width: 10), 230 | Text( 231 | '${feed.members} Members have this questions', 232 | style: TextStyle( 233 | fontSize: 14, color: Theme.of(context).primaryColor), 234 | ), 235 | ], 236 | ), 237 | Divider(thickness: 1), 238 | SizedBox(height: 10), 239 | likeCommentShare(feed), 240 | space15(), 241 | ], 242 | ), 243 | ), 244 | ), 245 | ); 246 | } 247 | 248 | Widget btnDecoration(String btnText) { 249 | return Container( 250 | padding: EdgeInsets.symmetric(vertical: 5, horizontal: 20), 251 | decoration: BoxDecoration( 252 | borderRadius: BorderRadius.all(Radius.circular(20)), 253 | color: Colors.teal, 254 | ), 255 | child: Text( 256 | btnText, 257 | style: TextStyle(fontSize: 12, color: Colors.grey[100]), 258 | )); 259 | } 260 | 261 | Widget questionPallet() { 262 | return Container( 263 | padding: EdgeInsets.symmetric(horizontal: 20), 264 | height: 100, 265 | decoration: BoxDecoration(color: Colors.teal[100]), 266 | child: Row( 267 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 268 | crossAxisAlignment: CrossAxisAlignment.center, 269 | children: [ 270 | Column( 271 | mainAxisAlignment: MainAxisAlignment.center, 272 | children: [ 273 | Text('Are you going?', style: TextStyle(fontSize: 18)), 274 | Row( 275 | children: [ 276 | Icon(Icons.people), 277 | SizedBox( 278 | width: 4, 279 | ), 280 | Text('21 People going?', style: TextStyle(fontSize: 12)) 281 | ], 282 | ) 283 | ], 284 | ), 285 | Row( 286 | children: [ 287 | btnDecoration('No'), 288 | SizedBox(width: 20), 289 | btnDecoration('Yes') 290 | ], 291 | ) 292 | ], 293 | ), 294 | ); 295 | } 296 | 297 | Widget pollingCard(BuildContext context,Feed feed) { 298 | return Container( 299 | decoration: BoxDecoration( 300 | borderRadius: BorderRadius.all(Radius.circular(8)), 301 | border: Border.all(style: BorderStyle.solid, color: Colors.grey, width: 0.5) 302 | ), 303 | child: Card( 304 | elevation: 0, 305 | child: Padding( 306 | padding: const EdgeInsets.all(10.0), 307 | child: Column( 308 | crossAxisAlignment: CrossAxisAlignment.start, 309 | children: [ 310 | renderCategoryTime(feed), 311 | space10(), 312 | userAvatarSection(context, feed), 313 | space15(), 314 | Visibility( 315 | visible: feed.name.isEmpty == true ? false : true, 316 | child: Text(feed.name, 317 | softWrap: true, 318 | maxLines: 2, 319 | style: 320 | TextStyle(fontSize: 16, fontWeight: FontWeight.bold))), 321 | space15(), 322 | pollCartSection(), 323 | space15(), 324 | setLocation(feed), 325 | Divider(thickness: 1), 326 | Row( 327 | children: [ 328 | Icon(FontAwesomeIcons.addressBook), 329 | SizedBox(width: 10), 330 | Text( 331 | 'You and ${feed.members} Members Liked this poll', 332 | style: TextStyle( 333 | fontSize: 14, color: Theme.of(context).primaryColor), 334 | ), 335 | ], 336 | ), 337 | Divider(thickness: 1), 338 | SizedBox(height: 10), 339 | likeCommentShare(feed), 340 | space15(), 341 | ], 342 | ), 343 | ), 344 | ), 345 | ); 346 | } 347 | 348 | Widget pollCartSection() { 349 | return Column( 350 | children: [ 351 | Row( 352 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 353 | children: [ 354 | pollQuestion('Apollo Hospital, Banglore'), 355 | pollQuestion('20%'), 356 | ], 357 | ), 358 | Row( 359 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 360 | children: [ 361 | pollQuestion('AIIMS Delhi'), 362 | pollQuestion('20%'), 363 | ], 364 | ), 365 | Row( 366 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 367 | children: [ 368 | pollQuestion('Kokila Ben Dhirubhai Ambani, Mumbai'), 369 | pollQuestion('50%') 370 | ], 371 | ) 372 | ], 373 | ); 374 | } 375 | 376 | Widget pollQuestion(String question) { 377 | return Container( 378 | padding: EdgeInsets.all(10), 379 | decoration: 380 | BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(8))), 381 | child: Text(question), 382 | ); 383 | } -------------------------------------------------------------------------------- /lib/ui/servicesPage/services.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ServicePage extends StatefulWidget { 4 | @override 5 | _ServicePageState createState() => _ServicePageState(); 6 | } 7 | 8 | class _ServicePageState extends State { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Padding( 13 | padding: const EdgeInsets.all(18.0), 14 | child: SafeArea( 15 | child: Container( 16 | child: Text('SERVICES', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/ui/servicesPage/servicesBloc.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/servicesPage/servicesBloc.dart -------------------------------------------------------------------------------- /lib/ui/servicesPage/servicesWidgets.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/lib/ui/servicesPage/servicesWidgets.dart -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | audioplayers: 5 | dependency: "direct main" 6 | description: 7 | name: audioplayers 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.13.7" 11 | carousel_slider: 12 | dependency: "direct main" 13 | description: 14 | name: carousel_slider 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.4.1" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.0.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.3" 32 | collection: 33 | dependency: transitive 34 | description: 35 | name: collection 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.14.13" 39 | convert: 40 | dependency: transitive 41 | description: 42 | name: convert 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.1.1" 46 | crypto: 47 | dependency: transitive 48 | description: 49 | name: crypto 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.5" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.1.3" 60 | diacritic: 61 | dependency: transitive 62 | description: 63 | name: diacritic 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.1.1" 67 | file: 68 | dependency: transitive 69 | description: 70 | name: file 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "5.2.1" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_country_picker: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_country_picker 83 | url: "https://pub.dartlang.org" 84 | source: hosted 85 | version: "0.1.6" 86 | flutter_reaction_button: 87 | dependency: "direct main" 88 | description: 89 | name: flutter_reaction_button 90 | url: "https://pub.dartlang.org" 91 | source: hosted 92 | version: "0.1.3" 93 | font_awesome_flutter: 94 | dependency: "direct main" 95 | description: 96 | name: font_awesome_flutter 97 | url: "https://pub.dartlang.org" 98 | source: hosted 99 | version: "8.8.1" 100 | intl: 101 | dependency: transitive 102 | description: 103 | name: intl 104 | url: "https://pub.dartlang.org" 105 | source: hosted 106 | version: "0.16.1" 107 | meta: 108 | dependency: transitive 109 | description: 110 | name: meta 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "1.1.8" 114 | mime: 115 | dependency: transitive 116 | description: 117 | name: mime 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "0.9.7" 121 | path: 122 | dependency: transitive 123 | description: 124 | name: path 125 | url: "https://pub.dartlang.org" 126 | source: hosted 127 | version: "1.7.0" 128 | path_provider: 129 | dependency: "direct main" 130 | description: 131 | name: path_provider 132 | url: "https://pub.dartlang.org" 133 | source: hosted 134 | version: "1.6.14" 135 | path_provider_linux: 136 | dependency: transitive 137 | description: 138 | name: path_provider_linux 139 | url: "https://pub.dartlang.org" 140 | source: hosted 141 | version: "0.0.1+2" 142 | path_provider_macos: 143 | dependency: transitive 144 | description: 145 | name: path_provider_macos 146 | url: "https://pub.dartlang.org" 147 | source: hosted 148 | version: "0.0.4+3" 149 | path_provider_platform_interface: 150 | dependency: transitive 151 | description: 152 | name: path_provider_platform_interface 153 | url: "https://pub.dartlang.org" 154 | source: hosted 155 | version: "1.0.3" 156 | platform: 157 | dependency: transitive 158 | description: 159 | name: platform 160 | url: "https://pub.dartlang.org" 161 | source: hosted 162 | version: "2.2.1" 163 | plugin_platform_interface: 164 | dependency: transitive 165 | description: 166 | name: plugin_platform_interface 167 | url: "https://pub.dartlang.org" 168 | source: hosted 169 | version: "1.0.2" 170 | process: 171 | dependency: transitive 172 | description: 173 | name: process 174 | url: "https://pub.dartlang.org" 175 | source: hosted 176 | version: "3.0.13" 177 | share: 178 | dependency: "direct main" 179 | description: 180 | name: share 181 | url: "https://pub.dartlang.org" 182 | source: hosted 183 | version: "0.6.5" 184 | sky_engine: 185 | dependency: transitive 186 | description: flutter 187 | source: sdk 188 | version: "0.0.99" 189 | typed_data: 190 | dependency: transitive 191 | description: 192 | name: typed_data 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.2.0" 196 | uuid: 197 | dependency: transitive 198 | description: 199 | name: uuid 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "2.2.2" 203 | vector_math: 204 | dependency: transitive 205 | description: 206 | name: vector_math 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "2.0.8" 210 | xdg_directories: 211 | dependency: transitive 212 | description: 213 | name: xdg_directories 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.1.0" 217 | sdks: 218 | dart: ">=2.9.0-14.0.dev <3.0.0" 219 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 220 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: healthnest 2 | description: A new Flutter application. 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter_country_picker: ^0.1.6 11 | font_awesome_flutter: ^8.5.0 12 | share: ^0.6.3+5 13 | flutter_reaction_button: ^0.1.3 14 | carousel_slider: ^1.4.1 15 | audioplayers: ^0.13.5 16 | path_provider: ^1.5.1 17 | 18 | flutter: 19 | sdk: flutter 20 | 21 | cupertino_icons: ^0.1.2 22 | 23 | 24 | dev_dependencies: 25 | # flutter_test: 26 | # sdk: flutter 27 | 28 | flutter: 29 | 30 | uses-material-design: true 31 | 32 | assets: 33 | - assets/img/ 34 | 35 | fonts: 36 | - family: nunito 37 | fonts: 38 | - asset: assets/font/nunito/nunito-regular.ttf -------------------------------------------------------------------------------- /screenshots/gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/gif.gif -------------------------------------------------------------------------------- /screenshots/login1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/login1.png -------------------------------------------------------------------------------- /screenshots/login2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/login2.png -------------------------------------------------------------------------------- /screenshots/login3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/login3.png -------------------------------------------------------------------------------- /screenshots/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/menu.png -------------------------------------------------------------------------------- /screenshots/news_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/news_1.png -------------------------------------------------------------------------------- /screenshots/news_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/news_2.png -------------------------------------------------------------------------------- /screenshots/news_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/news_3.png -------------------------------------------------------------------------------- /screenshots/news_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/news_4.png -------------------------------------------------------------------------------- /screenshots/news_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/news_5.png -------------------------------------------------------------------------------- /screenshots/post1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/post1.png -------------------------------------------------------------------------------- /screenshots/post2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/post2.png -------------------------------------------------------------------------------- /screenshots/post3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/post3.png -------------------------------------------------------------------------------- /screenshots/post4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/post4.png -------------------------------------------------------------------------------- /screenshots/post5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/post5.png -------------------------------------------------------------------------------- /screenshots/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishaileshmishra/flutter-feed-app/14aed1fe7e0ebf8f8eaabde582d20e01a3911ef8/screenshots/share.png --------------------------------------------------------------------------------