Skip to content

Commit

Permalink
Finalize the whole app
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-A-A committed Dec 29, 2023
1 parent 39f15a2 commit 5c34ede
Show file tree
Hide file tree
Showing 63 changed files with 897 additions and 769 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<application
android:label="stepn"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/launcher_icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
</resources>
Binary file added assets/app_icon.webp
Binary file not shown.
Binary file added assets/done_icon.webp
Binary file not shown.
Binary file added assets/light/diagnosis_icon.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/light/helpIcon.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/light/license_icon.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/light/repair_icon.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/light/siana_icon.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/light/tunnig_icon.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 modified assets/user.webp
Binary file not shown.
Binary file added assets/welcome_icon.webp
Binary file not shown.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
33 changes: 33 additions & 0 deletions lib/Done_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:stepn/MapScreen.dart';

import 'forms/data/formsContollers.dart';

class DoneScreen extends StatelessWidget {
const DoneScreen({super.key});

@override
Widget build(BuildContext context) {
// Clear form after sending request to API
FormsControllers.clearForm();

return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(image: AssetImage("assets/done_icon.webp"),height: 300,width: 300,),
const Text("طلبك وصلنا, هنتواصل معاك في أسرع وقت",style: TextStyle(fontSize: 20),),
const SizedBox(height: 20,),
ElevatedButton(onPressed: () {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (context) => const MapScreen()),
(Route<dynamic> route) => false,
);
}, child: const Text("القائمة الرئيسية"))
],
),
),
);
}
}
222 changes: 180 additions & 42 deletions lib/MapScreen.dart

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions lib/Welcome_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:stepn/MapScreen.dart';

// Helper class to handle location permission
class LocationPermissionHandler {
static Future<bool> requestLocationPermission() async {
// Check if the location permission is already granted
var status = await Permission.location.status;
if (status == PermissionStatus.granted) {
return true; // Permission already granted
}

// If the permission has been denied or restricted, request it
if (status.isDenied || status.isRestricted) {
status = await Permission.location.request();
}

// Return true if the permission is granted after requesting, otherwise return false
return status == PermissionStatus.granted;
}
}

// Welcome screen widget
class WelcomeScreen extends StatefulWidget {
const WelcomeScreen({Key? key}) : super(key: key);

@override
State<WelcomeScreen> createState() => _WelcomeScreenState();
}

class _WelcomeScreenState extends State<WelcomeScreen> {
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.rtl,
child: Scaffold(
appBar: AppBar(
title: const Text('أهلا بيك في تطبيق استبن',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
fontFamily: 'Roboto')),
),
body: Builder(
builder: (context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(
image: AssetImage("assets/welcome_icon.webp"),
width: 300,
height: 300,
),
const Text(
"أهلا بيك في تطبيق أستبن ، بنقدملك خدمات متكاملة لعربيتك وحل مشاكلها.و علشان نقدر نساعدك محتاجين تسمحلنا نعرف مكانك.",
style: TextStyle(fontSize: 22),
textAlign: TextAlign.center,
),
const SizedBox(
height: 20,
),
ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 10)),
onPressed: () async {
// Request location permission
bool isPermissionGranted =
await LocationPermissionHandler.requestLocationPermission();

if (isPermissionGranted) {
// If permission is granted, navigate to the home screen
navigateHome();
} else {
// If permission is denied, show a snack bar
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('تم رفض إذن الموقع'),
duration: Duration(seconds: 3),
),
);
}
},
child: const Text(
'السماح بالوصول للموقع',
style: TextStyle(fontSize: 20),
),
),
],
),
),
),
);
}

// Function to navigate to the home screen
void navigateHome() {
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => const MapScreen()));
}
}
Loading

0 comments on commit 5c34ede

Please sign in to comment.