Skip to content

Commit

Permalink
change effect
Browse files Browse the repository at this point in the history
  • Loading branch information
MH0386 committed Jul 16, 2024
1 parent bb526f2 commit 1bf9f18
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 68 deletions.
68 changes: 1 addition & 67 deletions lib/Pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:mh0386/controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
import 'package:url_launcher/link.dart';
import 'package:flutter_animate/flutter_animate.dart';

Expand Down Expand Up @@ -52,17 +51,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
textController.socialMediaTitle.value =
'Go to Facebook';
print(textController.socialMediaTitle.value);
} else {
textController.socialMediaTitle.value =
'Social Media';
print(textController.socialMediaTitle.value);
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -84,13 +72,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -112,13 +93,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -140,13 +114,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -168,13 +135,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -196,13 +156,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -224,13 +177,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -252,13 +198,6 @@ class Home extends StatelessWidget {
fontSize: 20,
),
),
onHover: (isHovering) {
if (isHovering) {
print('Mouse is over button');
} else {
print('Mouse is not over button');
}
},
),
),
const SizedBox(height: 10),
Expand All @@ -285,12 +224,7 @@ class Home extends StatelessWidget {
child: const Text('Social Media'),
),
ElevatedButton(
onPressed: () => Get.defaultDialog(
title: 'Resume',
content: SfPdfViewer.network(
'https://mh0386.github.io/resume.pdf',
),
),
onPressed: () => Get.to(() => const Resume()),
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white,
backgroundColor: Colors.black,
Expand Down
40 changes: 39 additions & 1 deletion lib/Pages/resume.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,45 @@ class Resume extends StatelessWidget {

@override
Widget build(BuildContext context) {
final pdfViewerController = PdfViewerController();
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(scaffoldBackgroundColor: Colors.black),
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.black,
foregroundColor: Colors.white,
title: const Text('Resume'),
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon: const Icon(
Icons.zoom_in,
color: Colors.white,
),
onPressed: () {
pdfViewerController.zoomLevel += 0.5;
},
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.1,
),
const Text('Resume'),
SizedBox(
width: MediaQuery.of(context).size.width * 0.1,
),
IconButton(
icon: const Icon(
Icons.zoom_out,
color: Colors.white,
),
onPressed: () {
pdfViewerController.zoomLevel -= 0.5;
},
),
],
),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => Get.back(),
Expand Down Expand Up @@ -44,8 +75,15 @@ class Resume extends StatelessWidget {
),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () => pdfViewerController.zoomLevel = 1.5,
child: const Icon(Icons.refresh),
),
body: SfPdfViewer.network(
'https://mh0386.github.io/resume.pdf',
pageLayoutMode: PdfPageLayoutMode.single,
initialZoomLevel: 1.5,
controller: pdfViewerController,
),
),
);
Expand Down

0 comments on commit 1bf9f18

Please sign in to comment.