Skip to content

Commit

Permalink
Merge pull request harveyjavier#2 from harveyjavier/fix-newsfeed-and-…
Browse files Browse the repository at this point in the history
…profile-page

Fix newsfeed and profile page
  • Loading branch information
harveyjavier authored Oct 31, 2019
2 parents 5c99516 + 2c713cf commit 29683b5
Show file tree
Hide file tree
Showing 18 changed files with 279 additions and 566 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ buildTypes {
}
```

2. Open the project on your cmd or terminal, type flutter run, then you're good to go!
2. Open android/local.properties file and add the following lines-

```
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
```

3. Open the project on your cmd or terminal, type flutter run, then you're good to go!

```
flutter run
Expand Down
42 changes: 21 additions & 21 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import 'package:bicolit/utils/uidata.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

import 'package:bicolit/screens/login.dart';
import 'package:bicolit/screens/registerOne.dart';
import 'package:bicolit/screens/registerTwo.dart';
// import 'package:bicolit/screens/registerThree.dart';
// import 'package:bicolit/screens/registerFour.dart';
//import 'package:bicolit/screens/newsFeed.dart';
//import 'package:bicolit/screens/profile.dart';
//import 'package:bicolit/screens/notfound_page.dart';
import 'package:bicolit/screens/register_one.dart';
import 'package:bicolit/screens/register_two.dart';
import 'package:bicolit/screens/news_feed.dart';
import 'package:bicolit/screens/profile.dart';
import 'package:bicolit/screens/edit_education.dart';
import 'package:bicolit/screens/edit_experience.dart';
import 'package:bicolit/screens/notfound_page.dart';

