Skip to content

Commit

Permalink
feat: Adds developer info, launchUrl and fix login issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abhibhaw committed Jul 14, 2024
1 parent 4488665 commit 7b50bcc
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 14 deletions.
1 change: 1 addition & 0 deletions milkton_executive/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="Milkton Executive"
android:name="${applicationName}"
Expand Down
80 changes: 78 additions & 2 deletions milkton_executive/lib/presentation/screens/developer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:milkton_executive/utils/launch_url.dart';

class DeveloperInfoScreen extends StatelessWidget {
const DeveloperInfoScreen({super.key});
Expand All @@ -11,8 +12,83 @@ class DeveloperInfoScreen extends StatelessWidget {
backgroundColor: Colors.deepPurpleAccent,
title: const Text("Developer Info"),
),
body: const Center(
child: Text("Developer Info Coming Soon..."),
body: Padding(
padding: const EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(
image: AssetImage(
"assets/images/gepton.png",
),
width: 200,
),
const SizedBox(
height: 20,
),
const Text(
"Gepton is a leading technology firm specializing in creating innovative and efficient digital solutions. Our team of expert techies, are passionate about building exceptional tech solutions for your unique requirements."),
const SizedBox(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () => openUrl("tel:+919099199104"),
child: const Card(
semanticContainer: true,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: [
Icon(
Icons.call,
),
Text("9099199104"),
],
),
),
),
),
GestureDetector(
onTap: () => openUrl("mailto:[email protected]"),
child: const Card(
semanticContainer: true,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: [
Icon(
Icons.mail,
),
Text("[email protected]"),
],
),
),
),
),
GestureDetector(
onTap: () => openUrl("https://gepton.com"),
child: const Card(
semanticContainer: true,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: [
Icon(
Icons.web,
),
Text("gepton.com"),
],
),
),
),
),
],
)
],
),
),
);
}
Expand Down
2 changes: 2 additions & 0 deletions milkton_executive/lib/presentation/widgets/order_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:milkton_executive/models/order.dart';
import 'package:milkton_executive/presentation/widgets/deliver_button.dart';
import 'package:milkton_executive/presentation/widgets/undeliver_button.dart';
import 'package:milkton_executive/utils/launch_url.dart';

Color requiredColor(final String status) {
return status == 'ACTIVE'
Expand All @@ -27,6 +28,7 @@ class OrderCard extends StatelessWidget {
child: Column(
children: [
ListTile(
onTap: () => openUrl("tel:+91${order.customer.phone}"),
leading: const Icon(Icons.person),
title:
Text('${order.customer.firstName} ${order.customer.lastName}'),
Expand Down
10 changes: 0 additions & 10 deletions milkton_executive/lib/presentation/widgets/top_nav_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:milkton_executive/cubit/user/user_cubit.dart';
import 'package:milkton_executive/models/executive.dart';
import 'package:milkton_executive/presentation/screens/developer.dart';
import 'package:milkton_executive/presentation/screens/product_summary.dart';
import 'package:milkton_executive/presentation/screens/profile.dart';
import 'package:milkton_executive/utils/data.dart';

class TopNavDrawer extends StatelessWidget {
Expand Down Expand Up @@ -65,15 +64,6 @@ class TopNavDrawer extends StatelessWidget {
}));
},
),
ListTile(
leading: const Icon(Icons.person),
title: const Text('Profile'),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const Profile();
}));
},
),
ListTile(
leading: const Icon(Icons.link),
title: const Text('Developer Info'),
Expand Down
8 changes: 8 additions & 0 deletions milkton_executive/lib/utils/launch_url.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:url_launcher/url_launcher.dart';

Future<void> openUrl(String url) async {
Uri uri = Uri.parse(url);
if (!await launchUrl(uri)) {
throw Exception('Could not launch $url');
}
}
2 changes: 1 addition & 1 deletion milkton_executive/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ packages:
source: hosted
version: "1.3.2"
url_launcher:
dependency: transitive
dependency: "direct main"
description:
name: url_launcher
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
Expand Down
3 changes: 2 additions & 1 deletion milkton_executive/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "Milkton Delivery Executive App"

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 5.1.0+51
version: 5.2.0+52

environment:
sdk: '>=3.2.3 <4.0.0'
Expand All @@ -20,6 +20,7 @@ dependencies:
intl: ^0.19.0
graphql_flutter: ^5.2.0-beta.6
supabase_flutter: ^2.5.6
url_launcher: ^6.3.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 7b50bcc

Please sign in to comment.