Download Eat With Us - Flutter Food Ordering App Codester 47587
This is a Food Ordering app with unique user interface the ui meets the best when it comes to food app in the 21st century. this app offers user the previlage to customize there order just as they want, user can keep track of there food status, this app offers great security, smooth interface, well structured code, and so many more
Features
1. Food Ordering2. Smooth user Interface
3. Special meal request
4. Live Food Update status
5. Push notifications
6.Easy complaint form
7. Rate meals
8.Meal Status notification.
9.Easy Payment
10. Admin App
11. Lots more
Requirements
1. IDE2. Flutter Sdk
3. Firebase
4. Stripe
5. Google Fonts
Instructions
"Eat With Us" Documentation by "Ptraxe" v1.0
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
<code>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';</p>
<p>Future main() async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
Stripe.instance.applySettings();
runApp(const MyApp());
}</p>
<p>class MyApp extends StatefulWidget {
const MyApp({super.key});</p>
<p>@override
State<MyApp> createState() => _MyAppState();
}</p>
<p>class _MyAppState extends State<MyApp> {
bool isFirebaseInitialized = false;</p>
<p>@override
void initState() {
super.initState();
initializeFirebase();
}</p>
<p>Future<void> initializeFirebase() async {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = ApiKeys.publishKey;
await Stripe.instance.applySettings();
setState(() {
isFirebaseInitialized = true;
});
}</p>
<p>@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(),
);
}</p>
<p>Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) {
return const BottomNavBar();
} else {
return const SplashScreen();
}
}
}
</code>
Modification
To change the home screen based on email verification status, you can modify the determineHomeScreen method as follows:<code>
Widget determineHomeScreen(User? user) {
if (user != null && user.emailVerified) {
return const LoginPage();
} else {
return const OrderPage();
}
}
</code>
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
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
```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 (
ptraxe
Link to demo apk download https://mega.nz/file/0iVRlaxK#...

