From 432e4d34306e4abcb2d93f244dce5d1821e92f66 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Sun, 14 Apr 2024 22:46:49 +0530 Subject: [PATCH] Migrate to dart 3 compatibility --- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 16 +- .../contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Runner/Info.plist | 4 + lib/src/config/route.dart | 9 +- lib/src/model/dactor_model.dart | 107 +++++----- lib/src/pages/detail_page.dart | 51 +++-- lib/src/pages/home_page.dart | 48 +++-- lib/src/pages/splash_page.dart | 58 +++--- lib/src/theme/extention.dart | 89 +++++---- lib/src/theme/theme.dart | 37 ++-- lib/src/widgets/coustom_route.dart | 4 +- lib/src/widgets/progress_widget.dart | 21 +- lib/src/widgets/rating_start.dart | 21 +- pubspec.lock | 186 +++++++++--------- pubspec.yaml | 6 +- 17 files changed, 366 insertions(+), 297 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f7..8c6e561 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 12.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 96c139e..44440d7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -135,7 +135,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -179,10 +179,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -193,6 +195,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -241,7 +244,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -281,7 +283,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -318,7 +320,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -364,7 +365,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -374,7 +375,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -414,7 +414,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a1..919434a 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140c..e67b280 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/lib/src/config/route.dart b/lib/src/config/route.dart index 7afe4c8..43ff886 100644 --- a/lib/src/config/route.dart +++ b/lib/src/config/route.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_healthcare_app/src/model/dactor_model.dart'; import 'package:flutter_healthcare_app/src/pages/detail_page.dart'; import 'package:flutter_healthcare_app/src/pages/home_page.dart'; import 'package:flutter_healthcare_app/src/pages/splash_page.dart'; @@ -12,15 +13,17 @@ class Routes { }; } - static Route onGenerateRoute(RouteSettings settings) { - final List pathElements = settings.name.split('/'); + static Route? onGenerateRoute(RouteSettings settings) { + final List pathElements = settings.name?.split('/') ?? []; if (pathElements[0] != '' || pathElements.length == 1) { return null; } switch (pathElements[1]) { case "DetailPage": return CustomRoute( - builder: (BuildContext context) => DetailPage(model: settings.arguments,)); + builder: (BuildContext context) => + DetailPage(model: settings.arguments as DoctorModel), + ); } } } diff --git a/lib/src/model/dactor_model.dart b/lib/src/model/dactor_model.dart index d795679..5b6ca42 100644 --- a/lib/src/model/dactor_model.dart +++ b/lib/src/model/dactor_model.dart @@ -1,68 +1,73 @@ import 'dart:convert'; class DoctorModel { - String name; - String type; - String description; - double rating; - double goodReviews; - double totalScore; - double satisfaction; - bool isfavourite; - String image; + String name; + String type; + String description; + double rating; + double goodReviews; + double totalScore; + double satisfaction; + bool isfavourite; + String image; - DoctorModel({ - this.name, - this.type, - this.description, - this.rating, - this.goodReviews, - this.totalScore, - this.satisfaction, - this.isfavourite, - this.image, - }); + DoctorModel({ + required this.name, + required this.type, + required this.description, + required this.rating, + required this.goodReviews, + required this.totalScore, + required this.satisfaction, + required this.isfavourite, + required this.image, + }); - DoctorModel copyWith({ - String name, - String type, - String description, - double rating, - double goodReviews, - double totalScore, - double satisfaction, - bool isfavourite, - String image, - }) => - DoctorModel( - name: name ?? this.name, - type: type ?? this.type, - description: description ?? this.description, - rating: rating ?? this.rating, - goodReviews: goodReviews ?? this.goodReviews, - totalScore: totalScore ?? this.totalScore, - satisfaction: satisfaction ?? this.satisfaction, - isfavourite: isfavourite ?? this.isfavourite, - image: image ?? this.image, - ); + DoctorModel copyWith({ + String? name, + String? type, + String? description, + double? rating, + double? goodReviews, + double? totalScore, + double? satisfaction, + bool? isfavourite, + String? image, + }) => + DoctorModel( + name: name ?? this.name, + type: type ?? this.type, + description: description ?? this.description, + rating: rating ?? this.rating, + goodReviews: goodReviews ?? this.goodReviews, + totalScore: totalScore ?? this.totalScore, + satisfaction: satisfaction ?? this.satisfaction, + isfavourite: isfavourite ?? this.isfavourite, + image: image ?? this.image, + ); - factory DoctorModel.fromRawJson(String str) => DoctorModel.fromJson(json.decode(str)); + factory DoctorModel.fromRawJson(String str) => + DoctorModel.fromJson(json.decode(str)); - String toRawJson() => json.encode(toJson()); + String toRawJson() => json.encode(toJson()); - factory DoctorModel.fromJson(Map json) => DoctorModel( + factory DoctorModel.fromJson(Map json) => DoctorModel( name: json["name"] == null ? null : json["name"], type: json["type"] == null ? null : json["type"], description: json["description"] == null ? null : json["description"], rating: json["rating"] == null ? null : json["rating"].toDouble(), - goodReviews: json["goodReviews"] == null ? null : json["goodReviews"].toDouble(), - totalScore: json["totalScore"] == null ? null : json["totalScore"].toDouble(), - satisfaction: json["satisfaction"] == null ? null : json["satisfaction"].toDouble(), + goodReviews: + json["goodReviews"] == null ? null : json["goodReviews"].toDouble(), + totalScore: + json["totalScore"] == null ? null : json["totalScore"].toDouble(), + satisfaction: json["satisfaction"] == null + ? null + : json["satisfaction"].toDouble(), isfavourite: json["isfavourite"] == null ? null : json["isfavourite"], image: json["image"] == null ? null : json["image"], - ); + ); - Map toJson() => { + Map toJson() => { "name": name == null ? null : name, "type": type == null ? null : type, "description": description == null ? null : description, @@ -72,5 +77,5 @@ class DoctorModel { "satisfaction": satisfaction == null ? null : satisfaction, "isfavourite": isfavourite == null ? null : isfavourite, "image": image == null ? null : image, - }; + }; } diff --git a/lib/src/pages/detail_page.dart b/lib/src/pages/detail_page.dart index 746667a..c6bebeb 100644 --- a/lib/src/pages/detail_page.dart +++ b/lib/src/pages/detail_page.dart @@ -8,7 +8,7 @@ import 'package:flutter_healthcare_app/src/widgets/progress_widget.dart'; import 'package:flutter_healthcare_app/src/widgets/rating_start.dart'; class DetailPage extends StatefulWidget { - DetailPage({Key key, this.model}) : super(key: key); + DetailPage({required this.model}); final DoctorModel model; @override @@ -16,7 +16,7 @@ class DetailPage extends StatefulWidget { } class _DetailPageState extends State { - DoctorModel model; + late DoctorModel model; @override void initState() { model = widget.model; @@ -62,7 +62,10 @@ class _DetailPageState extends State { builder: (context, scrollController) { return Container( height: AppTheme.fullHeight(context) * .5, - padding: EdgeInsets.only(left:19,right:19,top: 16),//symmetric(horizontal: 19, vertical: 16), + padding: EdgeInsets.only( + left: 19, + right: 19, + top: 16), //symmetric(horizontal: 19, vertical: 16), decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(30), @@ -149,11 +152,16 @@ class _DetailPageState extends State { height: 45, width: 45, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: LightColor.grey.withAlpha(150) + borderRadius: BorderRadius.circular(10), + color: LightColor.grey.withAlpha(150)), + child: Icon( + Icons.call, + color: Colors.white, ), - child: Icon(Icons.call, color: Colors.white,), - ).ripple((){}, borderRadius:BorderRadius.circular(10), ), + ).ripple( + () {}, + borderRadius: BorderRadius.circular(10), + ), SizedBox( width: 10, ), @@ -161,21 +169,32 @@ class _DetailPageState extends State { height: 45, width: 45, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: LightColor.grey.withAlpha(150) + borderRadius: BorderRadius.circular(10), + color: LightColor.grey.withAlpha(150)), + child: Icon( + Icons.chat_bubble, + color: Colors.white, ), - child: Icon(Icons.chat_bubble, color: Colors.white,), - ).ripple((){}, borderRadius:BorderRadius.circular(10), ), + ).ripple( + () {}, + borderRadius: BorderRadius.circular(10), + ), SizedBox( width: 10, ), - FlatButton( - color: Theme.of(context).primaryColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10) + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: LightColor.purple, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + textStyle: TextStyles.bodySm, ), onPressed: () {}, - child: Text("Make an appointment", style: TextStyles.titleNormal.white,).p(10), + child: Text( + "Make an appointment", + style: TextStyles.titleNormal.white, + ).p(10), ), ], ).vP16 diff --git a/lib/src/pages/home_page.dart b/lib/src/pages/home_page.dart index a00a4bd..8651ca3 100644 --- a/lib/src/pages/home_page.dart +++ b/lib/src/pages/home_page.dart @@ -9,20 +9,21 @@ import 'package:flutter_healthcare_app/src/theme/text_styles.dart'; import 'package:flutter_healthcare_app/src/theme/theme.dart'; class HomePage extends StatefulWidget { - HomePage({Key key}) : super(key: key); + HomePage({Key? key}) : super(key: key); @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State { - List doctorDataList; + late List doctorDataList; @override - void initState() { - doctorDataList = doctorMapList.map((x)=> DoctorModel.fromJson(x)).toList(); + void initState() { + doctorDataList = doctorMapList.map((x) => DoctorModel.fromJson(x)).toList(); super.initState(); } - Widget _appBar() { + + AppBar _appBar() { return AppBar( elevation: 0, backgroundColor: Theme.of(context).backgroundColor, @@ -130,13 +131,14 @@ class _HomePageState extends State { ); } - Widget _categoryCard(String title, String subtitle,{Color color, Color lightColor}) { - TextStyle titleStyle = TextStyles.title.bold.white; - TextStyle subtitleStyle = TextStyles.body.bold.white; - if(AppTheme.fullWidth(context) < 392){ - titleStyle = TextStyles.body.bold.white; - subtitleStyle = TextStyles.bodySm.bold.white; - } + Widget _categoryCard(String title, String subtitle, + {required Color color, required Color lightColor}) { + TextStyle titleStyle = TextStyles.title.bold.white; + TextStyle subtitleStyle = TextStyles.body.bold.white; + if (AppTheme.fullWidth(context) < 392) { + titleStyle = TextStyles.body.bold.white; + subtitleStyle = TextStyles.bodySm.bold.white; + } return AspectRatio( aspectRatio: 6 / 8, child: Container( @@ -171,10 +173,7 @@ class _HomePageState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Flexible( - child: Text( - title, - style: titleStyle - ).hP8, + child: Text(title, style: titleStyle).hP8, ), SizedBox( height: 10, @@ -213,19 +212,18 @@ class _HomePageState extends State { ], ).hP16, getdoctorWidgetList() - - ], ), ); } - Widget getdoctorWidgetList(){ - return Column( - children: doctorDataList.map((x){ - return _doctorTile(x); - }).toList() - ); + + Widget getdoctorWidgetList() { + return Column( + children: doctorDataList.map((x) { + return _doctorTile(x); + }).toList()); } + Widget _doctorTile(DoctorModel model) { return Container( margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), @@ -268,7 +266,7 @@ class _HomePageState extends State { ), title: Text(model.name, style: TextStyles.title.bold), subtitle: Text( - model.type, + model.type, style: TextStyles.bodySm.subTitleColor.bold, ), trailing: Icon( diff --git a/lib/src/pages/splash_page.dart b/lib/src/pages/splash_page.dart index b7c0091..b292c52 100644 --- a/lib/src/pages/splash_page.dart +++ b/lib/src/pages/splash_page.dart @@ -5,7 +5,7 @@ import 'package:flutter_healthcare_app/src/theme/text_styles.dart'; import 'package:flutter_healthcare_app/src/theme/extention.dart'; class SplashPage extends StatefulWidget { - SplashPage({Key key}) : super(key: key); + SplashPage({Key? key}) : super(key: key); @override _SplashPageState createState() => _SplashPageState(); @@ -14,11 +14,13 @@ class SplashPage extends StatefulWidget { class _SplashPageState extends State { @override void initState() { - Future.delayed(Duration(seconds: 2)).then((_) { - Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => HomePage())); + Future.delayed(Duration(seconds: 2)).then((_) { + Navigator.pushReplacement( + context, MaterialPageRoute(builder: (_) => HomePage())); }); super.initState(); } + @override Widget build(BuildContext context) { return Scaffold( @@ -47,29 +49,33 @@ class _SplashPageState extends State { ), ), ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 2, - child: SizedBox(), - ), - Image.asset("assets/heartbeat.png", color: Colors.white,height: 100,), - Text( - "Time Health", - style: TextStyles.h1Style.white, - ), - Text( - "By healthcare Evolution", - style: TextStyles.bodySm.white.bold, - ), - Expanded( - flex: 7, - child: SizedBox(), - ), - ], - ).alignTopCenter, + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 2, + child: SizedBox(), + ), + Image.asset( + "assets/heartbeat.png", + color: Colors.white, + height: 100, + ), + Text( + "Time Health", + style: TextStyles.h1Style.white, + ), + Text( + "By healthcare Evolution", + style: TextStyles.bodySm.white.bold, + ), + Expanded( + flex: 7, + child: SizedBox(), + ), + ], + ).alignTopCenter, ], ), ); diff --git a/lib/src/theme/extention.dart b/lib/src/theme/extention.dart index 0664c7c..e748396 100644 --- a/lib/src/theme/extention.dart +++ b/lib/src/theme/extention.dart @@ -17,9 +17,12 @@ extension PaddingHelper on Widget { Padding(padding: EdgeInsets.all(value), child: this); /// Horizontal Padding 16 - Padding get hP4 => Padding(padding: EdgeInsets.symmetric(horizontal: 4), child: this); - Padding get hP8 => Padding(padding: EdgeInsets.symmetric(horizontal: 8), child: this); - Padding get hP16 => Padding(padding: EdgeInsets.symmetric(horizontal: 16), child: this); + Padding get hP4 => + Padding(padding: EdgeInsets.symmetric(horizontal: 4), child: this); + Padding get hP8 => + Padding(padding: EdgeInsets.symmetric(horizontal: 8), child: this); + Padding get hP16 => + Padding(padding: EdgeInsets.symmetric(horizontal: 16), child: this); /// Vertical Padding 16 Padding get vP16 => @@ -35,39 +38,57 @@ extension Extented on Widget { child: this, ); } + extension CornerRadius on Widget { - ClipRRect get circular=> ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(1000)), - child: this, - ); + ClipRRect get circular => ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(1000)), + child: this, + ); } + extension OnPressed on Widget { - Widget ripple(Function onPressed, {BorderRadiusGeometry borderRadius =const BorderRadius.all(Radius.circular(5))}) => Stack( - children: [ - this, - Positioned( - left: 0, - right: 0, - top: 0, - bottom: 0, - child: FlatButton( - shape: RoundedRectangleBorder( - borderRadius: borderRadius - ), - onPressed: () { - if (onPressed != null) { - onPressed(); - } - }, - child: Container()), - ) - ], - ); + Widget ripple(VoidCallback onPressed, + {BorderRadiusGeometry borderRadius = + const BorderRadius.all(Radius.circular(5))}) => + Stack( + children: [ + this, + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 0, + child: InkWell( + onTap: onPressed, + // shape: RoundedRectangleBorder( + // borderRadius: borderRadius + // ), + // onPressed: () { + // if (onPressed != null) { + // onPressed(); + // } + // }, + child: Container()), + ) + ], + ); } -extension ExAlignment on Widget{ - Widget get alignTopCenter => Align(child: this,alignment: Alignment.topCenter,); - Widget get alignCenter => Align(child: this,alignment: Alignment.center,); - Widget get alignBottomCenter => Align(child: this,alignment: Alignment.bottomCenter,); - Widget get alignBottomLeft => Align(child: this,alignment: Alignment.bottomLeft,); -} \ No newline at end of file +extension ExAlignment on Widget { + Widget get alignTopCenter => Align( + child: this, + alignment: Alignment.topCenter, + ); + Widget get alignCenter => Align( + child: this, + alignment: Alignment.center, + ); + Widget get alignBottomCenter => Align( + child: this, + alignment: Alignment.bottomCenter, + ); + Widget get alignBottomLeft => Align( + child: this, + alignment: Alignment.bottomLeft, + ); +} diff --git a/lib/src/theme/theme.dart b/lib/src/theme/theme.dart index 8c42f10..81c6cb1 100644 --- a/lib/src/theme/theme.dart +++ b/lib/src/theme/theme.dart @@ -2,44 +2,49 @@ import 'package:flutter/material.dart'; import 'light_color.dart'; - class AppTheme { const AppTheme(); static ThemeData lightTheme = ThemeData( backgroundColor: LightColor.background, primaryColor: LightColor.purple, cardTheme: CardTheme(color: LightColor.background), - textTheme: TextTheme(display1: TextStyle(color: LightColor.black)), + // textTheme: TextTheme(display1: TextStyle(color: LightColor.black)), iconTheme: IconThemeData(color: LightColor.iconColor), bottomAppBarColor: LightColor.background, dividerColor: LightColor.grey, - primaryTextTheme: TextTheme( - body1: TextStyle(color:LightColor.titleTextColor) - ) + colorScheme: ColorScheme.fromSeed( + seedColor: LightColor.purple, + ), ); - static TextStyle titleStyle = const TextStyle(color: LightColor.titleTextColor, fontSize: 16); - static TextStyle subTitleStyle = const TextStyle(color: LightColor.subTitleTextColor, fontSize: 12); + static TextStyle titleStyle = + const TextStyle(color: LightColor.titleTextColor, fontSize: 16); + static TextStyle subTitleStyle = + const TextStyle(color: LightColor.subTitleTextColor, fontSize: 12); - static TextStyle h1Style = const TextStyle(fontSize: 24, fontWeight: FontWeight.bold); + static TextStyle h1Style = + const TextStyle(fontSize: 24, fontWeight: FontWeight.bold); static TextStyle h2Style = const TextStyle(fontSize: 22); static TextStyle h3Style = const TextStyle(fontSize: 20); static TextStyle h4Style = const TextStyle(fontSize: 18); static TextStyle h5Style = const TextStyle(fontSize: 16); static TextStyle h6Style = const TextStyle(fontSize: 14); - static List shadow = [ + static List shadow = [ BoxShadow(color: Color(0xfff8f8f8), blurRadius: 10, spreadRadius: 15), ]; - - - static EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 20, vertical: 10); - static EdgeInsets hPadding = const EdgeInsets.symmetric(horizontal: 10,); - static double fullWidth(BuildContext context){ + static EdgeInsets padding = + const EdgeInsets.symmetric(horizontal: 20, vertical: 10); + static EdgeInsets hPadding = const EdgeInsets.symmetric( + horizontal: 10, + ); + + static double fullWidth(BuildContext context) { return MediaQuery.of(context).size.width; } - static double fullHeight(BuildContext context){ + + static double fullHeight(BuildContext context) { return MediaQuery.of(context).size.height; } -} \ No newline at end of file +} diff --git a/lib/src/widgets/coustom_route.dart b/lib/src/widgets/coustom_route.dart index d5cdfb5..1cedcf2 100644 --- a/lib/src/widgets/coustom_route.dart +++ b/lib/src/widgets/coustom_route.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class CustomRoute extends MaterialPageRoute { - CustomRoute({WidgetBuilder builder, RouteSettings settings}) + CustomRoute({required WidgetBuilder builder, RouteSettings? settings}) : super(builder: builder, settings: settings); @override Widget buildTransitions(BuildContext context, Animation animation, @@ -14,4 +14,4 @@ class CustomRoute extends MaterialPageRoute { child: child, ); } -} \ No newline at end of file +} diff --git a/lib/src/widgets/progress_widget.dart b/lib/src/widgets/progress_widget.dart index de15794..fc5256e 100644 --- a/lib/src/widgets/progress_widget.dart +++ b/lib/src/widgets/progress_widget.dart @@ -7,12 +7,13 @@ import 'package:flutter_healthcare_app/src/theme/theme.dart'; class ProgressWidget extends StatefulWidget { ProgressWidget( - {Key key, - this.value, + {Key? key, + required this.value, this.totalValue = 100, - this.activeColor, - this.backgroundColor, - this.title, this.durationTime}) + required this.activeColor, + required this.backgroundColor, + required this.title, + this.durationTime}) : super(key: key); final double totalValue; final double value; @@ -26,18 +27,16 @@ class ProgressWidget extends StatefulWidget { class _ProgressWidgetState extends State with TickerProviderStateMixin { - double progress; - Color activeColor; - Color backgroundColor; + late double progress; + late Color activeColor; + late Color backgroundColor; @override void initState() { - progress = (widget.value * 100) / widget.totalValue; progress = (progress / 100) * 360; activeColor = widget.activeColor; backgroundColor = widget.backgroundColor; - super.initState(); } @@ -62,7 +61,7 @@ class _ProgressWidgetState extends State alignment: Alignment.center, children: [ TweenAnimationBuilder( - tween: Tween(begin: 0, end : progress), + tween: Tween(begin: 0, end: progress), duration: Duration(milliseconds: widget.durationTime), builder: (context, value, child) { // print(value); diff --git a/lib/src/widgets/rating_start.dart b/lib/src/widgets/rating_start.dart index 83c0d3c..45e03a4 100644 --- a/lib/src/widgets/rating_start.dart +++ b/lib/src/widgets/rating_start.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_healthcare_app/src/theme/light_color.dart'; class RatingStar extends StatefulWidget { - RatingStar({Key key, this.rating}) : super(key: key); + RatingStar({Key? key, required this.rating}) : super(key: key); final double rating; @override @@ -25,13 +25,16 @@ class _RatingStarState extends State { @override Widget build(BuildContext context) { return Container( - child: TweenAnimationBuilder( - tween: Tween(begin: 0, end:5), - duration: Duration(milliseconds: 500), - builder: (context, value, child) { - return Wrap( - children: Iterable.generate(value.toInt(), (index) => _start(index)).toList()); - }, - ),); + child: TweenAnimationBuilder( + tween: Tween(begin: 0, end: 5), + duration: Duration(milliseconds: 500), + builder: (context, value, child) { + return Wrap( + children: + Iterable.generate(value.toInt(), (index) => _start(index)) + .toList()); + }, + ), + ); } } diff --git a/pubspec.lock b/pubspec.lock index 543838a..03872e1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,69 +1,62 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.0.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - collection: + version: "2.1.1" + characters: dependency: transitive description: - name: collection - url: "https://pub.dartlang.org" + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.14.12" - convert: + version: "1.3.0" + clock: dependency: transitive description: - name: convert - url: "https://pub.dartlang.org" + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "2.1.1" - crypto: + version: "1.1.1" + collection: dependency: transitive description: - name: crypto - url: "https://pub.dartlang.org" + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" + source: hosted + version: "1.0.6" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -74,48 +67,62 @@ packages: description: flutter source: sdk version: "0.0.0" - image: + leak_tracker: dependency: transitive description: - name: image - url: "https://pub.dartlang.org" + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" source: hosted - version: "2.1.12" - matcher: + version: "10.0.0" + leak_tracker_flutter_testing: dependency: transitive description: - name: matcher - url: "https://pub.dartlang.org" + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" source: hosted - version: "0.12.6" - meta: + version: "2.0.1" + leak_tracker_testing: dependency: transitive description: - name: meta - url: "https://pub.dartlang.org" + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" source: hosted - version: "1.1.8" - path: + version: "2.0.1" + matcher: dependency: transitive description: - name: path - url: "https://pub.dartlang.org" + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "1.6.4" - petitparser: + version: "0.12.16+1" + material_color_utilities: dependency: transitive description: - name: petitparser - url: "https://pub.dartlang.org" + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "2.4.0" - quiver: + version: "0.8.0" + meta: dependency: transitive description: - name: quiver - url: "https://pub.dartlang.org" + name: meta + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "1.11.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -125,64 +132,65 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.9.3" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.2.15" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" + version: "0.6.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.0.8" - xml: + version: "2.1.4" + vm_service: dependency: transitive description: - name: xml - url: "https://pub.dartlang.org" + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "13.0.0" sdks: - dart: ">=2.6.0 <3.0.0" + dart: ">=3.2.0-0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index b1c8344..7cae229 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.6.0 <3.0.0" + sdk: ">=3.1.5 <4.0.0" dependencies: flutter: @@ -22,19 +22,17 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.6 dev_dependencies: flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.