Food Ordering App

$20

  • Free support
  • Future product updates
  • Quality checked by Codelug
  • Lowest price guarantee

You are the author of this item. You can download your item

Item Description

“Eat With Us” Documentation by “Ptraxe” v1.0
“Eat With Us”
Created: 02/03/2024
By: ptraxe
Email: ptraxe@proton.me
Thank you for chosing my app. If you have any questions that are beyond the scope of this help file, please feel free to email me. Thanks so much!
Table of Contents
Flutter Structure
Firebase Integration
Dependencies Structure
Flutter Stripe Integration
Sources and Credits
Flutter Structure
This Flutter app is a food ordering application built with Flutter and Dart code. The app follows a specific structure outlined below:
App Structure Overview
The app starts with a splash screen for the first time. After registration, the app determines the logged-in status and email verification status. If they are true, it takes the user to the homepage; otherwise, it shows the splash screen again.
Code Structure
import ‘package:eat_with_us/firebase_options.dart’;
import ‘package:eat_with_us/helpers/splash_screen.dart’;
import ‘package:eat_with_us/screens/button_navbar.dart’;
import ‘package:eat_with_us/services/api_keys.dart’;
import ‘package:firebase_auth/firebase_auth.dart’;
import ‘package:firebase_core/firebase_core.dart’;
import ‘package:flutter/material.dart’;
import ‘package:flutter_stripe/flutter_stripe.dart’;
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
Stripe.instance.applySettings();
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State createState() => _MyAppState();
}
class _MyAppState extends State {
bool isFirebaseInitialized = false;
@override
void initState() {
super.initState();
initializeFirebase();
}
Future initializeFirebase() async {
await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
await Stripe.instance.applySettings();
setState(() { isFirebaseInitialized = true;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp( debugShowCheckedModeBanner: false, title: ‘Eat With Us’, home: isFirebaseInitialized ? FutureBuilder( future: FirebaseAuth.instance.authStateChanges().first, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { User? user = snapshot.data; return determineHomeScreen(user); } else { return const Center(child: CircularProgressIndicator()); } }, ) : const SplashScreen(),
);
}
Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) { return const BottomNavBar();
} else { return const SplashScreen();
}
}
}
Modification
To change the home screen based on email verification status, you can modify the determineHomeScreen method as follows:
Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) {
return const LoginPage();
} else {
return const OrderPage();
}
}
This modification will navigate to the LoginPage if the user is logged in and email verified; otherwise, it will navigate to the OrderPage.
2. Firebase Integration
To integrate Firebase into your Flutter app for both iOS and Android:
Create a Firebase project on the Firebase Console.
Follow the Firebase documentation to add your app to the project.
Download the configuration files and place them in the appropriate directories (android/app/ and ios/Runner/).
Update your Flutter code to use Firebase services as needed (e.g., authentication, database).
3. Dependencies Structure
When integrating dependencies in your Flutter app, use the pubspec.yaml file to manage dependencies. For example:
“`yaml dependencies: flutter: sdk: flutter firebase_core: ^latest_version firebase_auth: ^latest_version firebase_messaging: ^latest_version flutter_stripe: ^latest_version google_fonts: ^latest_version “`
Run flutter pub get to fetch the dependencies.
4. Flutter Stripe Integration
For Flutter Stripe integration:
Visit the Stripe website.
Create or log in to your Stripe account.
Retrieve your Stripe Secret Key and Publishable Key from the Dashboard.
Open the api_keys.dart file located in the services folder of your Flutter project.
Replace the placeholder values for secretKey and publishableKey with your own Stripe Secret Key and Publishable Key.
Example code in api_keys.dart:
“`dart class ApiKeys { static const String secretKey = ‘your_stripe_secret_key’; static const String publishableKey = ‘your_stripe_publishable_key’; }
5. Sources and Credits
Special thanks for resources used in the app:
Splash screen images: Storyset (storyset.com)
Fonts: Google Fonts (pub.dev)
Firebase Messaging for push notifications
Once again, thank you so much for purchasing this app. As I said at the beginning, I’d be glad to help you if you have any questions relating to this app. No guarantees, but I’ll do my best to assist. If you have a more general question relating to the app on codecanyon, you might consider visiting the forums and asking your question in the “Item Discussion” section.
ptraxe

Food Ordering App

Item Description

“Eat With Us” Documentation by “Ptraxe” v1.0
“Eat With Us”
Created: 02/03/2024
By: ptraxe
Email: ptraxe@proton.me
Thank you for chosing my app. If you have any questions that are beyond the scope of this help file, please feel free to email me. Thanks so much!
Table of Contents
Flutter Structure
Firebase Integration
Dependencies Structure
Flutter Stripe Integration
Sources and Credits
Flutter Structure
This Flutter app is a food ordering application built with Flutter and Dart code. The app follows a specific structure outlined below:
App Structure Overview
The app starts with a splash screen for the first time. After registration, the app determines the logged-in status and email verification status. If they are true, it takes the user to the homepage; otherwise, it shows the splash screen again.
Code Structure
import ‘package:eat_with_us/firebase_options.dart’;
import ‘package:eat_with_us/helpers/splash_screen.dart’;
import ‘package:eat_with_us/screens/button_navbar.dart’;
import ‘package:eat_with_us/services/api_keys.dart’;
import ‘package:firebase_auth/firebase_auth.dart’;
import ‘package:firebase_core/firebase_core.dart’;
import ‘package:flutter/material.dart’;
import ‘package:flutter_stripe/flutter_stripe.dart’;
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
Stripe.instance.applySettings();
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State createState() => _MyAppState();
}
class _MyAppState extends State {
bool isFirebaseInitialized = false;
@override
void initState() {
super.initState();
initializeFirebase();
}
Future initializeFirebase() async {
await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
await Stripe.instance.applySettings();
setState(() { isFirebaseInitialized = true;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp( debugShowCheckedModeBanner: false, title: ‘Eat With Us’, home: isFirebaseInitialized ? FutureBuilder( future: FirebaseAuth.instance.authStateChanges().first, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { User? user = snapshot.data; return determineHomeScreen(user); } else { return const Center(child: CircularProgressIndicator()); } }, ) : const SplashScreen(),
);
}
Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) { return const BottomNavBar();
} else { return const SplashScreen();
}
}
}
Modification
To change the home screen based on email verification status, you can modify the determineHomeScreen method as follows:
Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) {
return const LoginPage();
} else {
return const OrderPage();
}
}
This modification will navigate to the LoginPage if the user is logged in and email verified; otherwise, it will navigate to the OrderPage.
2. Firebase Integration
To integrate Firebase into your Flutter app for both iOS and Android:
Create a Firebase project on the Firebase Console.
Follow the Firebase documentation to add your app to the project.
Download the configuration files and place them in the appropriate directories (android/app/ and ios/Runner/).
Update your Flutter code to use Firebase services as needed (e.g., authentication, database).
3. Dependencies Structure
When integrating dependencies in your Flutter app, use the pubspec.yaml file to manage dependencies. For example:
“`yaml dependencies: flutter: sdk: flutter firebase_core: ^latest_version firebase_auth: ^latest_version firebase_messaging: ^latest_version flutter_stripe: ^latest_version google_fonts: ^latest_version “`
Run flutter pub get to fetch the dependencies.
4. Flutter Stripe Integration
For Flutter Stripe integration:
Visit the Stripe website.
Create or log in to your Stripe account.
Retrieve your Stripe Secret Key and Publishable Key from the Dashboard.
Open the api_keys.dart file located in the services folder of your Flutter project.
Replace the placeholder values for secretKey and publishableKey with your own Stripe Secret Key and Publishable Key.
Example code in api_keys.dart:
“`dart class ApiKeys { static const String secretKey = ‘your_stripe_secret_key’; static const String publishableKey = ‘your_stripe_publishable_key’; }
5. Sources and Credits
Special thanks for resources used in the app:
Splash screen images: Storyset (storyset.com)
Fonts: Google Fonts (pub.dev)
Firebase Messaging for push notifications
Once again, thank you so much for purchasing this app. As I said at the beginning, I’d be glad to help you if you have any questions relating to this app. No guarantees, but I’ll do my best to assist. If you have a more general question relating to the app on codecanyon, you might consider visiting the forums and asking your question in the “Item Discussion” section.
ptraxe

Information

Category App Templates / Flutter
First Release 21 February 2024
Last updated 21 February 2024
Platforms Android 10.0
Files included .apk
Framework HTML/CSS YAML
Framework Javascript EXT JS
File Size 15 MB
Database version MySQL 4.x
Frameworks Flutter

$20

  • Free support
  • Future product updates
  • Quality checked by Codelug
  • Lowest price guarantee

You are the author of this item. You can download your item

Information

Category App Templates / Flutter
First Release 21 February 2024
Last updated 21 February 2024
Platforms Android 10.0
Files included .apk
Framework HTML/CSS YAML
Framework Javascript EXT JS
File Size 15 MB
Database version MySQL 4.x
Frameworks Flutter