Skip to content

Commit

Permalink
Update dependencies and fix linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MH0386 committed Sep 1, 2024
1 parent 74bdd85 commit 3b5f726
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
Expand Down
29 changes: 13 additions & 16 deletions lib/Pages/home.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import 'package:mh0386/Pages/resume.dart';
import 'package:mh0386/controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:mh0386/Pages/resume.dart';
import 'package:mh0386/connector.dart';
import 'package:mh0386/controller.dart';
import 'package:url_launcher/link.dart';
import 'package:flutter_animate/flutter_animate.dart';

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

@override
Widget build(BuildContext context) {
final textController = Get.find<TextController>();
final conn = sendAlert();
print(conn);
return MaterialApp(
title: 'Mohamed Hisham Abdelzaher',
debugShowCheckedModeBanner: false,
Expand Down Expand Up @@ -301,10 +304,7 @@ class Home extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: (MediaQuery.of(context).size.width * 0.1 <
MediaQuery.of(context).size.height * 0.1)
? MediaQuery.of(context).size.width * 0.1
: MediaQuery.of(context).size.height * 0.1,
fontSize: (MediaQuery.of(context).size.width * 0.1 < MediaQuery.of(context).size.height * 0.1) ? MediaQuery.of(context).size.width * 0.1 : MediaQuery.of(context).size.height * 0.1,
fontFamily: GoogleFonts.jetBrainsMono().fontFamily,
),
),
Expand All @@ -313,20 +313,17 @@ class Home extends StatelessWidget {
() => Animate(
effects: const [
FadeEffect(
// delay: Duration(seconds: 1),
// duration: Duration(seconds: 3),
),
// delay: Duration(seconds: 1),
// duration: Duration(seconds: 3),
),
],
child: Text(
textController
.welcomeTexts[textController.currentIndex.value],
textController.welcomeTexts[textController.currentIndex.value],
key: ValueKey<int>(textController.currentIndex.value),
style: TextStyle(
color: Colors.white,
fontSize: (MediaQuery.of(context).size.width * 0.04 <
MediaQuery.of(context).size.height * 0.04)
? MediaQuery.of(context).size.width * 0.04
: MediaQuery.of(context).size.height * 0.04,
fontSize:
(MediaQuery.of(context).size.width * 0.04 < MediaQuery.of(context).size.height * 0.04) ? MediaQuery.of(context).size.width * 0.04 : MediaQuery.of(context).size.height * 0.04,
fontFamily: GoogleFonts.jetBrainsMono().fontFamily,
),
),
Expand Down
14 changes: 14 additions & 0 deletions lib/connector.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:http/http.dart' as http;

sendAlert() async {
try {
final response = await http.get(Uri.parse('https://mh0386backend.vercel.app/send?text=Hello_from_Flutter'));
if (response.statusCode == 200) {
print('Alert Sent');
} else {
print('Failed to send alert: ${response.statusCode}');
}
} catch (e) {
print('Error sending alert: $e');
}
}
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:mh0386/Pages/home.dart';
import 'package:mh0386/Pages/resume.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mh0386/Pages/home.dart';
import 'package:mh0386/Pages/resume.dart';
import 'package:mh0386/controller.dart';

Future<void> main() async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ packages:
source: hosted
version: "6.2.1"
http:
dependency: transitive
dependency: "direct main"
description:
name: http
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
get: ^4.6.6
syncfusion_flutter_pdfviewer: ^26.1.35
flutter_animate: ^4.5.0
http: ^1.2.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 3b5f726

Please sign in to comment.