Skip to content

Commit 44930c6

Browse files
committed
Dart Fix
1 parent 1471d3b commit 44930c6

8 files changed

+37
-36
lines changed

lib/pages/page_styles.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ class TypographyPage extends StatelessWidget {
88
Widget build(BuildContext context) {
99
return Scaffold(
1010
body: Stack(
11-
children: <Widget>[
11+
children: [
1212
SingleChildScrollView(
1313
child: Container(
1414
margin: const EdgeInsets.symmetric(horizontal: 32),
1515
child: Column(
16-
children: <Widget>[
16+
children: [
1717
Container(
1818
margin: marginBottom40,
1919
),

lib/ui/blocks.dart

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class WebsiteMenuBar extends StatelessWidget {
2424
]),
2525
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
2626
child: Row(
27-
children: <Widget>[
27+
children: [
2828
const Padding(
2929
padding: EdgeInsets.only(right: 16),
3030
child: Icon(Icons.menu, color: textPrimary, size: 28)),
@@ -483,7 +483,7 @@ class Features extends StatelessWidget {
483483
rowFlex: 1,
484484
rowFit: FlexFit.tight,
485485
child: Column(
486-
children: <Widget>[
486+
children: [
487487
Padding(
488488
padding: const EdgeInsets.only(bottom: 32),
489489
child: buildMaterialIconCircle(
@@ -506,7 +506,7 @@ class Features extends StatelessWidget {
506506
rowFlex: 1,
507507
rowFit: FlexFit.tight,
508508
child: Column(
509-
children: <Widget>[
509+
children: [
510510
Padding(
511511
padding: const EdgeInsets.only(bottom: 32),
512512
child:
@@ -529,7 +529,7 @@ class Features extends StatelessWidget {
529529
rowFlex: 1,
530530
rowFit: FlexFit.tight,
531531
child: Column(
532-
children: <Widget>[
532+
children: [
533533
Padding(
534534
padding: const EdgeInsets.only(bottom: 32),
535535
child: buildMaterialIconCircle(
@@ -648,7 +648,7 @@ class _FastDevelopmentState extends State<FastDevelopment> {
648648
child: Column(
649649
mainAxisSize: MainAxisSize.min,
650650
crossAxisAlignment: CrossAxisAlignment.start,
651-
children: <Widget>[
651+
children: [
652652
Padding(
653653
padding: const EdgeInsets.only(bottom: 16),
654654
child: buildMaterialIconCircle(
@@ -753,7 +753,7 @@ class _BeautifulUIState extends State<BeautifulUI> {
753753
child: Column(
754754
mainAxisSize: MainAxisSize.min,
755755
crossAxisAlignment: CrossAxisAlignment.start,
756-
children: <Widget>[
756+
children: [
757757
Padding(
758758
padding: const EdgeInsets.only(bottom: 16),
759759
child: buildMaterialIconCircle(
@@ -894,7 +894,7 @@ class _NativePerformanceState extends State<NativePerformance> {
894894
child: Column(
895895
mainAxisSize: MainAxisSize.min,
896896
crossAxisAlignment: CrossAxisAlignment.start,
897-
children: <Widget>[
897+
children: [
898898
Padding(
899899
padding: const EdgeInsets.only(bottom: 16),
900900
child: buildMaterialIconCircle(
@@ -1008,7 +1008,7 @@ class _LearnFromDevelopersState extends State<LearnFromDevelopers> {
10081008
child: Column(
10091009
mainAxisSize: MainAxisSize.min,
10101010
crossAxisAlignment: CrossAxisAlignment.start,
1011-
children: <Widget>[
1011+
children: [
10121012
const Padding(
10131013
padding: EdgeInsets.only(bottom: 32),
10141014
child:
@@ -1093,7 +1093,7 @@ class WhoUsesFlutter extends StatelessWidget {
10931093
child: Column(
10941094
mainAxisSize: MainAxisSize.min,
10951095
crossAxisAlignment: CrossAxisAlignment.start,
1096-
children: <Widget>[
1096+
children: [
10971097
const Padding(
10981098
padding: EdgeInsets.only(bottom: 16),
10991099
child:
@@ -1193,7 +1193,7 @@ class FlutterNewsCard extends StatelessWidget {
11931193
border: Border.all(color: border)),
11941194
child: Column(
11951195
crossAxisAlignment: CrossAxisAlignment.start,
1196-
children: <Widget>[
1196+
children: [
11971197
Container(
11981198
constraints: const BoxConstraints(maxHeight: 400),
11991199
child: Image.asset(imagePath, fit: BoxFit.fitWidth),
@@ -1202,7 +1202,7 @@ class FlutterNewsCard extends StatelessWidget {
12021202
padding: const EdgeInsets.fromLTRB(40, 40, 40, 40),
12031203
child: Column(
12041204
crossAxisAlignment: CrossAxisAlignment.start,
1205-
children: <Widget>[
1205+
children: [
12061206
Padding(
12071207
padding: const EdgeInsets.only(bottom: 16),
12081208
child: Text("News",
@@ -1490,7 +1490,7 @@ class Footer extends StatelessWidget {
14901490
columnFit: FlexFit.loose,
14911491
child: Column(
14921492
crossAxisAlignment: CrossAxisAlignment.start,
1493-
children: <Widget>[
1493+
children: [
14941494
RichText(
14951495
textAlign: TextAlign.left,
14961496
text: TextSpan(

lib/ui/carousel/carousel.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Carousel extends StatefulWidget {
1717
Carousel({super.key});
1818

1919
@override
20-
_CarouselState createState() => _CarouselState();
20+
State<Carousel> createState() => _CarouselState();
2121
}
2222

2323
class _CarouselState extends State<Carousel>

lib/ui/carousel/carousel_slide_1.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CarouselSlide1 extends StatefulWidget {
1010
const CarouselSlide1({super.key, required this.slideDuration});
1111

1212
@override
13-
_CarouselSlide1State createState() => _CarouselSlide1State();
13+
State<CarouselSlide1> createState() => _CarouselSlide1State();
1414
}
1515

1616
class _CarouselSlide1State extends State<CarouselSlide1>
@@ -60,8 +60,7 @@ class _CarouselSlide1State extends State<CarouselSlide1>
6060
animation = Tween<double>(begin: 0, end: 252).animate(animationController)
6161
..addListener(() {
6262
setState(() {
63-
slideItems =
64-
getSlideItemAnimationUpdate(animation.value, slideItems);
63+
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
6564
});
6665
});
6766
animationController.forward();
@@ -73,7 +72,7 @@ class _CarouselSlide1State extends State<CarouselSlide1>
7372
width: 1200,
7473
height: 1200,
7574
child: Stack(
76-
children: <Widget>[
75+
children: [
7776
Positioned(
7877
left: 449,
7978
top: 116,

lib/ui/carousel/carousel_slide_2.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CarouselSlide2 extends StatefulWidget {
1010
const CarouselSlide2({super.key, required this.slideDuration});
1111

1212
@override
13-
_CarouselSlide2State createState() => _CarouselSlide2State();
13+
State<CarouselSlide2> createState() => _CarouselSlide2State();
1414
}
1515

1616
class _CarouselSlide2State extends State<CarouselSlide2>
@@ -60,8 +60,7 @@ class _CarouselSlide2State extends State<CarouselSlide2>
6060
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
6161
..addListener(() {
6262
setState(() {
63-
slideItems =
64-
getSlideItemAnimationUpdate(animation.value, slideItems);
63+
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
6564
});
6665
});
6766
animationController.forward();
@@ -73,7 +72,7 @@ class _CarouselSlide2State extends State<CarouselSlide2>
7372
width: 1200,
7473
height: 640,
7574
child: Stack(
76-
children: <Widget>[
75+
children: [
7776
Positioned(
7877
left: 36,
7978
top: 136,

lib/ui/carousel/carousel_slide_3.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CarouselSlide3 extends StatefulWidget {
1010
const CarouselSlide3({super.key, required this.slideDuration});
1111

1212
@override
13-
_CarouselSlide3State createState() => _CarouselSlide3State();
13+
State<CarouselSlide3> createState() => _CarouselSlide3State();
1414
}
1515

1616
class _CarouselSlide3State extends State<CarouselSlide3>
@@ -60,8 +60,7 @@ class _CarouselSlide3State extends State<CarouselSlide3>
6060
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
6161
..addListener(() {
6262
setState(() {
63-
slideItems =
64-
getSlideItemAnimationUpdate(animation.value, slideItems);
63+
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
6564
});
6665
});
6766
animationController.forward();
@@ -73,7 +72,7 @@ class _CarouselSlide3State extends State<CarouselSlide3>
7372
width: 1200,
7473
height: 640,
7574
child: Stack(
76-
children: <Widget>[
75+
children: [
7776
Positioned(
7877
left: 400,
7978
top: 117,

lib/ui/carousel/carousel_slide_4.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CarouselSlide4 extends StatefulWidget {
1010
const CarouselSlide4({super.key, required this.slideDuration});
1111

1212
@override
13-
_CarouselSlide4State createState() => _CarouselSlide4State();
13+
State<CarouselSlide4> createState() => _CarouselSlide4State();
1414
}
1515

1616
class _CarouselSlide4State extends State<CarouselSlide4>
@@ -60,8 +60,7 @@ class _CarouselSlide4State extends State<CarouselSlide4>
6060
animation = Tween<double>(begin: 0, end: 200).animate(animationController)
6161
..addListener(() {
6262
setState(() {
63-
slideItems =
64-
getSlideItemAnimationUpdate(animation.value, slideItems);
63+
slideItems = getSlideItemAnimationUpdate(animation.value, slideItems);
6564
});
6665
});
6766
animationController.forward();
@@ -73,7 +72,7 @@ class _CarouselSlide4State extends State<CarouselSlide4>
7372
width: 1200,
7473
height: 640,
7574
child: Stack(
76-
children: <Widget>[
75+
children: [
7776
Positioned(
7877
left: 345,
7978
top: 132,

lib/utils/utils.dart

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import 'package:flutter/foundation.dart';
22
import 'package:url_launcher/url_launcher.dart';
33

44
Future<bool> openUrl(String url, {bool newWindow = false}) async {
5-
if (await canLaunch(url)) {
6-
return await launch(
7-
url,
8-
);
9-
} else {
5+
try {
6+
if (await canLaunchUrl(Uri.parse(url))) {
7+
return await launchUrl(
8+
Uri.parse(url),
9+
);
10+
} else {
11+
debugPrint("Could not launch $url");
12+
return false;
13+
}
14+
} catch (e) {
1015
debugPrint("Could not launch $url");
1116
return false;
1217
}

0 commit comments

Comments
 (0)