class App extends StatelessWidget {
final materialApp = MaterialApp(
Expand All @@ -36,27 +36,27 @@ class App extends StatelessWidget {
const Locale("en", "US"),
const Locale("hi", "IN"),
],
// initialRoute: UIData.notFoundRoute,
//initialRoute: UIData.notFoundRoute,

//routes
routes: <String, WidgetBuilder>{
UIData.loginRoute: (BuildContext context) => Login(),
UIData.registerOneRoute: (BuildContext context) => RegisterOne(),
UIData.registerTwoRoute: (BuildContext context) => RegisterTwo(),
// UIData.registerThreeRoute: (BuildContext context) => RegisterThree(),
// UIData.registerFourRoute: (BuildContext context) => RegisterFour(),
//UIData.newsFeedRoute: (BuildContext context) => NewsFeed(),
//UIData.profileRoute: (BuildContext context) => Profile(),
UIData.newsFeedRoute: (BuildContext context) => NewsFeed(),
UIData.profileRoute: (BuildContext context) => Profile(),
UIData.editEducationRoute: (BuildContext context) => EditEducation(),
UIData.editExperienceRoute: (BuildContext context) => EditExperience(),
},
// onUnknownRoute: (RouteSettings rs) => new MaterialPageRoute(
// builder: (context) => new NotFoundPage(
// appTitle: UIData.coming_soon,
// icon: FontAwesomeIcons.solidSmile,
// title: UIData.coming_soon,
// message: "Under Development",
// iconColor: Colors.green,
// )
// )
onUnknownRoute: (RouteSettings rs) => new MaterialPageRoute(
builder: (context) => new NotFoundPage(
appTitle: UIData.coming_soon,
icon: FontAwesomeIcons.solidSmile,
title: UIData.coming_soon,
message: "Under Development",
iconColor: Colors.green,
)
)
);

@override
Expand Down
21 changes: 9 additions & 12 deletions lib/screens/registerThree.dart → lib/screens/edit_education.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import 'package:localstorage/localstorage.dart';
import 'package:email_validator/email_validator.dart';
import 'dart:async';

import 'package:bicolit/tools/textFieldIconButton.dart';
import 'package:bicolit/tools/registerThreeForm.dart';
import 'package:bicolit/tools/text_field_icon_button.dart';
import 'package:bicolit/tools/education_form.dart';
import 'package:bicolit/model/education.dart';

class RegisterThree extends StatefulWidget {
class EditEducation extends StatefulWidget {
@override
State<StatefulWidget> createState() => _RegisterThreeState();
State<StatefulWidget> createState() => _EditEducationState();
}

class _RegisterThreeState extends State<RegisterThree> {
class _EditEducationState extends State<EditEducation> {
final db = Firestore.instance;
final storage = LocalStorage("data");
final _scaffoldKey = GlobalKey<ScaffoldState>();

List<Education> _education = [];
List<RegisterThreeForm> _forms = [];
List<EducationForm> _forms = [];
bool _canAdd = true;

@override
Expand All @@ -33,9 +33,7 @@ class _RegisterThreeState extends State<RegisterThree> {
storage.clear();
}

Future<bool> _onBack() {
Navigator.pushNamed(context, UIData.registerTwoRoute);
}
Future<bool> _onBack() {}

void addField() {
if (_canAdd) {
Expand All @@ -55,7 +53,7 @@ class _RegisterThreeState extends State<RegisterThree> {
Widget build(BuildContext context) {
_forms.clear();
for (int i=0; i<_education.length; i++){
_forms.add(RegisterThreeForm(
_forms.add(EducationForm(
key: GlobalKey(),
education: _education[i],
delete: () => deleteFields(i),
Expand All @@ -70,7 +68,7 @@ class _RegisterThreeState extends State<RegisterThree> {
backgroundColor: Colors.black,
actions: <Widget>[
FlatButton(
child: Text("Next", style: TextStyle(color: Colors.white),),
child: Text("Submit", style: TextStyle(color: Colors.white),),
onPressed: next,
),
// IconButton(
Expand Down Expand Up @@ -103,6 +101,5 @@ class _RegisterThreeState extends State<RegisterThree> {

void next() async {
_forms.forEach((form) => print(form.isValid()));
Navigator.pushNamed(context, UIData.registerFourRoute);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import 'package:localstorage/localstorage.dart';
import 'package:email_validator/email_validator.dart';
import 'dart:async';

import 'package:bicolit/tools/textFieldIconButton.dart';
import 'package:bicolit/tools/registerFourForm.dart';
import 'package:bicolit/tools/text_field_icon_button.dart';
import 'package:bicolit/tools/experience_form.dart';
import 'package:bicolit/model/experience.dart';

class RegisterFour extends StatefulWidget {
class EditExperience extends StatefulWidget {
@override
State<StatefulWidget> createState() => _RegisterFourState();
State<StatefulWidget> createState() => _EditExperienceState();
}

class _RegisterFourState extends State<RegisterFour> {
class _EditExperienceState extends State<EditExperience> {
final db = Firestore.instance;
final storage = LocalStorage("data");
final _scaffoldKey = GlobalKey<ScaffoldState>();

List<Experience> _experience = [];
List<RegisterFourForm> _forms = [];
List<ExperienceForm> _forms = [];
bool _canAdd = true;

@override
Expand Down Expand Up @@ -51,7 +51,7 @@ class _RegisterFourState extends State<RegisterFour> {
Widget build(BuildContext context) {
_forms.clear();
for (int i=0; i<_experience.length; i++){
_forms.add(RegisterFourForm(
_forms.add(ExperienceForm(
key: GlobalKey(),
experience: _experience[i],
delete: () => deleteFields(i),
Expand All @@ -64,7 +64,7 @@ class _RegisterFourState extends State<RegisterFour> {
backgroundColor: Colors.black,
actions: <Widget>[
FlatButton(
child: Text("Next", style: TextStyle(color: Colors.white),),
child: Text("Submit", style: TextStyle(color: Colors.white),),
onPressed: next,
),
],
Expand Down
10 changes: 5 additions & 5 deletions lib/screens/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:localstorage/localstorage.dart';
import 'package:email_validator/email_validator.dart';
import 'dart:io';

import 'package:bicolit/tools/textFieldIconButton.dart';
//import 'package:bicolit/screens/newsFeed.dart';
import 'package:bicolit/tools/text_field_icon_button.dart';
import 'package:bicolit/screens/news_feed.dart';

class Login extends StatefulWidget {
@override
Expand Down Expand Up @@ -66,7 +66,7 @@ class _LoginState extends State<Login> {

@override
Widget build(BuildContext context) {
//if (storage.getItem("user_data") == null) {
if (storage.getItem("user_data") == null) {
return WillPopScope(
onWillPop: _onBack,
child: Scaffold(
Expand All @@ -77,8 +77,8 @@ class _LoginState extends State<Login> {
),
),
);
//} else
//{ return NewsFeed(); }
} else
{ return NewsFeed(); }
}

loginBody() => SingleChildScrollView(
Expand Down
Loading

0 comments on commit 29683b5

Please sign in to comment.