Skip to content

Commit

Permalink
todo home two UI
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Aug 21, 2019
1 parent fb09aa9 commit 4aaa867
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The code for Springy Widget is taken and refactored from (https://github.com/mat

## Todo App

<img height="480px" src="screenshots/todo2.png"> <img height="480px" src="screenshots/todohome1.png">
<img height="480px" src="screenshots/todo_home2.png"> <img height="480px" src="screenshots/todo2.png"> <img height="480px" src="screenshots/todohome1.png">

## Hotel App

Expand Down
288 changes: 288 additions & 0 deletions lib/src/pages/todo/todo_home2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
/**
* Author: Damodar Lohani
* profile: https://github.com/lohanidamodar
*/

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';

class TodoHomeTwoPage extends StatelessWidget {
static final String path = "lib/src/pages/todo/todo_home2.dart";

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.indigo,
),
body: HeaderFooterwidget(
header: _buildDateHeader(DateTime.now()),
body: SingleChildScrollView(
padding: const EdgeInsets.all(32.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_buildTask(color: Colors.pink.shade300),
const SizedBox(height: 20.0),
_buildTaskTwo(),
const SizedBox(height: 20.0),
_buildTask(color: Colors.indigo.shade300),
const SizedBox(height: 20.0),
_buildTaskTwo(),
],
),
),
footer: _buildBottomBar(),
),
);
}

Container _buildBottomBar() {
return Container(
padding: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 16.0,
),
child: Row(
children: <Widget>[
SizedBox(width: 5.0),
Expanded(
child: TextField(
textCapitalization: TextCapitalization.sentences,
style: TextStyle(color: Colors.white70),
decoration: InputDecoration(
border: InputBorder.none,
hintText: "jot down your task",
hintStyle: TextStyle(color: Colors.white54),
),
),
),
IconButton(
color: Colors.white70,
icon: Icon(Icons.add),
onPressed: () {},
)
],
),
);
}

Widget _buildDateHeader(DateTime date) {
final TextStyle boldStyle = TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24,
letterSpacing: 2.0);
return Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: MaterialButton(
minWidth: 0,
elevation: 0,
highlightElevation: 0,
textColor: Colors.pink,
padding: const EdgeInsets.symmetric(
vertical: 16.0,
horizontal: 8.0,
),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(DateFormat.MMM().format(date).toUpperCase()),
const SizedBox(height: 5.0),
Text(
DateFormat.d().format(date),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0),
)
],
),
),
),
const SizedBox(width: 20.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
DateFormat.EEEE().format(date).toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
letterSpacing: 2.0,
),
),
Text(
"Today".toUpperCase(),
style: boldStyle,
)
],
),
],
);
}

Widget _buildTaskTwo() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
bottomLeft: Radius.circular(20.0),
),
color: Colors.white70,
),
padding: const EdgeInsets.symmetric(horizontal: 32.0, vertical: 16.0),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"10:30 - 11:30AM",
style: TextStyle(letterSpacing: 2.5, color: Colors.pink),
),
const SizedBox(height: 5.0),
Text(
"Meeting With",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.pink,
fontSize: 16.0),
),
Text("John Doe"),
const SizedBox(height: 5.0),
Divider(color: Colors.pink,),
],
),
);
}

Container _buildTask({Color color = Colors.indigo}) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(20.0),
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
color: color,
),
padding: const EdgeInsets.symmetric(horizontal: 32.0, vertical: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"10:30 - 11:30AM",
style: TextStyle(letterSpacing: 2.5, color: Colors.white),
),
const SizedBox(height: 5.0),
Text(
"Meeting With",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.0,
color: Colors.white),
),
Text("John Doe")
],
),
);
}
}

class HeaderFooterwidget extends StatelessWidget {
final Widget header;
final Widget footer;
final Widget body;
final Color headerColor;
final Color footerColor;
final double headerHeight;

const HeaderFooterwidget(
{Key key,
this.header,
this.footer,
this.body,
this.headerColor = Colors.indigo,
this.footerColor = Colors.pink,
this.headerHeight})
: super(key: key);

@override
Widget build(BuildContext context) {
return _buildBody();
}

Stack _buildBody() {
return Stack(
children: <Widget>[
Positioned(
top: 20,
bottom: 120,
right: 0,
width: 30,
child: DecoratedBox(
decoration: BoxDecoration(color: headerColor),
),
),
Positioned(
left: 0,
right: 0,
bottom: 0,
height: 120,
child: DecoratedBox(
decoration: BoxDecoration(color: footerColor),
),
),
Positioned(
bottom: 100,
right: 0,
width: 10,
height: 60,
child: DecoratedBox(
decoration: BoxDecoration(
color: headerColor,
borderRadius:
BorderRadius.only(bottomLeft: Radius.circular(20.0))),
),
),
Column(
children: <Widget>[
_buildHeader(),
Expanded(
child: Container(
margin: const EdgeInsets.only(right: 10.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: body,
),
),
const SizedBox(height: 10.0),
footer,
],
),
],
);
}

Widget _buildHeader() {
return Container(
height: headerHeight,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(30.0)),
color: headerColor,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0),
child: header,
);
}
}
3 changes: 3 additions & 0 deletions lib/src/widgets/main_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import 'package:flutter_ui_challenges/src/pages/quiz_app/quiz_finished.dart';
import 'package:flutter_ui_challenges/src/pages/quiz_app/quiz_page.dart';
import 'package:flutter_ui_challenges/src/pages/todo/todo2.dart';
import 'package:flutter_ui_challenges/src/pages/todo/todo_home1.dart';
import 'package:flutter_ui_challenges/src/pages/todo/todo_home2.dart';
import 'package:flutter_ui_challenges/src/pages/travel/tdestination.dart';
import 'package:flutter_ui_challenges/src/pages/travel/travel_home.dart';
import 'package:flutter_ui_challenges/src/utils/constants.dart';
Expand Down Expand Up @@ -189,6 +190,8 @@ class _MainMenuState extends State<MainMenu> {
SubMenuItem("Todo Week View", TodoTwoPage(), path: TodoTwoPage.path),
SubMenuItem("Todo Home One", TodoHomeOnePage(),
path: TodoHomeOnePage.path),
SubMenuItem("Todo Home Two", TodoHomeTwoPage(),
path: TodoHomeTwoPage.path),
]),
MenuItem(title: "Travel", icon: Icons.airplanemode_active, items: [
SubMenuItem("Travel Home", TravelHomePage(), path: TravelHomePage.path),
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ dependencies:
charts_flutter: ^0.6.0
animated_floatactionbuttons: ^0.1.0
share: ^0.6.2
intl: ^0.15.8

flare_flutter:
git:
url: git://github.com/2d-inc/Flare-Flutter.git
Expand Down
Binary file added screenshots/todo_home2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4aaa867

Please sign in to comment.