Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding Page #89 #90

Open
wants to merge 4 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
28 changes: 28 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>forestTreesTagging</name>
<comment>Project forestTreesTagging created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1622216999284</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions .settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/Java/jdk-11.0.5
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
Binary file added assets/images/onboard_1.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 assets/images/onboard_2.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 assets/images/onboard_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions lib/data/data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';


class SliderModel{

String imageAssetPath;
String title;
String desc;

SliderModel({this.imageAssetPath,this.title,this.desc});

void setImageAssetPath(String getImageAssetPath){
imageAssetPath = getImageAssetPath;
}

void setTitle(String getTitle){
title = getTitle;
}

void setDesc(String getDesc){
desc = getDesc;
}

String getImageAssetPath(){
return imageAssetPath;
}

String getTitle(){
return title;
}

String getDesc(){
return desc;
}

}


List<SliderModel> getSlides(){

List<SliderModel> slides = new List<SliderModel>();
SliderModel sliderModel = new SliderModel();

//1
sliderModel.setDesc("Digital transformation of maintaining the records of forest trees.");
sliderModel.setTitle("Tag Trees!");
sliderModel.setImageAssetPath("assets/images/onboard_1.png");
slides.add(sliderModel);

sliderModel = new SliderModel();

//2
sliderModel.setDesc("QR code generation for unique identification of every tree, prediction of different parameters and much more!");
sliderModel.setTitle("Locate Trees!");
sliderModel.setImageAssetPath("assets/images/onboard_2.png");
slides.add(sliderModel);

sliderModel = new SliderModel();

//3
sliderModel.setDesc("Our app helps in analyzing the various aspects regarding trees! diversity, age, height, growth, and much more");
sliderModel.setTitle("Save Trees!");
sliderModel.setImageAssetPath("assets/images/onboard_3.png");
slides.add(sliderModel);

sliderModel = new SliderModel();

return slides;
}
8 changes: 8 additions & 0 deletions lib/data/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:flutter/material.dart';

class Main extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}
197 changes: 182 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,28 +1,195 @@
import 'package:firebase_core/firebase_core.dart';
import 'dart:io';
import 'package:forest_tagger/components/WelComePage.dart';
import 'package:forest_tagger/components/signUp.dart';
import 'package:forest_tagger/data/data.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';

import 'package:forest_tagger/components/AuthHandler.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Home(),
debugShowCheckedModeBanner: false,
);
}
}

class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {

void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
// ignore: deprecated_member_use
List<SliderModel> mySLides = new List<SliderModel>();
int slideIndex = 0;
PageController controller;

Widget _buildPageIndicator(bool isCurrentPage){
return Container(
margin: EdgeInsets.symmetric(horizontal: 2.0),
height: isCurrentPage ? 10.0 : 6.0,
width: isCurrentPage ? 10.0 : 6.0,
decoration: BoxDecoration(
color: isCurrentPage ? Colors.brown : Colors.brown,
borderRadius: BorderRadius.circular(12),
),
);
}

@override
void initState() {
// ignore: todo
// TODO: implement initState
super.initState();
mySLides = getSlides();
controller = new PageController();
}

@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [const Color(0xff3C8CE7), const Color(0xff00EAFF)])),
child: Scaffold(
backgroundColor: Colors.white,
body: Container(
height: MediaQuery.of(context).size.height - 100,
child: PageView(
controller: controller,
onPageChanged: (index) {
setState(() {
slideIndex = index;
});
},
children: <Widget>[
SlideTile(
imagePath: mySLides[0].getImageAssetPath(),
title: mySLides[0].getTitle(),
desc: mySLides[0].getDesc(),
),
SlideTile(
imagePath: mySLides[1].getImageAssetPath(),
title: mySLides[1].getTitle(),
desc: mySLides[1].getDesc(),
),
SlideTile(
imagePath: mySLides[2].getImageAssetPath(),
title: mySLides[2].getTitle(),
desc: mySLides[2].getDesc(),
)
],
),
),
bottomSheet: slideIndex != 2 ? Container(
margin: EdgeInsets.symmetric(vertical: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
// ignore: deprecated_member_use
FlatButton(
onPressed: (){
controller.animateToPage(2, duration: Duration(milliseconds: 400), curve: Curves.linear);
},
splashColor: Colors.blue[50],
child: Text(
"SKIP",
style: TextStyle(color: Colors.greenAccent, fontWeight: FontWeight.w600,
background: Paint()
..strokeWidth = 50.0
..color = Colors.brown
..style = PaintingStyle.stroke
..strokeJoin = StrokeJoin.round),
),
),
Container(
child: Row(
children: [
for (int i = 0; i < 3 ; i++) i == slideIndex ? _buildPageIndicator(true): _buildPageIndicator(false),
],),
),
// ignore: deprecated_member_use
FlatButton(
onPressed: (){
print("this is slideIndex: $slideIndex");
controller.animateToPage(slideIndex + 1, duration: Duration(milliseconds: 500), curve: Curves.linear);
},
splashColor: Colors.blue[50],
child: Text(
"NEXT",
style: TextStyle(color: Colors.greenAccent, fontWeight: FontWeight.w600,
background: Paint()
..strokeWidth = 50.0
..color = Colors.brown
..style = PaintingStyle.stroke
..strokeJoin = StrokeJoin.round),
),
),
],
),
): InkWell(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Welcome()),
);
},
child: Container(

height: Platform.isIOS ? 70 : 60,
color: Colors.lightGreen,
alignment: Alignment.center,
child: Text(
"LETS GO!!",
style: TextStyle(color: Colors.brown, fontWeight: FontWeight.w900),),

),
),
),
);
}
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
// ignore: must_be_immutable
class SlideTile extends StatelessWidget {
String imagePath, title, desc;

SlideTile({this.imagePath, this.title, this.desc});

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.green,
return Container(
padding: EdgeInsets.symmetric(horizontal: 20),
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(imagePath),
SizedBox(
height: 40,
),
Text(title, textAlign: TextAlign.center,style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 20
),),
SizedBox(
height: 20,
),
Text(desc, textAlign: TextAlign.center,style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14))
],
),
home: loggedInChecking(),
);
}
}
}

Loading