Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iPhone 14 Pro Max device support #203

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions device_frame/lib/src/devices/ios/devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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;
Expand All @@ -45,6 +50,7 @@ class IosDevices {
/// All devices.
List<DeviceInfo> get all => [
// Phones
iPhone14Pro,
iPhone12Mini,
iPhone12,
iPhone12ProMax,
Expand Down
33 changes: 33 additions & 0 deletions device_frame/lib/src/devices/ios/iphone_14_pro/device.dart
Original file line number Diff line number Diff line change
@@ -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(842.0, 1770.0),
screenSize: const Size(440, 934),
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,
);
173 changes: 173 additions & 0 deletions device_frame/lib/src/devices/ios/iphone_14_pro/frame.g.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// ignore_for_file: require_trailing_commas, non_constant_identifier_names

part of 'device.dart';

// Generated manually with https://fluttershapemaker.com/
class _FramePainter extends CustomPainter {
const _FramePainter();

@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.573,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_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);

/// white bazel
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(0xffffffff).withOpacity(1.0);
canvas.drawPath(path_5,paint_5_fill);

/// black bazel
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.809,177.413);
// path_8.lineTo(866.809,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_14 = Path();
path_14.moveTo(327,95);
path_14.cubicTo(327,78.9837,339.984,66,356,66);
path_14.lineTo(515,66);
path_14.cubicTo(531.016,66,544,78.9837,544,95);
path_14.cubicTo(544,111.016,531.016,124,515,124);
path_14.lineTo(356,124);
path_14.cubicTo(339.984,124,327,111.016,327,95);
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);
}

@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return false;
}
}
28 changes: 28 additions & 0 deletions device_frame/lib/src/devices/ios/iphone_14_pro/screen.g.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
part of 'device.dart';

// Generated manually with https://fluttershapemaker.com/
final _screenPath = Path()
//top corner
..moveTo(135+5, 25+0)
..cubicTo(81.4284+10, 25+5, 38+5, 68.4284-10, 38-5, 122+10)
// left side
..lineTo(38-5, 1624-10)
..cubicTo(35, 1677.57+20, 81.4284, 1721+10, 135+0, 1721+20)
..lineTo(740+20, 1721+20)
// bottom - right corner
..cubicTo(793.572+10, 1721+0, 837+5, 1677.57+5, 837+5, 1624+0)
..lineTo(837+5, 122+5)
..cubicTo(837+0, 68.4284+5, 793.572+5, 25+5, 740+5, 25+5)
..lineTo(135+0, 25+0)
..close()
/// below code is for dynamic island
..moveTo(357.176, 54)
..cubicTo(341.159, 54, 328.176, 66.9837, 328.176, 83)
..cubicTo(328.176, 99.0163, 341.159, 112, 357.176, 112)
..lineTo(515.784, 112)
..cubicTo(531.801, 112, 544.784, 99.0163, 544.784, 83)
..cubicTo(544.784, 66.9837, 531.801, 54, 515.784, 54)
..lineTo(357.176, 54)
/// above code
..close()
..fillType = PathFillType.evenOdd;