diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.vscode/launch.json b/.vscode/launch.json index 7f35a7e7..2e7a65fa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,20 +1,20 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Device Frame Example", - "program": "device_frame/example/lib/main.dart", - "request": "launch", - "type": "dart" - }, - { - "name": "Example", - "program": "device_preview/example/lib/main.dart", - "request": "launch", - "type": "dart" - } - ] -} \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Device Frame Example", + "program": "device_frame/example/lib/main.dart", + "request": "launch", + "type": "dart" + }, + { + "name": "Example", + "program": "device_preview/example/lib/main.dart", + "request": "launch", + "type": "dart" + } + ] +} diff --git a/device_frame/CHANGELOG.md b/device_frame/CHANGELOG.md index f2ded160..68a379b0 100644 --- a/device_frame/CHANGELOG.md +++ b/device_frame/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.1.1 + +* Fixes iPhone 12 size and safe area issue +* Adding Pixel 4 + ## 1.1.0 * Updated freezed dependency. diff --git a/device_frame/example/android/app/build.gradle b/device_frame/example/android/app/build.gradle index 56bfa9b7..b120248e 100644 --- a/device_frame/example/android/app/build.gradle +++ b/device_frame/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/device_frame/example/android/build.gradle b/device_frame/example/android/build.gradle index ed45c658..09fbd640 100644 --- a/device_frame/example/android/build.gradle +++ b/device_frame/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() diff --git a/device_frame/example/ios/Runner.xcodeproj/project.pbxproj b/device_frame/example/ios/Runner.xcodeproj/project.pbxproj index c6759a6e..deb66dee 100644 --- a/device_frame/example/ios/Runner.xcodeproj/project.pbxproj +++ b/device_frame/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -127,7 +127,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/device_frame/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/device_frame/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..3db53b6e 100644 --- a/device_frame/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/device_frame/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + diff --git a/device_frame/example/pubspec.yaml b/device_frame/example/pubspec.yaml index 45b9b973..1b2dcb9b 100644 --- a/device_frame/example/pubspec.yaml +++ b/device_frame/example/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.19.6 <3.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -46,7 +46,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/device_frame/lib/src/devices/android/devices.dart b/device_frame/lib/src/devices/android/devices.dart index 0e2a55ae..a06edf11 100644 --- a/device_frame/lib/src/devices/android/devices.dart +++ b/device_frame/lib/src/devices/android/devices.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:device_frame/src/info/info.dart'; import 'package:device_frame/src/devices/android/samsung_galaxy_s20/device.dart' @@ -32,6 +30,27 @@ class AndroidDevices { DeviceInfo get sonyXperia1II => i_sony_xperia_1_ii.info; + DeviceInfo get pixel4 => _pixel4; + static final _pixel4 = DeviceInfo.genericPhone( + platform: TargetPlatform.android, + id: 'pixel4', + name: 'Pixel 4', + pixelRatio: 3.5, + screenSize: const Size(412.0, 869.0), + safeAreas: const EdgeInsets.only( + left: 0.0, + top: 24.0, + right: 0.0, + bottom: 0.0, + ), + rotatedSafeAreas: const EdgeInsets.only( + left: 0.0, + top: 24.0, + right: 0.0, + bottom: 0.0, + ), + ); + DeviceInfo get smallPhone => _smallPhone; static final _smallPhone = DeviceInfo.genericPhone( platform: TargetPlatform.android, @@ -159,6 +178,7 @@ class AndroidDevices { samsungGalaxyS20, samsungGalaxyNote20, samsungGalaxyNote20Ultra, + pixel4, onePlus8Pro, sonyXperia1II, smallPhone, diff --git a/device_frame/lib/src/devices/ios/devices.dart b/device_frame/lib/src/devices/ios/devices.dart index 0bf837b5..a2ddf71e 100644 --- a/device_frame/lib/src/devices/ios/devices.dart +++ b/device_frame/lib/src/devices/ios/devices.dart @@ -13,6 +13,10 @@ import 'package:device_frame/src/devices/ios/iphone_13/device.dart' as i_iphone_13; import 'package:device_frame/src/devices/ios/iphone_13_pro_max/device.dart' as i_iphone_13_pro_max; + +import 'package:device_frame/src/devices/ios/iphone_14_pro/device.dart' + as i_iphone_14_pro; + import 'package:device_frame/src/devices/ios/iphone_se/device.dart' as i_iphone_se; import 'package:device_frame/src/devices/ios/ipad_air_4/device.dart' @@ -35,6 +39,7 @@ class IosDevices { DeviceInfo get iPhone13Mini => i_iphone_13_mini.info; DeviceInfo get iPhone13 => i_iphone_13.info; DeviceInfo get iPhone13ProMax => i_iphone_13_pro_max.info; + DeviceInfo get iPhone14Pro => i_iphone_14_pro.info; DeviceInfo get iPhoneSE => i_iphone_se.info; DeviceInfo get iPadAir4 => i_ipad_air_4.info; DeviceInfo get iPad => i_ipad.info; @@ -45,6 +50,7 @@ class IosDevices { /// All devices. List get all => [ // Phones + iPhone14Pro, iPhone12Mini, iPhone12, iPhone12ProMax, diff --git a/device_frame/lib/src/devices/ios/iphone_12/device.dart b/device_frame/lib/src/devices/ios/iphone_12/device.dart index 03386ac3..899263c2 100644 --- a/device_frame/lib/src/devices/ios/iphone_12/device.dart +++ b/device_frame/lib/src/devices/ios/iphone_12/device.dart @@ -13,20 +13,20 @@ final info = DeviceInfo( 'iphone-12', ), name: 'iPhone 12', - pixelRatio: 2.0, + pixelRatio: 3.0, frameSize: const Size(873.0, 1771.0), - screenSize: const Size(1024.0, 1366.0), + screenSize: const Size(390.0, 844.0), safeAreas: const EdgeInsets.only( left: 0.0, - top: 24.0, + top: 44.0, right: 0.0, - bottom: 20.0, + bottom: 34.0, ), rotatedSafeAreas: const EdgeInsets.only( - left: 0.0, - top: 24.0, - right: 0.0, - bottom: 20.0, + left: 44.0, + top: 0.0, + right: 44.0, + bottom: 21.0, ), framePainter: const _FramePainter(), screenPath: _screenPath, diff --git a/device_frame/lib/src/devices/ios/iphone_14_pro/device.dart b/device_frame/lib/src/devices/ios/iphone_14_pro/device.dart new file mode 100644 index 00000000..aaddc374 --- /dev/null +++ b/device_frame/lib/src/devices/ios/iphone_14_pro/device.dart @@ -0,0 +1,33 @@ +import 'package:device_frame/src/info/device_type.dart'; +import 'package:device_frame/src/info/identifier.dart'; +import 'package:device_frame/src/info/info.dart'; +import 'package:flutter/material.dart'; + +part 'frame.g.dart'; +part 'screen.g.dart'; + +final info = DeviceInfo( + identifier: const DeviceIdentifier( + TargetPlatform.iOS, + DeviceType.phone, + 'iphone-14-pro', + ), + name: 'iPhone 14 Pro', + pixelRatio: 3.0, + frameSize: const Size(873.0, 1770.0), + screenSize: const Size(430, 932), + safeAreas: const EdgeInsets.only( + left: 0.0, + top: 47.0, + right: 0.0, + bottom: 34.0, + ), + rotatedSafeAreas: const EdgeInsets.only( + left: 23.0, + top: 0.0, + right: 47.0, + bottom: 21.0, + ), + framePainter: const _FramePainter(), + screenPath: _screenPath, +); diff --git a/device_frame/lib/src/devices/ios/iphone_14_pro/frame.g.dart b/device_frame/lib/src/devices/ios/iphone_14_pro/frame.g.dart new file mode 100644 index 00000000..28defe6e --- /dev/null +++ b/device_frame/lib/src/devices/ios/iphone_14_pro/frame.g.dart @@ -0,0 +1,295 @@ +// ignore_for_file: require_trailing_commas, non_constant_identifier_names + +import 'dart:ui' as ui; + +part of 'device.dart'; + +// Generated manually with https://fluttershapemaker.com/ +class _FramePainter extends CustomPainter { + const _FramePainter(); + + /* + iPhone 14 Pro Max device figma link can be found here + https://www.figma.com/file/wZRgPlURZrOJl0kMiSJHk2/Untitled?node-id=0%3A1 + Then enter into https://fluttershapemaker.com/ + */ + @override + void paint(Canvas canvas, Size size) { + + Path path_0 = Path(); + path_0.moveTo(866.809,495.105); + path_0.lineTo(869.904,495.105); + path_0.cubicTo(871.614,495.105,873,496.49,873,498.199); + path_0.lineTo(873,683.864); + path_0.cubicTo(873,685.572,871.614,686.958,869.904,686.958); + path_0.lineTo(866.809,686.958); + path_0.lineTo(866.809,495.105); + path_0.close(); + + Paint paint_0_fill = Paint()..style=PaintingStyle.fill; + paint_0_fill.color = Color(0xff213744).withOpacity(1.0); + canvas.drawPath(path_0,paint_0_fill); + + Path path_1 = Path(); + path_1.moveTo(6.19141,728.217); + path_1.lineTo(3.09565,728.217); + path_1.cubicTo(1.38592,728.217,-0.0000942926,726.831,-0.0000941431,725.122); + path_1.lineTo(-0.0000840393,609.598); + path_1.cubicTo(-0.0000838898,607.889,1.38593,606.503,3.09566,606.503); + path_1.lineTo(6.19142,606.503); + path_1.lineTo(6.19141,728.217); + path_1.close(); + + Paint paint_1_fill = Paint()..style=PaintingStyle.fill; + paint_1_fill.color = Color(0xff213744).withOpacity(1.0); + canvas.drawPath(path_1,paint_1_fill); + + Path path_2 = Path(); + path_2.moveTo(6.19141,573.496); + path_2.lineTo(3.09565,573.496); + path_2.cubicTo(1.38592,573.496,-0.0000942926,572.111,-0.0000941431,570.402); + path_2.lineTo(-0.0000840393,454.877); + path_2.cubicTo(-0.0000838898,453.168,1.38593,451.783,3.09566,451.783); + path_2.lineTo(6.19142,451.783); + path_2.lineTo(6.19141,573.496); + path_2.close(); + + Paint paint_2_fill = Paint()..style=PaintingStyle.fill; + paint_2_fill.color = Color(0xff213744).withOpacity(1.0); + canvas.drawPath(path_2,paint_2_fill); + + Path path_3 = Path(); + path_3.moveTo(6.19141,398.147); + path_3.lineTo(3.09566,398.147); + path_3.cubicTo(1.38592,398.147,-0.0000880937,396.761,-0.0000879442,395.052); + path_3.lineTo(-0.0000834336,343.479); + path_3.cubicTo(-0.0000832841,341.77,1.38593,340.384,3.09566,340.384); + path_3.lineTo(6.19141,340.384); + path_3.lineTo(6.19141,398.147); + path_3.close(); + + Paint paint_3_fill = Paint()..style=PaintingStyle.fill; + paint_3_fill.color = Color(0xff213744).withOpacity(1.0); + canvas.drawPath(path_3,paint_3_fill); + + Path path_4 = Path(); + path_4.moveTo(6.19141,187.727); + path_4.cubicTo(6.19141,137.811,6.19141,112.853,12.7571,92.6545); + path_4.cubicTo(26.0269,51.8322,58.046,19.8269,98.886,6.56288); + path_4.cubicTo(119.093,0,144.062,0,194,0); + path_4.lineTo(679,0); + path_4.cubicTo(728.938,0,753.907,0,774.114,6.56288); + path_4.cubicTo(814.954,19.8269,846.973,51.8322,860.243,92.6545); + path_4.cubicTo(866.808,112.853,866.808,137.811,866.808,187.727); + path_4.lineTo(866.808,1582.27); + path_4.cubicTo(866.808,1632.19,866.808,1657.15,860.243,1677.35); + path_4.cubicTo(846.973,1718.17,814.954,1750.17,774.114,1763.44); + path_4.cubicTo(753.907,1770,728.938,1770,679,1770); + path_4.lineTo(194,1770); + path_4.cubicTo(144.062,1770,119.093,1770,98.886,1763.44); + path_4.cubicTo(58.046,1750.17,26.0269,1718.17,12.7571,1677.35); + path_4.cubicTo(6.19141,1657.15,6.19141,1632.19,6.19141,1582.27); + path_4.lineTo(6.19141,187.727); + path_4.close(); + + Paint paint_4_fill = Paint()..style=PaintingStyle.fill; + paint_4_fill.color = Color(0xff213744).withOpacity(1.0); + canvas.drawPath(path_4,paint_4_fill); + + Path path_5 = Path(); + path_5.moveTo(679.825,4.12593); + path_5.lineTo(193.174,4.12593); + path_5.cubicTo(143.844,4.12593,119.668,4.15138,100.161,10.4869); + path_5.cubicTo(60.5778,23.3427,29.5438,54.3633,16.6824,93.9296); + path_5.cubicTo(10.3442,113.428,10.3187,137.593,10.3187,186.902); + path_5.lineTo(10.3187,1583.1); + path_5.cubicTo(10.3187,1632.41,10.3442,1656.57,16.6824,1676.07); + path_5.cubicTo(29.5438,1715.64,60.5778,1746.66,100.161,1759.51); + path_5.cubicTo(119.668,1765.85,143.844,1765.87,193.174,1765.87); + path_5.lineTo(679.825,1765.87); + path_5.cubicTo(729.155,1765.87,753.331,1765.85,772.838,1759.51); + path_5.cubicTo(812.421,1746.66,843.455,1715.64,856.317,1676.07); + path_5.cubicTo(862.655,1656.57,862.68,1632.41,862.68,1583.1); + path_5.lineTo(862.68,186.902); + path_5.cubicTo(862.68,137.593,862.655,113.428,856.317,93.9296); + path_5.cubicTo(843.455,54.3633,812.421,23.3427,772.838,10.4869); + path_5.cubicTo(753.331,4.15138,729.155,4.12593,679.825,4.12593); + path_5.close(); + path_5.moveTo(14.7196,93.2921); + path_5.cubicTo(8.25488,113.18,8.25488,137.754,8.25488,186.902); + path_5.lineTo(8.25488,1583.1); + path_5.cubicTo(8.25488,1632.25,8.25488,1656.82,14.7196,1676.71); + path_5.cubicTo(27.7852,1716.9,59.3117,1748.42,99.5234,1761.48); + path_5.cubicTo(119.42,1767.94,144.005,1767.94,193.174,1767.94); + path_5.lineTo(679.825,1767.94); + path_5.cubicTo(728.995,1767.94,753.579,1767.94,773.476,1761.48); + path_5.cubicTo(813.687,1748.42,845.214,1716.9,858.279,1676.71); + path_5.cubicTo(864.744,1656.82,864.744,1632.25,864.744,1583.1); + path_5.lineTo(864.744,186.902); + path_5.cubicTo(864.744,137.754,864.744,113.18,858.279,93.2921); + path_5.cubicTo(845.214,53.0977,813.687,21.5848,773.476,8.5249); + path_5.cubicTo(753.579,2.06299,728.995,2.06299,679.825,2.06299); + path_5.lineTo(193.174,2.06299); + path_5.cubicTo(144.005,2.06299,119.42,2.06299,99.5234,8.5249); + path_5.cubicTo(59.3117,21.5848,27.7852,53.0977,14.7196,93.2921); + path_5.close(); + + Paint paint_5_fill = Paint()..style=PaintingStyle.fill; + paint_5_fill.color = Color(0xff8EADC1).withOpacity(1.0); + canvas.drawPath(path_5,paint_5_fill); + + Path path_6 = Path(); + path_6.moveTo(16.5107,183.601); + path_6.cubicTo(16.5107,137.525,16.5107,114.487,22.5714,95.842); + path_6.cubicTo(34.8204,58.1598,64.3765,28.6164,102.075,16.3727); + path_6.cubicTo(120.728,10.3147,143.776,10.3147,189.872,10.3147); + path_6.lineTo(683.128,10.3147); + path_6.cubicTo(729.224,10.3147,752.272,10.3147,770.925,16.3727); + path_6.cubicTo(808.624,28.6164,838.18,58.1598,850.429,95.842); + path_6.cubicTo(856.489,114.487,856.489,137.525,856.489,183.601); + path_6.lineTo(856.489,1586.4); + path_6.cubicTo(856.489,1632.48,856.489,1655.51,850.429,1674.16); + path_6.cubicTo(838.18,1711.84,808.624,1741.38,770.925,1753.63); + path_6.cubicTo(752.272,1759.69,729.224,1759.69,683.128,1759.69); + path_6.lineTo(189.872,1759.69); + path_6.cubicTo(143.776,1759.69,120.728,1759.69,102.075,1753.63); + path_6.cubicTo(64.3765,1741.38,34.8204,1711.84,22.5714,1674.16); + path_6.cubicTo(16.5107,1655.51,16.5107,1632.48,16.5107,1586.4); + path_6.lineTo(16.5107,183.601); + path_6.close(); + + Paint paint_6_fill = Paint()..style=PaintingStyle.fill; + paint_6_fill.color = Color(0xff121515).withOpacity(1.0); + canvas.drawPath(path_6,paint_6_fill); + + Path path_7 = Path(); + path_7.moveTo(683.128,0); + path_7.lineTo(695.511,0); + path_7.lineTo(695.511,10.3147); + path_7.lineTo(683.128,10.3147); + path_7.lineTo(683.128,0); + path_7.close(); + + Paint paint_7_fill = Paint()..style=PaintingStyle.fill; + paint_7_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_7,paint_7_fill); + + Path path_8 = Path(); + path_8.moveTo(856.489,177.413); + path_8.lineTo(866.808,177.413); + path_8.lineTo(866.808,189.79); + path_8.lineTo(856.489,189.79); + path_8.lineTo(856.489,177.413); + path_8.close(); + + Paint paint_8_fill = Paint()..style=PaintingStyle.fill; + paint_8_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_8,paint_8_fill); + + Path path_9 = Path(); + path_9.moveTo(6.19141,177.413); + path_9.lineTo(16.5106,177.413); + path_9.lineTo(16.5106,189.79); + path_9.lineTo(6.19141,189.79); + path_9.lineTo(6.19141,177.413); + path_9.close(); + + Paint paint_9_fill = Paint()..style=PaintingStyle.fill; + paint_9_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_9,paint_9_fill); + + Path path_10 = Path(); + path_10.moveTo(6.19141,1580.21); + path_10.lineTo(16.5106,1580.21); + path_10.lineTo(16.5106,1592.59); + path_10.lineTo(6.19141,1592.59); + path_10.lineTo(6.19141,1580.21); + path_10.close(); + + Paint paint_10_fill = Paint()..style=PaintingStyle.fill; + paint_10_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_10,paint_10_fill); + + Path path_11 = Path(); + path_11.moveTo(856.489,1580.21); + path_11.lineTo(866.808,1580.21); + path_11.lineTo(866.808,1592.59); + path_11.lineTo(856.489,1592.59); + path_11.lineTo(856.489,1580.21); + path_11.close(); + + Paint paint_11_fill = Paint()..style=PaintingStyle.fill; + paint_11_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_11,paint_11_fill); + + Path path_12 = Path(); + path_12.moveTo(177.489,1759.69); + path_12.lineTo(189.872,1759.69); + path_12.lineTo(189.872,1770); + path_12.lineTo(177.489,1770); + path_12.lineTo(177.489,1759.69); + path_12.close(); + + Paint paint_12_fill = Paint()..style=PaintingStyle.fill; + paint_12_fill.color = Color(0xff36454C).withOpacity(1.0); + canvas.drawPath(path_12,paint_12_fill); + + Path path_13 = Path(); + path_13.moveTo(372,13); + path_13.lineTo(499,13); + path_13.lineTo(499,17); + path_13.cubicTo(499,21.4183,495.418,25,491,25); + path_13.lineTo(380,25); + path_13.cubicTo(375.582,25,372,21.4183,372,17); + path_13.lineTo(372,13); + path_13.close(); + + Paint paint_13_fill = Paint()..style=PaintingStyle.fill; + paint_13_fill.color = Color(0xff262C2D).withOpacity(1.0); + canvas.drawPath(path_13,paint_13_fill); + + Path path_14 = Path(); + path_14.moveTo(372,13); + path_14.lineTo(499,13); + path_14.lineTo(499,17); + path_14.cubicTo(499,21.4183,495.418,25,491,25); + path_14.lineTo(380,25); + path_14.cubicTo(375.582,25,372,21.4183,372,17); + path_14.lineTo(372,13); + path_14.close(); + + Paint paint_14_fill = Paint()..style=PaintingStyle.fill; + paint_14_fill.color = Colors.black.withOpacity(1.0); + canvas.drawPath(path_14,paint_14_fill); + + Path path_15 = Path(); + path_15.moveTo(134,25); + path_15.cubicTo(80.4284,25,37,68.4284,37,122); + path_15.lineTo(37,1624); + path_15.cubicTo(37,1677.57,80.4284,1721,134,1721); + path_15.lineTo(739,1721); + path_15.cubicTo(792.572,1721,836,1677.57,836,1624); + path_15.lineTo(836,122); + path_15.cubicTo(836,68.4284,792.572,25,739,25); + path_15.lineTo(134,25); + path_15.close(); + path_15.moveTo(356.176,54); + path_15.cubicTo(340.159,54,327.176,66.9837,327.176,83); + path_15.cubicTo(327.176,99.0163,340.159,112,356.176,112); + path_15.lineTo(514.784,112); + path_15.cubicTo(530.801,112,543.784,99.0163,543.784,83); + path_15.cubicTo(543.784,66.9837,530.801,54,514.784,54); + path_15.lineTo(356.176,54); + path_15.close(); + + Paint paint_15_fill = Paint()..style=PaintingStyle.fill; + paint_15_fill.color = Color(0xffFF0000).withOpacity(1.0); + canvas.drawPath(path_15,paint_15_fill); + + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) { + return false; + } +} diff --git a/device_frame/lib/src/devices/ios/iphone_14_pro/screen.g.dart b/device_frame/lib/src/devices/ios/iphone_14_pro/screen.g.dart new file mode 100644 index 00000000..8e772c49 --- /dev/null +++ b/device_frame/lib/src/devices/ios/iphone_14_pro/screen.g.dart @@ -0,0 +1,23 @@ +part of 'device.dart'; + +// Generated manually with https://fluttershapemaker.com/ +final _screenPath = Path() + ..moveTo(97, 0) + ..cubicTo(43.4284, 0, 0, 43.4284, 0, 97) + ..lineTo(0, 1599) + ..cubicTo(0, 1652.57, 43.4284, 1696, 97, 1696) + ..lineTo(702, 1696) + ..cubicTo(755.572, 1696, 799, 1652.57, 799, 1599) + ..lineTo(799, 97) + ..cubicTo(799, 43.4284, 755.572, 0, 702, 0) + ..lineTo(97, 0) + ..close() + ..moveTo(319.176, 29) + ..cubicTo(303.159, 29, 290.176, 41.9837, 290.176, 58) + ..cubicTo(290.176, 74.0163, 303.159, 87, 319.176, 87) + ..lineTo(477.784, 87) + ..cubicTo(493.801, 87, 506.784, 74.0163, 506.784, 58) + ..cubicTo(506.784, 41.9837, 493.801, 29, 477.784, 29) + ..lineTo(319.176, 29) + ..close() + ..fillType = PathFillType.evenOdd; diff --git a/device_frame/pubspec.yaml b/device_frame/pubspec.yaml index 971af2f5..14745b61 100644 --- a/device_frame/pubspec.yaml +++ b/device_frame/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.1.0 homepage: https://github.com/aloisdeniel/flutter_device_preview/device_frame environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.19.6 <3.0.0' dependencies: freezed_annotation: ^2.0.3 @@ -17,6 +17,6 @@ dev_dependencies: build_runner: ^2.1.4 json_serializable: ^6.0.1 freezed: ^2.0.3 - flutter_lints: ^1.0.4 - xml: ^5.3.1 + flutter_lints: ^2.0.1 + xml: ^6.2.2 recase: ^4.0.0 diff --git a/device_preview/example/macos/Flutter/GeneratedPluginRegistrant.swift b/device_preview/example/macos/Flutter/GeneratedPluginRegistrant.swift index 287b6a9d..724bb2ac 100644 --- a/device_preview/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/device_preview/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,7 +5,7 @@ import FlutterMacOS import Foundation -import shared_preferences_macos +import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) diff --git a/device_preview/example/pubspec.yaml b/device_preview/example/pubspec.yaml index 24b3be76..eb3c379f 100644 --- a/device_preview/example/pubspec.yaml +++ b/device_preview/example/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.19.6 <3.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -46,7 +46,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/device_preview/lib/src/views/theme.dart b/device_preview/lib/src/views/theme.dart index 837d0121..9143903d 100644 --- a/device_preview/lib/src/views/theme.dart +++ b/device_preview/lib/src/views/theme.dart @@ -28,7 +28,6 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { primaryColor: accentColor, primaryColorDark: accentColor, indicatorColor: accentColor, - toggleableActiveColor: accentColor, highlightColor: accentColor.withOpacity(0.1), sliderTheme: base.sliderTheme.copyWith( thumbColor: accentColor, @@ -51,7 +50,6 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { primaryColor: accentColor, primaryColorDark: accentColor, indicatorColor: accentColor, - toggleableActiveColor: accentColor, highlightColor: accentColor, appBarTheme: base.appBarTheme.copyWith( color: barColor, diff --git a/device_preview/lib/src/views/tool_panel/sections/section.dart b/device_preview/lib/src/views/tool_panel/sections/section.dart index 059ef69a..fe354211 100644 --- a/device_preview/lib/src/views/tool_panel/sections/section.dart +++ b/device_preview/lib/src/views/tool_panel/sections/section.dart @@ -36,7 +36,7 @@ class ToolPanelSection extends StatelessWidget { ), child: Text( title.toUpperCase(), - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.hintColor, ), ), diff --git a/device_preview/lib/src/views/tool_panel/sections/settings.dart b/device_preview/lib/src/views/tool_panel/sections/settings.dart index eaf9f279..7dae3081 100644 --- a/device_preview/lib/src/views/tool_panel/sections/settings.dart +++ b/device_preview/lib/src/views/tool_panel/sections/settings.dart @@ -53,7 +53,7 @@ class SettingsSection extends StatelessWidget { shape: BoxShape.circle, color: background.scaffoldBackgroundColor, border: Border.all( - color: toolbar.backgroundColor, + color: toolbar.colorScheme.background, width: 1, ), ), @@ -84,7 +84,7 @@ class SettingsSection extends StatelessWidget { shape: BoxShape.circle, color: toolbar.scaffoldBackgroundColor, border: Border.all( - color: toolbar.backgroundColor, + color: toolbar.colorScheme.background, width: 1, ), ), diff --git a/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart b/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart index 8199e8ff..a50ee934 100644 --- a/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart +++ b/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart @@ -172,7 +172,7 @@ class _TypeSectionHeader extends StatelessWidget { } }() .toUpperCase(), - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.hintColor, ), ), diff --git a/device_preview/lib/src/views/tool_panel/tool_panel.dart b/device_preview/lib/src/views/tool_panel/tool_panel.dart index 9c2ee146..d9d7b5f4 100644 --- a/device_preview/lib/src/views/tool_panel/tool_panel.dart +++ b/device_preview/lib/src/views/tool_panel/tool_panel.dart @@ -80,7 +80,7 @@ class _ToolPanel extends StatelessWidget { appBar: AppBar( title: Text( 'Device preview', - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontSize: 14, fontWeight: FontWeight.bold, color: (theme.colorScheme.brightness == Brightness.dark diff --git a/device_preview/pubspec.yaml b/device_preview/pubspec.yaml index 444a47f3..00826b43 100644 --- a/device_preview/pubspec.yaml +++ b/device_preview/pubspec.yaml @@ -4,7 +4,7 @@ description: Approximate how your Flutter app looks and performs on another devi homepage: https://github.com/aloisdeniel/flutter_device_preview environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.19.6 <3.0.0' dependencies: flutter: @@ -21,7 +21,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.1 build_runner: ^2.1.4 freezed: ^2.0.3 json_serializable: ^6.1.0 diff --git a/docs/content/contributing/device_proposal.md b/docs/content/contributing/device_proposal.md index 3ef3b1ae..d23bea1a 100644 --- a/docs/content/contributing/device_proposal.md +++ b/docs/content/contributing/device_proposal.md @@ -4,7 +4,7 @@ All devices must be added as dedicated frames in the [offical Figma file](https://www.figma.com/file/WIamxcVDlHvxcCjLvJnwmR/DevicePreview---Frames?node-id=0%3A1). -Each device frame mush have a `Screen` node which must contains a flatten shape, and a `Body` group which contains the device body elements. +Each device frame must have a `Screen` node which must contains a flatten shape, and a `Body` group which contains the device body elements. ## Generate painter code @@ -12,4 +12,4 @@ All the custom painter code is generated with [fluttershapemaker](https://flutte # Send a pull request -Once your design is ready, create [a new pull request](https://github.com/aloisdeniel/flutter_device_preview/pulls) with your files added to the `device_frame/lib/src/devices/` directory. \ No newline at end of file +Once your design is ready, create [a new pull request](https://github.com/aloisdeniel/flutter_device_preview/pulls) with your files added to the `device_frame/lib/src/devices/` directory.