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

Modernising the entire project #225

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e5796c7
iphone 12 ratio changed
wwkler Jul 30, 2022
25d06c5
changed the screen size for iphone 12
Uuttssaavv Aug 7, 2022
e1ef7eb
added custom device pixel 4
Uuttssaavv Aug 7, 2022
0ecf507
added pixel ratio for device pixel 4
Uuttssaavv Aug 7, 2022
d98f23f
Fix a typo
walid-ashik Sep 11, 2022
e749637
Fix a typo in the documentation
walid-ashik Sep 11, 2022
18ec2cf
Revert "fill in 4th gen stats"
heeyunlee Oct 17, 2022
8edfc14
update changelog and version for device_frame package
heeyunlee Oct 17, 2022
8424f6e
sdk: '>=2.18.4 <3.0.0'
bradrushworth May 13, 2023
5e171ab
Merge remote-tracking branch 'wwkler/develop'
bradrushworth May 13, 2023
a517287
Merge remote-tracking branch 'Uuttssaavv/issue136'
bradrushworth May 13, 2023
1aa14a1
Merge remote-tracking branch 'walid-ashik/patch-1'
bradrushworth May 13, 2023
0fc9959
Merge remote-tracking branch 'walid-ashik/patch-2'
bradrushworth May 13, 2023
ba6d885
sdk: '>=2.18.4 <3.0.0'
bradrushworth May 13, 2023
655a6e1
Merge remote-tracking branch 'heeyunlee/master'
bradrushworth May 13, 2023
e022743
Cleaning up Pixel 4 implementation.
bradrushworth May 13, 2023
341b827
Wip: Add iPhone 14 Pro Max device support
walid-ashik Oct 15, 2022
8db292e
Revert "Wip: Add iPhone 14 Pro Max device support"
bradrushworth May 13, 2023
6ca08f7
More sensible spot for Pixel 4.
bradrushworth May 13, 2023
337578f
Revert "added custom device pixel 4"
bradrushworth May 13, 2023
6b96d31
Revert "Revert "added custom device pixel 4""
bradrushworth May 13, 2023
214c008
Revert "Revert "Wip: Add iPhone 14 Pro Max device support""
bradrushworth Jun 4, 2023
be6ccc5
sdk: ">=2.19.6 <3.0.0"
bradrushworth Jun 4, 2023
0c8439f
Fixed NaN entries from https://fluttershapemaker.com/ for iPhone 14 P…
bradrushworth Jun 4, 2023
3e84282
Upgrade to flutter 2.19
bradrushworth Jan 2, 2025
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 19 additions & 19 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
// 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"
}
]
}
5 changes: 5 additions & 0 deletions device_frame/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.1

* Fixes iPhone 12 size and safe area issue
* Adding Pixel 4

## 1.1.0

* Updated freezed dependency.
Expand Down
2 changes: 1 addition & 1 deletion device_frame/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion device_frame/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions device_frame/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions device_frame/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions device_frame/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 22 additions & 2 deletions device_frame/lib/src/devices/android/devices.dart
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -159,6 +178,7 @@ class AndroidDevices {
samsungGalaxyS20,
samsungGalaxyNote20,
samsungGalaxyNote20Ultra,
pixel4,
onePlus8Pro,
sonyXperia1II,
smallPhone,
Expand Down
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
16 changes: 8 additions & 8 deletions device_frame/lib/src/devices/ios/iphone_12/device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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(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,
);
Loading