Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Added custom AlertDialogs #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added recyclomedia/lib/assets/images/alertBox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/error.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added recyclomedia/lib/assets/images/palms.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion recyclomedia/lib/images.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class Images{
static const sunset = "lib/assets/images/eventsbg.png";
static const sunset = "assets/eventsbg.png";
static const forest = "lib/assets/images/eventbg2.jpg";
static const mountain = "lib/assets/images/eventbg1.jpg";
static const donationsGIF = "lib/assets/images/donations.gif";
static const ringGIF = "lib/assets/images/rings.gif";
static const palmsGIF = "lib/assets/images/palms.gif";
}
2 changes: 0 additions & 2 deletions recyclomedia/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:recyclomedia/fonts.dart';
import 'package:recyclomedia/pages/eventDetails.page.dart';
import 'package:recyclomedia/pages/donations.page.dart';
import 'package:recyclomedia/pages/landing.page.dart';

void main() {
Expand Down
8 changes: 4 additions & 4 deletions recyclomedia/lib/pages/dashboard.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import 'package:recyclomedia/widgets/eventsCard.dart';
import 'package:recyclomedia/widgets/userCard.widget.dart';

import '../fonts.dart';
import 'login.page.dart';

class DashboardPage extends StatefulWidget {
final Color color;
double screenSize;

DashboardPage(this.color);

Expand Down Expand Up @@ -107,8 +105,10 @@ class DashboardPageState extends State<DashboardPage> {
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
children: [
EventsCard(
"Beach Cleanup 2020", "from 8.30 am onwards", Images.mountain),
EventsCard("Beach Cleanup 2020", "from 8.30 am onwards @Unawatuna", Images.sunset),
EventsCard("Colombo Beach Cleanup 2020", "from 8.30 am onwards @Unawatuna", Images.sunset),
EventsCard("Forest Cleanup 2020", "from 9.30 am onwards @Singharaja", Images.mountain),
EventsCard("Singharaja Cleanup 2020", "from 8.00 am onwards @Sinharaja", "assets/images/eventsbg.png"),
// eventsCard("Akash's Gay Marriage", Images.forest),
// eventsCard("Akash's Gay Marriage", Images.sunset),
// eventsCard("Beach Cleanup 2020", Images.mountain),
Expand Down
49 changes: 26 additions & 23 deletions recyclomedia/lib/pages/donations.page.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:recyclomedia/fonts.dart';
import 'package:recyclomedia/images.dart';

import 'login.page.dart';
import 'package:recyclomedia/widgets/DialogBox.dart';

class DonationsPage extends StatefulWidget {
@override
Expand Down Expand Up @@ -120,28 +118,33 @@ class _DonationsPageState extends State<DonationsPage> {
height: 30,
color: Colors.transparent,
),
Container(
padding: EdgeInsets.symmetric(vertical: 20),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 30,
width: 30,
child: Image.asset(
Images.ringGIF,
fit: BoxFit.cover,
GestureDetector(
onTap: (){
showDialog(context: context, builder: (BuildContext context) => DialogBoxes());
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 30,
width: 30,
child: Image.asset(
Images.ringGIF,
fit: BoxFit.cover,
),
),
),
Divider(
color: Colors.transparent,
),
Text("DONATE",
style: TextStyle(color: Colors.white)),
],
Divider(
color: Colors.transparent,
),
Text("DONATE",
style: TextStyle(color: Colors.white)),
],
),
color: Colors.black,
),
color: Colors.black,
),
],
),
Expand Down
3 changes: 2 additions & 1 deletion recyclomedia/lib/pages/events.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:recyclomedia/models/event.model.dart';
import 'package:recyclomedia/pages/eventDetails.page.dart';
import '../widgets/eventsCard.dart';
import 'login.page.dart';

