Skip to content

Commit

Permalink
Migrate project to flutter 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh.s committed Apr 26, 2024
1 parent b6e903f commit 4053c0a
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 112 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cmake.configureOnOpen": false,
"cSpell.words": [
"fase",
"Gandhinagar",
"kowi",
"linkedin",
"meuzard",
Expand Down
8 changes: 4 additions & 4 deletions lib/404.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class _NotFound404State extends State<NotFound404> {
Widget build(BuildContext context) {
var textStyle = getValueForScreenType<TextStyle>(
context: context,
mobile: Theme.of(context).textTheme.headline4!,
tablet: Theme.of(context).textTheme.headline2,
desktop: Theme.of(context).textTheme.headline1,
mobile: Theme.of(context).textTheme.headlineMedium!,
tablet: Theme.of(context).textTheme.displayMedium,
desktop: Theme.of(context).textTheme.displayLarge,
);

var padding = getValueForScreenType<EdgeInsets>(
Expand Down Expand Up @@ -67,7 +67,7 @@ class _NotFound404State extends State<NotFound404> {
S.of(context).notFoundHome,
style: Theme.of(context)
.textTheme
.headline6
.titleLarge
?.copyWith(color: textColor),
),
),
Expand Down
26 changes: 13 additions & 13 deletions lib/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class About extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: desktopView(context),
tablet: tabletView(context),
mobile: mobileView(context),
return ScreenTypeLayout.builder(
desktop: (context) => desktopView(context),
tablet: (context) => tabletView(context),
mobile: (context) => mobileView(context),
);
}

Expand All @@ -49,12 +49,12 @@ class About extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(S.of(context).aboutGreeting(dayTime()),
style: Theme.of(context).textTheme.headline3),
style: Theme.of(context).textTheme.displaySmall),
Text(S.of(context).title + '.',
style: Theme.of(context).textTheme.headline1),
style: Theme.of(context).textTheme.displayLarge),
SizedBox(height: 40),
Text(S.of(context).aboutDesc,
style: Theme.of(context).textTheme.subtitle1),
style: Theme.of(context).textTheme.titleMedium),
],
),
Tabs(tabData: tabData),
Expand Down Expand Up @@ -84,16 +84,16 @@ class About extends StatelessWidget {
children: [
Text(
S.of(context).aboutGreeting(dayTime()),
style: Theme.of(context).textTheme.headline3,
style: Theme.of(context).textTheme.displaySmall,
),
Text(
S.of(context).title + '.',
style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.displayLarge,
),
SizedBox(height: 40),
Text(
S.of(context).aboutDesc,
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
],
),
Expand Down Expand Up @@ -121,19 +121,19 @@ class About extends StatelessWidget {
FittedBox(
child: Text(
S.of(context).aboutGreeting(dayTime()),
style: Theme.of(context).textTheme.headline3,
style: Theme.of(context).textTheme.displaySmall,
),
),
FittedBox(
child: Text(
S.of(context).title + '.',
style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.displayLarge,
),
),
SizedBox(height: 40),
Text(
S.of(context).aboutDesc,
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions lib/about/contact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:portfolio/components/analytics.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';

class Contact extends StatelessWidget {
const Contact({Key? key}) : super(key: key);
Expand Down Expand Up @@ -66,7 +66,7 @@ class Contact extends StatelessWidget {
}) {
return IconButton(
onPressed: () {
launch(url);
launchUrlString(url);
PortfolioAnalytics.log(LogType.contactClick, property: url);
},
tooltip: tooltip,
Expand Down
12 changes: 6 additions & 6 deletions lib/blogs/blog_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:portfolio/blogs/blog_data.dart';
import 'package:portfolio/components/analytics.dart';
import 'package:portfolio/components/portfolio_card.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:portfolio/components/card_tag.dart';
import 'package:portfolio/style/colours.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:portfolio/components/portfolio_card.dart';
import 'package:portfolio/generated/l10n.dart';
import 'package:portfolio/style/colors.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:url_launcher/url_launcher_string.dart';

class BlogCard extends StatelessWidget {
const BlogCard({
Expand All @@ -21,7 +21,7 @@ class BlogCard extends StatelessWidget {
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
launch(data.url);
launchUrlString(data.url);
PortfolioAnalytics.log(LogType.cardClick, property: data.url);
},
child: PortfolioCard(
Expand All @@ -48,7 +48,7 @@ class BlogCard extends StatelessWidget {
),
Text(
data.title,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Expand Down
8 changes: 4 additions & 4 deletions lib/blogs/blogs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Blogs extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: desktopView(),
tablet: tabletView(),
mobile: mobileView(),
return ScreenTypeLayout.builder(
desktop: (_) => desktopView(),
tablet: (_) => tabletView(),
mobile: (_) => mobileView(),
);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/components/card_tag.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:portfolio/style/colours.dart';
import 'package:portfolio/style/colors.dart';

class CardTag extends StatelessWidget {
const CardTag({
Expand All @@ -20,7 +20,7 @@ class CardTag extends StatelessWidget {
padding: EdgeInsets.all(tagSize),
child: Text(
tag.toUpperCase(),
style: Theme.of(context).textTheme.overline,
style: Theme.of(context).textTheme.labelSmall,
),
),
);
Expand Down
18 changes: 9 additions & 9 deletions lib/components/footer.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import 'package:flutter/material.dart';
import 'package:portfolio/components/analytics.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:portfolio/generated/l10n.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:responsive_builder/responsive_builder.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';

class Footer extends StatelessWidget {
const Footer({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: desktopView(context),
tablet: tabletView(context),
mobile: mobileView(context),
return ScreenTypeLayout.builder(
desktop: (context) => desktopView(context),
tablet: (context) => tabletView(context),
mobile: (context) => mobileView(context),
);
}

Expand All @@ -29,7 +29,7 @@ class Footer extends StatelessWidget {
S.of(context).footerPower +
"."),
onTap: () {
launch("https://dribbble.com/NicolasMzrd");
launchUrlString("https://dribbble.com/NicolasMzrd");
PortfolioAnalytics.log(LogType.footerCreditClick);
},
),
Expand All @@ -46,7 +46,7 @@ class Footer extends StatelessWidget {
child: GestureDetector(
child: Text(S.of(context).footerCredit),
onTap: () {
launch("https://dribbble.com/NicolasMzrd");
launchUrlString("https://dribbble.com/NicolasMzrd");
},
),
),
Expand All @@ -62,7 +62,7 @@ class Footer extends StatelessWidget {
child: GestureDetector(
child: Text(S.of(context).footerCredit),
onTap: () {
launch("https://dribbble.com/NicolasMzrd");
launchUrlString("https://dribbble.com/NicolasMzrd");
},
),
),
Expand Down
20 changes: 14 additions & 6 deletions lib/experience/experience.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Experience extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: desktopView(),
tablet: tabletView(),
mobile: mobileView(),
return ScreenTypeLayout.builder(
desktop: (_) => desktopView(),
tablet: (_) => tabletView(),
mobile: (_) => mobileView(),
);
}

Expand Down Expand Up @@ -54,13 +54,21 @@ class Experience extends StatelessWidget {
}

final data = [
ExperienceData(
organizationName: "Even Healthcare",
position: "Software Engineer",
description:
"Building an awesome product for creators all around the world.",
startYearMonth: "Aug 23",
endYearMonth: "Present",
),
ExperienceData(
organizationName: "Qoohoo",
position: "Product Engineer Intern",
position: "Product Engineer",
description:
"Building an awesome product for creators all around the world.",
startYearMonth: "Oct 21",
endYearMonth: "Present",
endYearMonth: "July 23",
),
ExperienceData(
organizationName: "National Informatics Centre | Govt of India",
Expand Down
4 changes: 2 additions & 2 deletions lib/experience/experience_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:portfolio/components/portfolio_card.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:portfolio/experience/experience_data.dart';
import 'package:portfolio/components/card_tag.dart';
import 'package:portfolio/style/colours.dart';
import 'package:portfolio/style/colors.dart';

class ExperienceCard extends StatelessWidget {
const ExperienceCard({
Expand Down Expand Up @@ -35,7 +35,7 @@ class ExperienceCard extends StatelessWidget {
),
Text(
data.organizationName,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Expand Down
22 changes: 11 additions & 11 deletions lib/homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:portfolio/about/about.dart';
import 'package:portfolio/about/tabs.dart';
import 'package:portfolio/blogs/blogs.dart';
import 'package:portfolio/components/footer.dart';
import 'package:portfolio/style/colours.dart';
import 'package:portfolio/style/colors.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:portfolio/experience/experience.dart';
import 'package:portfolio/generated/l10n.dart';
Expand Down Expand Up @@ -58,10 +58,10 @@ class _HomePageState extends State<HomePage> {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(Constants.globalPadding),
child: ScreenTypeLayout(
desktop: desktopView(),
tablet: tabletView(context),
mobile: mobileView(context),
child: ScreenTypeLayout.builder(
desktop: (context) => desktopView(),
tablet: (context) => tabletView(context),
mobile: (context) => mobileView(context),
),
),
);
Expand Down Expand Up @@ -120,7 +120,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabProjects,
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand All @@ -131,7 +131,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabExperience,
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand All @@ -142,7 +142,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabBlog,
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand Down Expand Up @@ -181,7 +181,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabProjects.split(" ")[1],
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand All @@ -199,7 +199,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabExperience.split(" ")[1],
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand All @@ -217,7 +217,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(Constants.cardMargin),
child: Text(
S.of(context).tabBlog.split(" ")[1],
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:portfolio/firebase_options.dart';
import 'package:portfolio/generated/l10n.dart';
import 'package:portfolio/style/app_theme.dart';
import 'package:portfolio/style/colours.dart';
import 'package:portfolio/style/colors.dart';
import 'package:portfolio/utils/constants.dart';
import 'package:portfolio/utils/routes.dart';
import 'package:responsive_builder/responsive_builder.dart';
Expand Down Expand Up @@ -45,6 +45,7 @@ class MyApp extends StatelessWidget {
Locale('en', ''),
],
theme: ThemeData(
useMaterial3: false,
scaffoldBackgroundColor: ColorPalette.background,
primaryColor: ColorPalette.background,
cardTheme: PortfolioTheme.cardTheme(context),
Expand Down
Loading

0 comments on commit 4053c0a

Please sign in to comment.