Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea2fd9e

Browse files
volenteer page added
1 parent 31172b8 commit ea2fd9e

File tree

7 files changed

+326
-9
lines changed

7 files changed

+326
-9
lines changed

assets/images/tree.png

514 KB
Loading

assets/images/tree2.png

443 KB
Loading

lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'package:flutter/material.dart';
2-
import 'package:planteria/screen/Home.dart';
2+
import 'package:planteria/screen/option_page.dart';
33
import 'package:planteria/service/locator.dart';
44

55
void main() {
66
serviceLocator();
77
runApp(MaterialApp(
8-
home: Home(),
8+
home: OptionPage(),
99
debugShowCheckedModeBanner: false,
1010
));
1111
}

lib/screen/Home.dart renamed to lib/screen/gov_home.dart

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,60 @@
11
import 'package:flutter/material.dart';
22
import 'package:planteria/helper/color.dart';
33
import 'package:planteria/screen/createCam.dart';
4+
import 'package:planteria/screen/volenteer_Home.dart';
45
import 'package:planteria/service/locator.dart';
56
import 'package:velocity_x/velocity_x.dart';
67

7-
class Home extends StatefulWidget {
8-
Home({Key key}) : super(key: key);
8+
class GovHome extends StatefulWidget {
9+
GovHome({Key key}) : super(key: key);
910

1011
@override
11-
_HomeState createState() => _HomeState();
12+
_GovHomeState createState() => _GovHomeState();
1213
}
1314

14-
class _HomeState extends State<Home> {
15+
class _GovHomeState extends State<GovHome> {
1516
@override
1617
Widget build(BuildContext context) {
1718
return Scaffold(
1819
drawer: Drawer(
19-
child: DrawerHeader(child: null),
20+
child: Column(
21+
children: [
22+
DrawerHeader(
23+
decoration: BoxDecoration(
24+
border: Border.all()
25+
),
26+
child: Container(
27+
child: Center(
28+
child: Text("Welcome!\nGovt. Of Maharashtra",
29+
textAlign: TextAlign.center,
30+
style: TextStyle(
31+
fontSize: 20,
32+
color: Vx.hexToColor(sl<Customcolor>().greenish)
33+
),
34+
),
35+
),
36+
)),
37+
38+
Container(
39+
child: ClipRRect(
40+
borderRadius: BorderRadius.circular(15),
41+
child: FlatButton(
42+
padding: EdgeInsets.symmetric(horizontal: 50),
43+
onPressed: () {
44+
Navigator.push(
45+
context,
46+
MaterialPageRoute(
47+
builder: (BuildContext context) =>
48+
VolenteerHome()));
49+
},
50+
child: "List of volenteers".text.xl2.make(),
51+
clipBehavior: Clip.antiAlias,
52+
color: Vx.hexToColor(sl<Customcolor>().greenish),
53+
),
54+
),
55+
)
56+
],
57+
),
2058
),
2159
appBar: PreferredSize(
2260
preferredSize: Size(100, 50),

lib/screen/option_page.dart

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:planteria/screen/gov_home.dart';
3+
import 'package:planteria/screen/volenteer_home.dart';
4+
5+
class OptionPage extends StatelessWidget {
6+
@override
7+
Widget build(BuildContext context) {
8+
return Scaffold(
9+
backgroundColor: Colors.greenAccent,
10+
body: Container(
11+
child: Column(
12+
children: <Widget>[
13+
Container(
14+
height: 200,
15+
decoration: BoxDecoration(
16+
image: DecorationImage(
17+
image: AssetImage('assets/images/tree.png'),
18+
fit: BoxFit.fill,
19+
)
20+
),
21+
),
22+
Column(
23+
24+
children: <Widget>[
25+
SizedBox(height: 50,),
26+
Container(child: Center(child: Text("Planteria", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold, fontSize: 45),),),),
27+
SizedBox(height: 50,),
28+
Container(
29+
padding: EdgeInsets.only(left: 30, right: 30),
30+
height: 50,
31+
decoration: BoxDecoration(
32+
borderRadius: BorderRadius.circular(60)
33+
),
34+
35+
child: ClipRRect(
36+
borderRadius: BorderRadius.circular(50),
37+
child: FlatButton(
38+
color: Colors.green,
39+
onPressed: () {
40+
Navigator.push(
41+
context,
42+
MaterialPageRoute(
43+
builder: (BuildContext context) =>
44+
GovHome()));
45+
46+
},
47+
child: Center(child: Text("Login as Government", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold,)))
48+
),
49+
)
50+
),
51+
SizedBox(height: 20,),
52+
Container(
53+
padding: EdgeInsets.only(left: 30, right: 30),
54+
height: 50,
55+
decoration: BoxDecoration(
56+
borderRadius: BorderRadius.circular(60)
57+
),
58+
59+
child: ClipRRect(
60+
borderRadius: BorderRadius.circular(50),
61+
child: FlatButton(
62+
color: Colors.green,
63+
onPressed: () {
64+
Navigator.push(
65+
context,
66+
MaterialPageRoute(
67+
builder: (BuildContext context) =>
68+
VolenteerHome()));
69+
70+
},
71+
child: Center(child: Text("Login as Volunteer", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold,)))
72+
),
73+
)
74+
),
75+
// SizedBox(height: 100,),
76+
Container(
77+
height: 200,
78+
decoration: BoxDecoration(
79+
image: DecorationImage(
80+
image: AssetImage('assets/images/tree2.png'),
81+
fit: BoxFit.fill,
82+
)
83+
),
84+
),
85+
],
86+
),
87+
],),
88+
),
89+
);
90+
}
91+
}

lib/screen/volenteer_home.dart

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:planteria/helper/color.dart';
3+
import 'package:planteria/service/locator.dart';
4+
import 'package:velocity_x/velocity_x.dart';
5+
6+
7+
class VolenteerHome extends StatefulWidget {
8+
@override
9+
_VolenteerHomeState createState() => _VolenteerHomeState();
10+
}
11+
12+
class _VolenteerHomeState extends State<VolenteerHome> {
13+
@override
14+
Widget build(BuildContext context) {
15+
return Scaffold(
16+
drawer: Drawer(
17+
child: Column(
18+
children: [
19+
DrawerHeader(
20+
decoration: BoxDecoration(
21+
border: Border.all()
22+
),
23+
child: Container(
24+
child: Center(
25+
child: Text("Welcome!\nMr. Volenteer",
26+
textAlign: TextAlign.center,
27+
style: TextStyle(
28+
fontSize: 20,
29+
color: Vx.hexToColor(sl<Customcolor>().greenish)
30+
),
31+
),
32+
),
33+
)),
34+
35+
Container(
36+
width: 250,
37+
child: ClipRRect(
38+
borderRadius: BorderRadius.circular(15),
39+
child: FlatButton(
40+
padding: EdgeInsets.symmetric(horizontal: 50),
41+
onPressed: () {
42+
Navigator.push(
43+
context,
44+
MaterialPageRoute(
45+
builder: (BuildContext context) =>
46+
VolenteerHome()));
47+
},
48+
child: "Achievements".text.xl2.make(),
49+
clipBehavior: Clip.antiAlias,
50+
color: Vx.hexToColor(sl<Customcolor>().greenish),
51+
),
52+
),
53+
),
54+
55+
Container(
56+
width: 250,
57+
child: ClipRRect(
58+
borderRadius: BorderRadius.circular(15),
59+
child: FlatButton(
60+
padding: EdgeInsets.symmetric(horizontal: 50),
61+
onPressed: () {
62+
Navigator.push(
63+
context,
64+
MaterialPageRoute(
65+
builder: (BuildContext context) =>
66+
VolenteerHome()));
67+
},
68+
child: "My Account".text.xl2.make(),
69+
clipBehavior: Clip.antiAlias,
70+
color: Vx.hexToColor(sl<Customcolor>().greenish),
71+
),
72+
),
73+
)
74+
],
75+
),
76+
),
77+
appBar: PreferredSize(
78+
preferredSize: Size(100, 50),
79+
child: VxAppBar(
80+
title: "Planteria".text.thin.make(),
81+
centerTitle: true,
82+
backgroundColor: Color(0xff4bbe9b),
83+
),
84+
),
85+
86+
body: Container(
87+
padding: EdgeInsets.all(10.0),
88+
child: Column(
89+
children: [
90+
Container(
91+
alignment: Alignment.centerLeft,
92+
child: Text(" Campaigns you are volenteering!",
93+
style: TextStyle(
94+
fontSize: 20,
95+
fontWeight: FontWeight.w500
96+
),
97+
),
98+
),
99+
Container(
100+
padding: EdgeInsets.only(top: 20),
101+
height: MediaQuery.of(context).size.height - 130,
102+
child: ListView(
103+
children: [
104+
Card(
105+
color: Colors.greenAccent[100],
106+
child: Container(
107+
child: Column(
108+
children: [
109+
Stack(
110+
children: [
111+
Container(
112+
color: Colors.green[300],
113+
height: 40,
114+
),
115+
Container(
116+
alignment: Alignment.center,
117+
child: Text("Green Maharashtra",
118+
style: TextStyle(
119+
color: Colors.white,
120+
fontSize: 25,
121+
fontWeight: FontWeight.bold,
122+
),
123+
),
124+
),
125+
],
126+
),
127+
128+
Container(
129+
padding: EdgeInsets.all(5),
130+
alignment: Alignment.centerLeft,
131+
child: Text("Saplings Targeted: 5,00,000",
132+
style: TextStyle(
133+
fontSize: 18,
134+
fontWeight: FontWeight.bold,
135+
),
136+
),
137+
),
138+
Container(
139+
padding: EdgeInsets.all(5),
140+
alignment: Alignment.centerLeft,
141+
child: Text("Saplings Planted : 1,23,000",
142+
style: TextStyle(
143+
fontSize: 18,
144+
fontWeight: FontWeight.bold,
145+
),
146+
),
147+
),
148+
Container(
149+
padding: EdgeInsets.all(5),
150+
alignment: Alignment.centerLeft,
151+
child: Text("Volenteers : 103",
152+
style: TextStyle(
153+
fontSize: 18,
154+
fontWeight: FontWeight.bold,
155+
),
156+
),
157+
),
158+
159+
FlatButton(
160+
onPressed: (){},
161+
child: Container(
162+
alignment: Alignment.center,
163+
color: Colors.green[400],
164+
height: 40,
165+
width: MediaQuery.of(context).size.width,
166+
child: Text("SCAN",
167+
style: TextStyle(
168+
color: Colors.white,
169+
fontSize: 20,
170+
fontWeight: FontWeight.w300,
171+
),
172+
),
173+
),
174+
),
175+
],
176+
),
177+
),
178+
)
179+
],
180+
)
181+
),
182+
],
183+
)
184+
),
185+
186+
);
187+
}
188+
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ flutter:
4848
uses-material-design: true
4949

5050
# To add assets to your application, add an assets section, like this:
51-
# assets:
52-
# - images/a_dot_burr.jpeg
51+
assets:
52+
- assets/images/
5353
# - images/a_dot_ham.jpeg
5454

5555
# An image asset can refer to one or more resolution-specific "variants", see

0 commit comments

Comments
 (0)