class EventsPage extends StatefulWidget {
@override
Expand All @@ -21,6 +20,8 @@ class _EventsPageState extends State<EventsPage> {
@override
Widget build(BuildContext context) {

final vw = MediaQuery.of(context).size.width;

final pageHeader = new Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
19 changes: 6 additions & 13 deletions recyclomedia/lib/pages/home.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:recyclomedia/pages/settings.page.dart';
import 'dashboard.page.dart';

class Home extends StatefulWidget {
_HomeState home = _HomeState();
final _HomeState home = _HomeState();
@override
State<StatefulWidget> createState() {
return _HomeState();
Expand All @@ -16,13 +16,6 @@ class Home extends StatefulWidget {
class _HomeState extends State<Home> {
int _currentNavIndex = 0;

final List<Widget> _children = [
DashboardPage(Colors.blue),
EventsPage(),
ProfilePage(),
SettingsPage()
];

PageController _pageController;

@override
Expand Down Expand Up @@ -62,10 +55,10 @@ class _HomeState extends State<Home> {
onTap: onTabTapped,
currentIndex: _currentNavIndex,
items: [
NavigationItem(Icons.home, "H", "ome"),
NavigationItem(Icons.flag, "E", "vents"),
NavigationItem(Icons.person, "P", "rofile"),
NavigationItem(Icons.settings, "S", "ettings"),
navigationItem(Icons.home, "H", "ome"),
navigationItem(Icons.flag, "E", "vents"),
navigationItem(Icons.person, "P", "rofile"),
navigationItem(Icons.settings, "S", "ettings"),
],
),
),
Expand All @@ -81,7 +74,7 @@ class _HomeState extends State<Home> {
});
}

BottomNavigationBarItem NavigationItem(
BottomNavigationBarItem navigationItem(
IconData icon, String underlinedNavTitleText, String navTitleText) {
return BottomNavigationBarItem(
icon: Icon(icon),
Expand Down
29 changes: 22 additions & 7 deletions recyclomedia/lib/pages/landing.page.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import 'package:flutter/material.dart';
import 'package:recyclomedia/images.dart';
import 'package:recyclomedia/pages/login.page.dart';
import 'package:recyclomedia/pages/signup.page.dart';

class LandingPage extends StatelessWidget {
@override
Widget build(BuildContext context) {

final vw = MediaQuery.of(context).size.width;

return Scaffold(
body: Column(
children: [
Expand All @@ -15,19 +19,30 @@ class LandingPage extends StatelessWidget {
height: double.infinity,
width: double.infinity,
child: Image.asset(
"lib/assets/images/login.jpg",
fit: BoxFit.fill,
Images.palmsGIF,
fit: BoxFit.cover,
),
),
Positioned(
top: MediaQuery.of(context).viewPadding.top < 0 ? 65 : 40,
left: 25,
Center(
child: Text(
"RECYCLOMEDIA",
style: TextStyle(
color: Colors.white,
fontSize: 30,
fontWeight: FontWeight.bold),
fontSize: vw * 0.12,
shadows: <Shadow>[
Shadow(
offset: Offset(0, 0),
blurRadius: 70.0,
color: Colors.black,
),
Shadow(
offset: Offset(0, 0),
blurRadius: 60.0,
color: Colors.black,
),
],
letterSpacing: -5
),
),
),
],
Expand Down
17 changes: 15 additions & 2 deletions recyclomedia/lib/pages/login.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ class LoginPage extends StatelessWidget {
),
),
Positioned(
top: MediaQuery.of(context).viewPadding.top < 0 ? 65 : 40,
top: MediaQuery.of(context).viewPadding.top < 0 ? 40 : 65,
left: 25,
child: Text(
"Sign In",
style: TextStyle(
color: Colors.white,
fontSize: 40,
fontWeight: FontWeight.bold),
fontWeight: FontWeight.bold,
shadows: <Shadow>[
Shadow(
offset: Offset(0, 0),
blurRadius: 70.0,
color: Colors.black,
),
Shadow(
offset: Offset(0, 0),
blurRadius: 60.0,
color: Colors.black,
),
],),
),
),
],
Expand Down Expand Up @@ -89,6 +101,7 @@ class LoginPage extends StatelessWidget {
color: Colors.transparent,
),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: 'Enter your password here',
enabledBorder: OutlineInputBorder(
Expand Down
22 changes: 18 additions & 4 deletions recyclomedia/lib/pages/signup.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SignUpPage extends StatelessWidget {
color: Colors.red,
child: Image.asset(
"lib/assets/images/signup.png",
fit: BoxFit.fill,
fit: BoxFit.cover,
),
),
Positioned(
Expand All @@ -25,9 +25,22 @@ class SignUpPage extends StatelessWidget {
child: Text(
"Sign Up",
style: TextStyle(
color: Colors.white,
fontSize: 40,
fontWeight: FontWeight.bold),
color: Colors.white,
fontSize: 40,
fontWeight: FontWeight.bold,
shadows: <Shadow>[
Shadow(
offset: Offset(0, 0),
blurRadius: 70.0,
color: Colors.black,
),
Shadow(
offset: Offset(0, 0),
blurRadius: 60.0,
color: Colors.black,
),
],
),
),
)
],
Expand Down Expand Up @@ -124,6 +137,7 @@ class SignUpPage extends StatelessWidget {
color: Colors.transparent,
),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: 'Enter your password here',
enabledBorder: OutlineInputBorder(
Expand Down
53 changes: 53 additions & 0 deletions recyclomedia/lib/widgets/DialogBox.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';

class DialogBoxes extends StatefulWidget {

final String errorType;
final String message;
final bool showSecondaryButton;

const DialogBoxes({Key key, this.errorType, this.message, this.showSecondaryButton}) : super(key: key);

@override
_DialogBoxesState createState() => _DialogBoxesState();
}

class _DialogBoxesState extends State<DialogBoxes> {
@override
Widget build(BuildContext context) {
return Dialog(
child: Container(
height: 300.0,
width: 300.0,
decoration: BoxDecoration(
// color: Colors.black,
image: DecorationImage(

image: AssetImage("lib/assets/images/alertBox.png"),
fit: BoxFit.fill,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.all(15.0),
child: Text('Cool', style: TextStyle(color: Colors.red),),
),
Padding(
padding: EdgeInsets.all(15.0),
child: Text('Awesome', style: TextStyle(color: Colors.red),),
),
Padding(padding: EdgeInsets.only(top: 50.0)),
FlatButton(onPressed: (){
Navigator.of(context).pop();
},
child: Text('Got It!', style: TextStyle(color: Colors.purple, fontSize: 18.0),))
],
),
),
);
}
}


1 change: 0 additions & 1 deletion recyclomedia/lib/widgets/eventsCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class EventsCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
//Viewport
final vh = MediaQuery.of(context).size.height;
final vw = MediaQuery.of(context).size.width;

return new Container(
Expand Down
9 changes: 7 additions & 2 deletions recyclomedia/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ flutter:
- lib/assets/images/loading.gif
- lib/assets/images/email.png
- lib/assets/images/error.gif
- lib/assets/images/donations.gif
- lib/assets/images/rings.gif
- lib/assets/images/eventbg1.jpg
- lib/assets/images/eventbg2.jpg
- lib/assets/images/eventsbg.png
- lib/assets/images/donations.gif
- lib/assets/images/rings.gif
- lib/assets/images/alertBox.png
- lib/assets/images/palms.gif
- assets/eventbg1.jpg
- assets/eventbg2.jpg
- assets/eventsbg.png

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down