Skip to content
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
11 changes: 11 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"


void fl_register_plugins(FlPluginRegistry* registry) {
}
15 changes: 15 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

#include <flutter_linux/flutter_linux.h>

// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);

#endif // GENERATED_PLUGIN_REGISTRANT_
23 changes: 23 additions & 0 deletions example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#

list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
10 changes: 10 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation


func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}
11 changes: 11 additions & 0 deletions example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/mohsen/development/flutter
FLUTTER_APPLICATION_PATH=/Users/mohsen/Documents/Projects/flutter_screen_lock/example
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=4.0.0
FLUTTER_BUILD_NUMBER=4.0.0
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json
12 changes: 12 additions & 0 deletions example/macos/Flutter/ephemeral/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/mohsen/development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/mohsen/Documents/Projects/flutter_screen_lock/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=4.0.0"
export "FLUTTER_BUILD_NUMBER=4.0.0"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
43 changes: 43 additions & 0 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
53 changes: 33 additions & 20 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ packages:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
sha256: "6021e0172ab6e6eaa1d391afed0a99353921f00c54385c574dc53e55d67c092c"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.18.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -31,14 +34,16 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
url: "https://pub.dev"
source: hosted
version: "1.0.4"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
sha256: "0ba8a1854c2098ddbd043e47eb28451a13f4cab7db9b2696f13a39fd8853421d"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_screen_lock:
Expand All @@ -47,54 +52,61 @@ packages:
path: ".."
relative: true
source: path
version: "9.0.0+1"
version: "9.0.3"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
url: "https://pub.dev"
source: hosted
version: "0.17.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
url: "https://pub.dev"
source: hosted
version: "1.0.1"
local_auth:
dependency: "direct main"
description:
name: local_auth
url: "https://pub.dartlang.org"
sha256: e726cb95a302f3fd9186a97133ff00061aad993cce14fadc5d552a7eb66c7191
url: "https://pub.dev"
source: hosted
version: "1.1.0"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.1.5"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.15.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
platform:
dependency: "direct main"
description:
name: platform
url: "https://pub.dartlang.org"
sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
sky_engine:
Expand All @@ -106,9 +118,10 @@ packages:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.4"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=3.3.0-0 <4.0.0"
flutter: ">=1.20.0"
4 changes: 2 additions & 2 deletions lib/src/configurations/screen_lock_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class ScreenLockConfig {
scaffoldBackgroundColor: backgroundColor,
outlinedButtonTheme: OutlinedButtonThemeData(style: buttonStyle),
textTheme: TextTheme(
headline6: titleTextStyle,
bodyText2: textStyle,
headlineMedium: titleTextStyle,
bodyMedium: textStyle,
),
);
}
Expand Down
16 changes: 10 additions & 6 deletions lib/src/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ Future<void> screenLock({
context,
PageRouteBuilder<void>(
opaque: false,
barrierColor: Colors.black.withOpacity(0.8),
barrierColor: Colors.transparent,
pageBuilder: (context, animation, secondaryAnimation) => WillPopScope(
onWillPop: () async => canCancel && onCancelled == null,
child: ScreenLock(
child: Directionality(
textDirection: TextDirection.ltr,
child: ScreenLock(
correctString: correctString,
onUnlocked: onUnlocked ?? Navigator.of(context).pop,
onOpened: onOpened,
Expand All @@ -87,7 +89,7 @@ Future<void> screenLock({
secretsBuilder: secretsBuilder,
useBlur: useBlur,
useLandscape: useLandscape,
),
)),
),
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
Expand Down Expand Up @@ -166,10 +168,12 @@ Future<void> screenLockCreate({
context,
PageRouteBuilder<void>(
opaque: false,
barrierColor: Colors.black.withOpacity(0.8),
barrierColor: Colors.transparent,
pageBuilder: (context, animation, secondaryAnimation) => WillPopScope(
onWillPop: () async => canCancel && onCancelled == null,
child: ScreenLock.create(
child: Directionality(
textDirection: TextDirection.ltr,
child: ScreenLock.create(
onConfirmed: onConfirmed,
onOpened: onOpened,
onValidate: onValidate,
Expand All @@ -195,7 +199,7 @@ Future<void> screenLockCreate({
secretsBuilder: secretsBuilder,
useBlur: useBlur,
useLandscape: useLandscape,
),
)),
),
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screen_lock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class _ScreenLockState extends State<ScreenLock> {

return Builder(
builder: (context) => DefaultTextStyle(
style: Theme.of(context).textTheme.headline6!,
style: Theme.of(context).textTheme.headlineMedium!,
textAlign: TextAlign.center,
child: buildDelay(
buildConfirmed(
Expand Down
Loading