Closed x8Haider closed 5 years ago
Hi @x8Haider,
I suspect from reading your stack trace that the issue may have originated from another plugin. I however would like to help if I can. Kindly include your code so that we can try to debug. Also the output from your flutter doctor
may be helpful.
Hi,
Here is the summary:
Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.706], locale en-US) [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) X Android license status unknown. Try re-installing or updating your Android SDK Manager. See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions. [√] Android Studio (version 3.4) [√] Connected device (1 available)
! Doctor found issues in 1 category.
The keyboard_visibility
plugin seem to be the origin of the issue. This plugin is purely dart
code with dependency on a few packages, most of which don't rely on underlying native code.
If you still think that the issue originates from this package, we may have to have a look at your code.
Here is my code:
import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; class fullForm extends StatefulWidget { @override _fullFormState createState() => _fullFormState(); }
class _fullFormState extends State
),
textAlign: TextAlign.center,
),
),
margin: EdgeInsets.only(
left: 20,
right: 20,
bottom: 20
),
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
)
]
)
),
Container(
margin: EdgeInsets.only(
left: 20,
right: 20,
bottom: 20
),
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
)
]
),
child: Column(
children: <Widget>[
FormBuilder(
key: _fbKey,
autovalidate: false,
child: Column(
children: <Widget>[
FormBuilderDropdown(
attribute: "type",
decoration: InputDecoration(labelText: "Vehicle Type"),
// initialValue: 'Male',
hint: Text('Select Type'),
validators: [FormBuilderValidators.required()],
items: ['4x4', 'S/Wagon', 'Saloon']
.map((type) => DropdownMenuItem(
value: type,
child: Text("$type")
)).toList(),
),
FormBuilderTextField(
attribute: "age",
decoration: InputDecoration(labelText: "Age"),
validators: [
FormBuilderValidators.numeric(),
FormBuilderValidators.max(70),
],
),
FormBuilderDropdown(
attribute: "make",
decoration: InputDecoration(labelText: "Make"),
hint: Text('Select Make'),
validators: [FormBuilderValidators.required()],
items: ['IS250', 'ANKAI', 'Abc', 'Abillama', 'Ace', 'Admiral', 'Afico', 'Agricultural', 'Air Compressor', 'Air Comresor', 'Airstream', 'Akrman', 'Al Alam', 'Al Arabi', 'Al Mutlak', 'Al Shamrani', 'Al-Alam', 'Alamen', 'Alfa Romeo', 'All Metal', 'Alps', 'Ambulance', 'American', 'Amirecana', 'Ams', 'Anchor', 'Ant Fiatbed', 'Any', 'Apbilla', 'Ape', 'Aprilia', 'Armadillo', 'Armed', 'Aro', 'Arrow', 'Articulated Dump Truck', 'As Per List Attached', 'Ashok Leyland', 'Asia', 'Asphalte', 'Aston', 'Astra', 'Astro', 'Atlanta', 'Atlas', 'Atlet', 'Atobunchi', 'Audi', 'Aupa', 'Ausa', 'Austin', 'Auto', 'Auto Car', 'Auto Mower', 'Autobianchi', 'Ave.Marshall', 'Aveling', 'Avico', 'Avling', 'Awm', 'Axial', 'Ayman', 'B/Ford', 'BAIC', 'BAIC', 'BMW', 'BYD', 'Backhoe', 'Bajaj', 'Bajin', 'Bambai', 'Bandini', 'Bantom', 'Banyai', 'Baranite', 'Barber', 'Barbersurf', 'Barboards', 'Barford', 'Barin', 'Barlit', 'Batbata', 'Bauer', 'Bauler', 'Beach', 'Bedford', 'Bedford With Crane', 'Belleli', 'Belly', 'Benati', 'Benford', 'Bentam', 'Bentely', 'Bentley', 'Berliet', 'Berlingo', 'Berlit', 'Berloja', 'Beruda', 'Besta', 'Binati', 'Bitter', 'Bizzocchi', 'Black', 'Blaw', 'Blonex', 'Blow', 'Blownex', 'Blue Bird', 'Bluebird', 'Blumhart', 'Bneford', 'Bob', 'Bobby', 'Bobcat', 'Bobcock', 'Bodily Injured', 'Bomag', 'Boom', 'Boom', 'Boss', 'Bouling', 'Box', 'Breakdown', 'Brilliant', 'Brimont', 'Brimot', 'Bristol', 'British', 'British', 'Broomwad', 'Bross', 'Broud', 'Brown', 'Brush', 'Bucyros', 'Bugatti', 'Buggy', 'Buick', 'Buldozer', 'Bulk', 'Bulk Silo', 'Bycycle', 'C.N.F.', 'CR&S ', 'Cadillac', 'Calabrese', 'Cambridge', 'Camc', 'Car Carrier', 'Caravan', 'Carbodies', 'Carlkase', 'Carmichael', 'Carver', 'Case', 'Case', 'Cat', 'Caterpillar', 'Catterpiller', 'Cbm', 'Cement', 'Cetreon', 'Charlie', 'Chassis', 'Chenay', 'Cherry Saloon', 'Chery', 'Chery', 'Chevrolet', 'Chiefpain', 'China', 'Chrysler', 'Cila', 'Citroen', 'Clark', 'Cmc', 'Cmc', 'Cobelco', 'Cobus', 'Coles', 'Comet', 'Cometto', 'Commer', 'Common', 'Compair', 'Compressor', 'Concrete', 'Congfeng', 'Conquest', 'Container', 'Continental', 'Cooper', 'Coventry', 'Crane', 'Crawler', 'Cross Mobile', 'Crude', 'Crusher', 'Dacia', 'Daewoo', 'Daf', 'Daihatsu', 'Daimler', 'Dalta', 'Damas', 'Damler', 'Dasia', 'Datsun', 'Dawoo', 'Dcy', 'Death', 'Deawoo', 'Deere', 'Dehosing', 'Delachapelle', 'Delmag', 'Delta', 'Demag', 'Dennis', 'Deutz', 'Dieci Dumper', 'Diesel', 'Discovery', 'Ditto', 'Djb', 'Dodge', 'Dokti', 'Dong Feng', 'Donga', 'Doosan', 'Double', 'Douglas', 'Drill Tech', 'Droomwade', 'Droud', 'Ducati', 'Dump Truck', 'Dumper', 'Dynapac', 'E-One', 'Eagle', 'Eam', 'Eclipse', 'Eder', 'Eezion', 'Eicher', 'Elgin', 'Elite', 'Empty Container', 'End', 'Equipment', 'Erf', 'Escort', 'Escorts', 'Eveco', 'Evico', 'Excavator', 'Extec', 'F.L.T.', 'Falcon', 'Fao', 'Fargo', 'Farm', 'Farukawa', 'Faun', 'Faw', 'Fendt', 'Ferecha', 'Ferguson', 'Fermec', 'Ferrari', 'Fg Wilson', 'Fiat', 'Finisher', 'Fire', 'Fj20', 'Flasher', 'Flat', 'Flat Bed', 'Fluence', 'Foden', 'Force', 'Ford', 'Forgo', 'Fork Lift', 'Foton', 'Foton', 'Freeca', 'Freight', 'Freuhauf', 'Fuel', 'Fueller', 'Furguosen', 'Furukawa', 'Fuso', 'G.C.P', 'GMC', 'Galion', 'Gallardo', 'Garbage', 'Gavia', 'Gazamo', 'Gcp', 'Geely', 'Geevang', 'Gefang', 'Generator', 'Genie', 'Geo', 'Gesmo', 'Gevang', 'Gilero', 'Gizmo', 'Gloden', 'Go Trade', 'Godrej ', 'Golden', 'Golden Dragon Bus', 'Goldhofer', 'Golf', 'Gonow', 'Gorica', 'Gottwald', 'Grader', 'Grand', 'Grand Cherokee', 'Grand Marquis', 'Greanc', 'Great Wall', 'Groove', 'Grove', 'Gtw', 'Guhang', 'Guzzler', 'HARBECK', 'HAVAL', 'HAVAN', 'HOWO', 'Hackley', 'Haima', 'Halla', 'Hamm', 'Hammer', 'Hamonag', 'Hampson', 'Hangzhou', 'Hanomag', 'Hargill', 'Harley Davidson', 'Henley', 'Herman', 'Hermanns', 'Hero', 'Herster', 'Higer', 'High Bed', 'Hijer', 'Hilux', 'Hima', 'Hino', 'Hitachi', 'Hmc', 'Hofmann', 'Holden', 'Holder', 'Honda', 'Horse Box', 'Hosten', 'Hsp', 'Hummer', 'Huski', 'Husky', 'Hydraulic', 'Hydrolic', 'Hymac', 'Hyson', 'Hyster', 'Hyundai', 'IS250', 'Icher', 'Imperial', 'Imt', 'Indian', 'Infinity', 'Ingersoil', 'Ingersole', 'Ingersoll', 'Ingram', 'Intercontinental', 'International', 'Intigar', 'Ir Soil', 'Ishar', 'Ishteir', 'Isuzu', 'Itas', 'Iveco', 'J.I.', 'Jac', 'Jaguar', 'Jameelat', 'Jcb', 'Jcp', 'Jeep', 'Jefang', 'Ji', 'Jifaning', 'Jinb', 'Jinbei', 'Jinbei', 'Jlg', 'Jlg', 'Jlx', 'Jmc', 'John', 'Johndere', 'Johnson', 'Johnston', 'Jones', 'Jun Jin', 'Jungheinrich', 'Jungwoo', 'Juve', 'K.M.C', 'Kalmar', 'Kalmer', 'Kamar', 'Kamaz', 'Kamaz', 'Karwa Bus', 'Kass', 'Kato', 'Kawasaki', 'Kelissa', 'Kempfflat', 'Kenworth', 'Khod', 'Kia', 'King', 'Kmc', 'Knott GMBH', 'Kobelco', 'Koenigsegg', 'Kogel', 'Komatsu', 'Kompakt', 'Kraz', 'Krone', 'Krupp', 'Ktm', 'Ktm', 'Kukla', 'Kumit', 'Lada', 'Laforza', 'Lag', 'Lagonda', 'Lamborghini', 'Lancer', 'Lancer Boss', 'Lancia', 'Lancier', 'Landrover', 'Lane', 'Lansing', 'Layland', 'Legend', 'Leibherr', 'Lensing', 'Lenz Zetcat', 'Leverton', 'Lexus', 'Leyland', 'Liberty', 'Lickners', 'Liebherr', 'Liebwerr', 'Ligier', 'Lincoln', 'Linde', 'Linde Slide', 'Liner', 'Link Belt', 'Linkbelt', 'Loader', 'Loadking ', 'Locatelli', 'Lorain', 'Lotus', 'Lourin', 'Low Bed', 'Lowbox', 'Lpg', 'Lti', 'Lumberghini', 'Luxgen', 'M V Agosha', 'M. F. A.', 'M. F. T', 'M/Ferguson', 'MG ', 'MKS SALOON', 'Ma. Na. Ro', 'Mabtro', 'Mack', 'Maclaren', 'Magirus', 'Maguai', 'Mahindra', 'Majdouie', 'Mammut', 'Man', 'Man', 'Manitou', 'Manitowoc', 'Mantis', 'Marfya', 'Mark', 'Marshal', 'Maserati', 'Masseey Ferguson', 'Masserati', 'Massey Ferguson', 'Mast Explorer', 'Matbro', 'Max', 'Maybach', 'Mazaratti', 'Mazda', 'Mbw', 'McLaren', 'Mcc', 'Mccloskey', 'Mercedes', 'Mercury', 'Mesto', 'Mezaratti', 'Mf', 'Michigan', 'Military', 'Milling', 'Mini', 'Mitsubishi', 'Mitsuka', 'Mixer', 'Mobicar', 'Mobile', 'Molt', 'Montapert', 'Montgomeries', 'Monymok', 'Motorcycle', 'Mubicant', 'Muntefrdy', 'Mutlak', 'Nallen', 'Navi Star', 'Navistar', 'Nck', 'Neoplan', 'New Case', 'Newton', 'Nice Pickup', 'Nifty', 'Nik', 'Nissan', 'Noell', 'Norinco', 'Norton', 'Norwestern', 'Nsc', 'Nwesterm', 'O&K', 'OMM', 'Oldbury', 'Oldsmobile', 'Opel', 'Orenstein', 'Ornsten', 'Ottawa', 'Overhead', 'Ownki', 'P 1535', 'P&H', 'P.1078', 'P.1115', 'P.1118', 'P.1119', 'P.1121', 'P.1189', 'P.1208', 'P.1235', 'P.1237', 'P.1238', 'P.1246', 'P.1268', 'P.471', 'P.472', 'P.73', 'P.758', 'P.817', 'P.821', 'P.822', 'P.878', 'P.926', 'P.959', 'P.975', 'P.976', 'P.A.M.', 'P49 Henley', 'Pacific', 'Padmini Premiera', 'Pagani', 'Pancha', 'Paver', 'Pay Loader Cat', 'Pc 650 Excavator', 'Pc Pipe', 'Perodua', 'Peterbuilt', 'Pettibone', 'Peugeot', 'Pg Wilson', 'Phoenix', 'Piaggio', 'Pickrove', 'Pierce', 'Pile', 'Plan-Unitruc', 'Plonex', 'Plot', 'Plymouth', 'Pneumatic', 'Poclain', 'Pohton', 'Polaris', 'Polarun', 'Police', 'Pomag', 'Pontiac', 'Pony', 'Porsche', 'Portable', 'Pouling', 'Power', 'Ppm', 'Pre Heater', 'Premier', 'Prime', 'Property Damage', 'Proton', 'Puma', 'Putz', 'Putzmeister', 'Q5', 'QX 60', 'QX80', 'QX80', 'Qbus', 'Quad', 'R. Mercury', 'Rago', 'Ram Laramie', 'Ramcharger', 'Range Rover', 'Ransome & Rapier', 'Rapier', 'Ravo', 'Raygo', 'Reach Stacker', 'Recovery', 'Refrigerated', 'Refueler', 'Refuse', 'Reliance', 'Reliant', 'Remorque', 'Renault', 'Renegade', 'Reno Mobail', 'Retro', 'Rib Eye', 'Rider', 'Rig', 'Rig', 'Rigid', 'Rigo', 'Rino', 'Road', 'Road Train', 'Roadstar', 'Rob Roy', 'Rock', 'Rockey', 'Roller', 'Rolls Royce', 'Roro', 'Rosa', 'Rosenbauer', 'Rough', 'Rover', 'Roygo', 'Rubber', 'Ruston', 'S/Trailer', 'S7 Saloon', 'Saab', 'Saiba', 'Saihanbird', 'Sakai', 'Sambron', 'Samsung', 'Sanbron', 'Sand', 'Sanderson', 'Sandvik', 'Sanfeng', 'Sanxing', 'Sany', 'Saviem', 'Saxon', 'Scammel', 'Scania', 'Scheuerie', 'Schifeng', 'Schmidt', 'Schoda', 'Schwelm', 'Schwing', 'Scoter', 'Screper', 'Seadon', 'Seat', 'Sechmidt', 'Seddon', 'Sehanbird', 'Self Propelled', 'Sels', 'Semi', 'Sennebogen', 'Sermac', 'Setra', 'Sewage', 'Sewer', 'Shantui', 'Shennio', 'Shovel', 'Siate', 'Side', 'Simex', 'Simon', 'Single', 'Sino', 'Sitemaster', 'Siva', 'Skid', 'Skip', 'Skoda', 'Sky', 'Sky Jack', 'Small Trailer', 'Smart', 'Soil', 'Soilmec', 'Somerset', 'Sonfa', 'Sonsy', 'Sothert', 'Spm', 'Ssangyong', 'Starplux', 'Stetter', 'Steyr', 'Still', 'Stothert', 'Strecher', 'Subaru', 'Suburban', 'Suhail', 'Sulphur', 'Sumitomo', 'Sunbeam', 'Sunlong', 'Sunwin', 'Super', 'Suzuki', 'Sykes', 'TIL', 'Tadano', 'Taichan', 'Talbert', 'Talbot', 'Tamrock', 'Tandano', 'Tandem', 'Tandum', 'Tank', 'Tanker', 'Tannent', 'Tasker', 'Tata', 'Tatra', 'Tayani', 'Tcm', 'Tecmor', 'Telehandler', 'Teles', 'Telescopic', 'Tempo', 'Temsa', 'Tendum', 'Tennand', 'Tennant', 'Terex', 'Tesmec', 'Teupen', 'Thawite', 'Thomas', 'Thompsom', 'Thwaites', 'Tiger', 'Tilt', 'Tin Jin', 'Tipper', 'Tipper Trailer', 'Tipping', 'Tire', 'Titan', 'Tmc', 'Toko', 'Tokyu', 'Tomas', 'Tonghua Petro', 'Topper', 'Towing', 'Toyota', 'Trackmaster', 'Tractor', 'Trailer', 'Trailer tec', 'Train', 'Trans', 'Trencher', 'Tri', 'Triumph', 'Triumph Rocket', 'Truck', 'Tuskan', 'Tvr', 'Tvs', 'Twa', 'Two', 'Tyangin', 'Ufo', 'Unik', 'Unimag', 'Universal', 'Upright', 'Uzotoyol', 'VSR trailer', 'Vaccum', 'Valmat', 'Van', 'Varica', 'Varina', 'Various', 'Vauxhall', 'Vax Jet', 'Verita', 'Vermeer', 'Vibrator', 'Vibratory', 'Vibro', 'Vibromax', 'Vino', 'Vioger', 'Vogele', 'Volkswagen', 'Volvo', 'Voyger', 'Wallis', 'Water', 'Wergo', 'Westco', 'Western', 'Western Star', 'Wheel Laoder', 'Wheel Loader', 'Wheeled', 'Whetherhill', 'Willis', 'Winclet', 'Winget', 'Winglet', 'Wirthbia', 'Wok', 'Workhorse', 'Worthington', 'Wrangler', 'Wybepower', 'Xiamen', 'YAXING', 'Yale', 'Yamaha', 'Yanpai', 'York', 'Yulon', 'ZNA', 'Zetcat', 'Zhonghua', 'Zil', 'Zta Desta']
.map((make) => DropdownMenuItem(
value: make,
child: Text("$make")
)).toList(),
),
],
),
),
Row(
children: <Widget>[
MaterialButton(
child: Text("Submit"),
onPressed: () {
_fbKey.currentState.save();
if (_fbKey.currentState.validate()) {
print(_fbKey.currentState.value);
}
},
),
MaterialButton(
child: Text("Reset"),
onPressed: () {
_fbKey.currentState.reset();
},
),
],
)
],
),
)
],
),
);
} }
Hi @x8Haider,
I'm quite sorry - it's my bad - I was not aware that keyboard_visibility
is a transitive dependency of this package (as noted here by a keen eye) and I thought you had it as a direct dependency of your project.
I'm told that the issue has been recently fixed by the developer of the package. Kindly try running flutter packages upgrade
and let's know if there will be any changes.
Alternatively you you could try having the latest version of keyboard_visibility
as a dependency in your project
Hi Danvick,
Upgraded the package and it is working perfectly :) 👍
Thanks.
Hello,
I'm using your example in my flutter application. and when I try to test the numeric filed the app stopped each time.
Here are the logs I got from the Run console:
D/AndroidRuntime( 368): Shutting down VM E/AndroidRuntime( 368): FATAL EXCEPTION: main E/AndroidRuntime( 368): Process: com.insurance.my_insurance, PID: 368 E/AndroidRuntime( 368): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getWindowVisibleDisplayFrame(android.graphics.Rect)' on a null object reference E/AndroidRuntime( 368): at com.github.adee42.keyboardvisibility.KeyboardVisibilityPlugin.onGlobalLayout(KeyboardVisibilityPlugin.java:40) E/AndroidRuntime( 368): at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945) E/AndroidRuntime( 368): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2357) E/AndroidRuntime( 368): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460) E/AndroidRuntime( 368): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183) E/AndroidRuntime( 368): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949) E/AndroidRuntime( 368): at android.view.Choreographer.doCallbacks(Choreographer.java:761) E/AndroidRuntime( 368): at android.view.Choreographer.doFrame(Choreographer.java:696) E/AndroidRuntime( 368): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935) E/AndroidRuntime( 368): at android.os.Handler.handleCallback(Handler.java:873) E/AndroidRuntime( 368): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 368): at android.os.Looper.loop(Looper.java:193) E/AndroidRuntime( 368): at android.app.ActivityThread.main(ActivityThread.java:6669) E/AndroidRuntime( 368): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 368): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/AndroidRuntime( 368): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) I/Process ( 368): Sending signal. PID: 368 SIG: 9 Lost connection to device.