Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Charunirathnayake committed Jan 31, 2020
1 parent 43332a8 commit 6a1e67b
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 82 deletions.
1 change: 1 addition & 0 deletions miniproject/lib/app_screen/guideprofile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ class Myprofile extends StatefulWidget {
}

class Myprofile_State extends State<Myprofile> {
//img pass to the firestorage
File _image;

String name, address, city, passion,email;
Expand Down
154 changes: 73 additions & 81 deletions miniproject/lib/app_screen/interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ import 'package:miniproject/app_screen/Login_traveller.dart';
import 'package:miniproject/app_screen/guideprofile.dart';
import 'package:miniproject/app_screen/messages.dart';
import 'package:miniproject/app_screen/messages.dart' as prefix0;
import 'package:miniproject/app_screen/search.dart';
import 'guideprofile.dart';
import 'signup.dart';


//create appbar
class Content extends StatelessWidget{
class Content extends StatelessWidget {
@override
Widget build(BuildContext context) {

return Scaffold(
body:Choosepage(),
body: Choosepage(),
appBar: AppBar(
actions: <Widget>[
IconButton(icon: Icon(Icons.home),onPressed: (){
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => Searchbox()));})

],
title: Text(
'Tour Guide',
style: TextStyle(fontSize: 20.0),
Expand All @@ -27,98 +32,85 @@ class Content extends StatelessWidget{
}

//choose the registration guide or traveller
class Choosepage extends StatefulWidget{
class Choosepage extends StatefulWidget {
@override
State<StatefulWidget> createState() {

return Choosepage_state();
}

}
class Choosepage_state extends State <Choosepage>{

int _selected=0;
void onchanged(int value){
setState(() {
_selected=value;
//TODO LIST(provide the logic to go another page)
});
}
class Choosepage_state extends State<Choosepage> {
int _selected = 0;
void onchanged(int value) {
setState(() {
_selected = value;
//TODO LIST(provide the logic to go another page)
});
}

//create radio buttons for selections.
List <Widget> makeradio(){
List <Widget> list=new List<Widget>();
list.add(
Padding(child:
Column(
children: <Widget>[
Row(
children: <Widget>[
Text('Guide',style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0
),),
SizedBox(
height: 50.0,
width: 25.0,
),
Radio(
value: 0,
groupValue: _selected,
onChanged: (int value){
onchanged(value);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => (LoginInterface()))
);
},
),

],
),



Row(
children: <Widget>[
Text('Travellar',style: TextStyle(fontSize: 20.0,
fontWeight: FontWeight.bold
),),
Radio(
value: 1,
groupValue: _selected,
onChanged: (int value){
onchanged(value);
Navigator.push(
context,
MaterialPageRoute(builder: (context) =>(LoginInterface_traveller()),
));

},
)
],
)


],

), padding: EdgeInsets.all(50.0)

,)
);
List<Widget> makeradio() {
List<Widget> list = new List<Widget>();
list.add(Padding(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'Guide',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
),
SizedBox(
height: 50.0,
width: 25.0,
),
Radio(
value: 0,
groupValue: _selected,
onChanged: (int value) {
onchanged(value);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => (LoginInterface())));
},
),
],
),
Row(
children: <Widget>[
Text(
'Travellar',
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
),
Radio(
value: 1,
groupValue: _selected,
onChanged: (int value) {
onchanged(value);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => (LoginInterface_traveller()),
));
},
)
],
)
],
),
padding: EdgeInsets.all(50.0),
));
return list;
}

@override
Widget build(BuildContext context) {

return Container(
padding: EdgeInsets.only(top: 100.0,left: 60.0),
padding: EdgeInsets.only(top: 100.0, left: 60.0),
child: Center(
child: Column(
children: makeradio()
),
child: Column(children: makeradio()),
),
);
}

}
2 changes: 1 addition & 1 deletion miniproject/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void main(){
theme: ThemeData(
primarySwatch: Colors.brown
),
home:BottomNavBar_traveller(),
home:Home(),
debugShowCheckedModeBanner: false,
)
);
Expand Down
69 changes: 69 additions & 0 deletions miniproject/lib/post_upload/img_upload.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:google_maps_webservice/directions.dart';
import 'package:intl/intl.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';

class Upload_img extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return Upload_img_State();
}
}

class Upload_img_State extends State<Upload_img> {
File sampleImage;
final formkey = GlobalKey<FormState>();
String _myvalue;

Future getImage() async {
var tempImg = await ImagePicker.pickImage(source: ImageSource.gallery);
setState(() {
sampleImage = tempImg;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Upload Image"),
centerTitle: true,
),
body: Center(
child: sampleImage == null ? Text("Select an Image") : enableUpload(),
),
floatingActionButton: FloatingActionButton(
onPressed: getImage,
tooltip: 'Add Image',
child: Icon(Icons.add_a_photo),
),
);
}

Widget enableUpload() {
return Container(child: Form(
key: formkey,
child: Column(
children: <Widget>[
Image.file(sampleImage, height: 330.0, width: 660.0),
SizedBox(
height: 15.0,
),
TextFormField(
decoration: InputDecoration(labelText: 'Description About You'),
validator: (value) {
return value.isEmpty ? 'Description is required' : null;
},
onSaved: (value) {
return _myvalue = value;
},
)
],
),
),);

}
}
7 changes: 7 additions & 0 deletions miniproject/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.4+3"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.8"
js:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions miniproject/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies:
modal_progress_hud: ^0.1.3
image_picker: ^0.5.3+1
firebase_storage: ^3.1.1
intl: ^0.15.7



Expand Down

0 comments on commit 6a1e67b

Please sign in to comment.