Skip to content

Commit

Permalink
Dart Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rayliverified committed Feb 24, 2024
1 parent 1471d3b commit 44930c6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 36 deletions.
4 changes: 2 additions & 2 deletions lib/pages/page_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class TypographyPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
children: [
SingleChildScrollView(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 32),
child: Column(
children: <Widget>[
children: [
Container(
margin: marginBottom40,
),
Expand Down
24 changes: 12 additions & 12 deletions lib/ui/blocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WebsiteMenuBar extends StatelessWidget {
]),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: <Widget>[
children: [
const Padding(
padding: EdgeInsets.only(right: 16),
child: Icon(Icons.menu, color: textPrimary, size: 28)),
Expand Down Expand Up @@ -483,7 +483,7 @@ class Features extends StatelessWidget {
rowFlex: 1,
rowFit: FlexFit.tight,
child: Column(
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 32),
child: buildMaterialIconCircle(
Expand All @@ -506,7 +506,7 @@ class Features extends StatelessWidget {
rowFlex: 1,
rowFit: FlexFit.tight,
child: Column(
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 32),
child:
Expand All @@ -529,7 +529,7 @@ class Features extends StatelessWidget {
rowFlex: 1,
rowFit: FlexFit.tight,
child: Column(
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 32),
child: buildMaterialIconCircle(
Expand Down Expand Up @@ -648,7 +648,7 @@ class _FastDevelopmentState extends State<FastDevelopment> {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: buildMaterialIconCircle(
Expand Down Expand Up @@ -753,7 +753,7 @@ class _BeautifulUIState extends State<BeautifulUI> {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: buildMaterialIconCircle(
Expand Down Expand Up @@ -894,7 +894,7 @@ class _NativePerformanceState extends State<NativePerformance> {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: buildMaterialIconCircle(
Expand Down Expand Up @@ -1008,7 +1008,7 @@ class _LearnFromDevelopersState extends State<LearnFromDevelopers> {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
const Padding(
padding: EdgeInsets.only(bottom: 32),
child:
Expand Down Expand Up @@ -1093,7 +1093,7 @@ class WhoUsesFlutter extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
const Padding(
padding: EdgeInsets.only(bottom: 16),
child:
Expand Down Expand Up @@ -1193,7 +1193,7 @@ class FlutterNewsCard extends StatelessWidget {
border: Border.all(color: border)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
Container(
constraints: const BoxConstraints(maxHeight: 400),
child: Image.asset(imagePath, fit: BoxFit.fitWidth),
Expand All @@ -1202,7 +1202,7 @@ class FlutterNewsCard extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(40, 40, 40, 40),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: Text("News",
Expand Down Expand Up @@ -1490,7 +1490,7 @@ class Footer extends StatelessWidget {
columnFit: FlexFit.loose,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
RichText(
textAlign: TextAlign.left,
text: TextSpan(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/carousel/carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Carousel extends StatefulWidget {
Carousel({super.key});

@override
_CarouselState createState() => _CarouselState();
State<Carousel> createState() => _CarouselState();
}

class _CarouselState extends State<Carousel>
Expand Down
7 changes: 3 additions & 4 deletions lib/ui/carousel/carousel_slide_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CarouselSlide1 extends StatefulWidget {
const CarouselSlide1({super.key, required this.slideDuration});

@override
_CarouselSlide1State createState() => _CarouselSlide1State();
State<CarouselSlide1> createState() => _CarouselSlide1State();
}

class _CarouselSlide1State extends State<CarouselSlide1>
Expand Down Expand Up @@ -60,8 +60,7 @@ class _CarouselSlide1State extends State<CarouselSlide1>
animation = Tween<double>(begin: 0, end: 252).animate(animationController)
..addListener(() {
setState(() {
slideItems =
getSlideItemAnimationUpdate(animation.value, slideItems);
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
});
});
animationController.forward();
Expand All @@ -73,7 +72,7 @@ class _CarouselSlide1State extends State<CarouselSlide1>
width: 1200,
height: 1200,
child: Stack(
children: <Widget>[
children: [
Positioned(
left: 449,
top: 116,
Expand Down
7 changes: 3 additions & 4 deletions lib/ui/carousel/carousel_slide_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CarouselSlide2 extends StatefulWidget {
const CarouselSlide2({super.key, required this.slideDuration});

@override
_CarouselSlide2State createState() => _CarouselSlide2State();
State<CarouselSlide2> createState() => _CarouselSlide2State();
}

class _CarouselSlide2State extends State<CarouselSlide2>
Expand Down Expand Up @@ -60,8 +60,7 @@ class _CarouselSlide2State extends State<CarouselSlide2>
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
..addListener(() {
setState(() {
slideItems =
getSlideItemAnimationUpdate(animation.value, slideItems);
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
});
});
animationController.forward();
Expand All @@ -73,7 +72,7 @@ class _CarouselSlide2State extends State<CarouselSlide2>
width: 1200,
height: 640,
child: Stack(
children: <Widget>[
children: [
Positioned(
left: 36,
top: 136,
Expand Down
7 changes: 3 additions & 4 deletions lib/ui/carousel/carousel_slide_3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CarouselSlide3 extends StatefulWidget {
const CarouselSlide3({super.key, required this.slideDuration});

@override
_CarouselSlide3State createState() => _CarouselSlide3State();
State<CarouselSlide3> createState() => _CarouselSlide3State();
}

class _CarouselSlide3State extends State<CarouselSlide3>
Expand Down Expand Up @@ -60,8 +60,7 @@ class _CarouselSlide3State extends State<CarouselSlide3>
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
..addListener(() {
setState(() {
slideItems =
getSlideItemAnimationUpdate(animation.value, slideItems);
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
});
});
animationController.forward();
Expand All @@ -73,7 +72,7 @@ class _CarouselSlide3State extends State<CarouselSlide3>
width: 1200,
height: 640,
child: Stack(
children: <Widget>[
children: [
Positioned(
left: 400,
top: 117,
Expand Down
7 changes: 3 additions & 4 deletions lib/ui/carousel/carousel_slide_4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CarouselSlide4 extends StatefulWidget {
const CarouselSlide4({super.key, required this.slideDuration});

@override
_CarouselSlide4State createState() => _CarouselSlide4State();
State<CarouselSlide4> createState() => _CarouselSlide4State();
}

class _CarouselSlide4State extends State<CarouselSlide4>
Expand Down Expand Up @@ -60,8 +60,7 @@ class _CarouselSlide4State extends State<CarouselSlide4>
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
..addListener(() {
setState(() {
slideItems =
getSlideItemAnimationUpdate(animation.value, slideItems);
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
});
});
animationController.forward();
Expand All @@ -73,7 +72,7 @@ class _CarouselSlide4State extends State<CarouselSlide4>
width: 1200,
height: 640,
child: Stack(
children: <Widget>[
children: [
Positioned(
left: 345,
top: 132,
Expand Down
15 changes: 10 additions & 5 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import 'package:flutter/foundation.dart';
import 'package:url_launcher/url_launcher.dart';

Future<bool> openUrl(String url, {bool newWindow = false}) async {
if (await canLaunch(url)) {
return await launch(
url,
);
} else {
try {
if (await canLaunchUrl(Uri.parse(url))) {
return await launchUrl(
Uri.parse(url),
);
} else {
debugPrint("Could not launch $url");
return false;
}
} catch (e) {
debugPrint("Could not launch $url");
return false;
}
Expand Down

0 comments on commit 44930c6

Please sign in to comment.