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
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ internal class NativeTextInput(context: Context, id: Int, creationParams: Map<St
}

val minHeightPadding = creationParams.get("minHeightPadding") as Double
val paddingLeft = creationParams.get("paddingLeft") as Double
val paddingRight = creationParams.get("paddingRight") as Double
editText.setPadding(
0,
paddingLeft.toInt(),
minHeightPadding.toInt() / 2,
0,
paddingRight.toInt(),
minHeightPadding.toInt() / 2)

editText.hint = creationParams.get("placeholder") as String
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
8 changes: 4 additions & 4 deletions example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.summary = 'A UI toolkit for beautiful and fast apps.'
s.homepage = 'https://flutter.dev'
s.license = { :type => 'BSD' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '9.0'
s.ios.deployment_target = '11.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_text_input/ios"

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_text_input: 246da758e5a2e744774aa839a1a21902e0e84ceb

PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
PODFILE CHECKSUM: 663715e941f9adb426e33bf9376914006f9ea95b

COCOAPODS: 1.10.1
COCOAPODS: 1.12.0
10 changes: 6 additions & 4 deletions 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 = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -209,6 +209,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -223,6 +224,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -333,7 +335,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -408,7 +410,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -457,7 +459,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
4 changes: 4 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
10 changes: 4 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class HomePage extends StatelessWidget {
final FocusNode _focusNode = FocusNode();

_onChangeText(value) => debugPrint("_onChangeText: $value");

_onSubmittedText(value) => debugPrint("_onSubmittedText: $value");

@override
Expand Down Expand Up @@ -107,13 +108,10 @@ class HomePage extends StatelessWidget {
),
),
Center(
child: FlatButton(
color: Colors.blue,
colorBrightness: Brightness.dark,
child: InkWell(
child: const Text("View More Use Cases"),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => MoreUseCaseListingPage()));
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (_) => MoreUseCaseListingPage()));
}),
),
],
Expand Down
28 changes: 6 additions & 22 deletions example/lib/more_use_case_listing_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class _MoreUseCaseListingPageState extends State<MoreUseCaseListingPage> {
String _currentTextInput = '';

_onChangeText(value) => debugPrint("_onChangeText: $value");

_onSubmittedText(value) => debugPrint("_onSubmittedText: $value");

_onTap(BuildContext context) {
const snackBar = SnackBar(content: Text('Tapped!'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
Expand Down Expand Up @@ -112,17 +114,6 @@ class _MoreUseCaseListingPageState extends State<MoreUseCaseListingPage> {
title: "Focusing or Unfocusing Text Input",
child: Column(
children: [
FlatButton(
color: Colors.blue,
colorBrightness: Brightness.dark,
child: const Text("Tap Me!"),
onPressed: () {
if (_focusNode.hasFocus) {
FocusScope.of(context).unfocus();
} else {
FocusScope.of(context).requestFocus(_focusNode);
}
}),
NativeTextInput(
focusNode: _focusNode,
onChanged: _onChangeText,
Expand All @@ -134,13 +125,6 @@ class _MoreUseCaseListingPageState extends State<MoreUseCaseListingPage> {
title: "Filling Text Programmatically",
child: Column(
children: [
FlatButton(
color: Colors.blue,
colorBrightness: Brightness.dark,
child: const Text("Tap Me!"),
onPressed: () => _changeTextController.text =
DateTime.now().toString(),
),
NativeTextInput(
controller: _changeTextController,
onChanged: _onChangeText,
Expand All @@ -149,10 +133,10 @@ class _MoreUseCaseListingPageState extends State<MoreUseCaseListingPage> {
],
)),
DemoItem(
title: "Recognizing Tap",
child: NativeTextInput(
onTap: () => _onTap(context),
),
title: "Recognizing Tap",
child: NativeTextInput(
onTap: () => _onTap(context),
),
),
Padding(
padding: const EdgeInsets.all(100),
Expand Down
Loading