Skip to content
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
30 changes: 22 additions & 8 deletions gro_sense/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gro_sense">
<application
android:label="gro_sense"

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application
android:label="GroSense"
android:icon="@mipmap/ic_launcher">

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />

<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -16,18 +30,18 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Binary file added gro_sense/assets/app-logo.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 gro_sense/assets/app-logo@110x110.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 gro_sense/assets/banner1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions gro_sense/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:gro_sense/screens/dashboard.dart';
import 'package:gro_sense/screens/first_screen.dart';
import 'package:gro_sense/screens/screen_login.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:gro_sense/navigation.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
Expand Down Expand Up @@ -33,13 +34,13 @@ class MyApp extends StatelessWidget {
home: FutureBuilder(
future: checkLoginStatus(),
builder: (
BuildContext context, AsyncSnapshot<bool>
BuildContext context, AsyncSnapshot<bool>
snapshot){
if(snapshot.data == false){
return FirstPage();
}
return DashBoardScreen();
})
if(snapshot.data == false){
return FirstPage();
}
return MyBottomNavigation();
})
);
}
}
Expand Down
52 changes: 52 additions & 0 deletions gro_sense/lib/navigation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import 'package:gro_sense/screens/dashboard.dart';
import 'package:gro_sense/screens/settings.dart';

import '../screens/addProduct.dart';
import '../screens/charityDetails.dart';
import '../screens/tabbarPage.dart';

class MyBottomNavigation extends StatefulWidget {
@override
_MyBottomNavigationState createState() => _MyBottomNavigationState();
}

class _MyBottomNavigationState extends State<MyBottomNavigation> {

List pages =[
DashBoardScreen(),
tabbarPage(),
AddaProductScreen(),
LocationScreen(),
SettingsScreen(),
];
int currentIndex = 0;
void onTap(int index){
setState((){
currentIndex = index;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: pages[currentIndex],
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
onTap: onTap,
currentIndex: currentIndex,
selectedItemColor: Colors.green[400],
unselectedItemColor: Colors.grey,
showSelectedLabels: false,
showUnselectedLabels: false,
items: [
BottomNavigationBarItem(label: "Home", icon: Icon(Icons.home)),
BottomNavigationBarItem(label: "List",icon: Icon(Icons.format_list_bulleted_rounded)),
BottomNavigationBarItem(label: "Add Product",icon: Icon(Icons.add)),
BottomNavigationBarItem(label: "Charitable Trust",icon: Icon(Icons.share)),
BottomNavigationBarItem(label: "Settings",icon: Icon(Icons.settings)),
],
),
);
}
}
Loading