-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix removing chip after entering 1 symbol
This changes set a proper initial value for the internal text state. Fix #34
- Loading branch information
1 parent
8c08caa
commit a1bc9fd
Showing
6 changed files
with
103 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ class MyApp extends StatelessWidget { | |
} | ||
|
||
class MyHomePage extends StatefulWidget { | ||
MyHomePage({Key key}) : super(key: key); | ||
MyHomePage({Key? key}) : super(key: key); | ||
|
||
@override | ||
_MyHomePageState createState() => _MyHomePageState(); | ||
|
@@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage> { | |
children: <Widget>[ | ||
TextField(), | ||
TextField(), | ||
ChipsInput( | ||
ChipsInput<AppProfile>( | ||
key: _chipKey, | ||
/*initialValue: [ | ||
AppProfile('John Doe', '[email protected]', | ||
|
@@ -199,14 +199,14 @@ class _MyHomePageState extends State<MyHomePage> { | |
); | ||
}, | ||
),*/ | ||
RaisedButton( | ||
child: Text('Add Chip'), | ||
ElevatedButton( | ||
onPressed: () { | ||
_chipKey.currentState.selectSuggestion(AppProfile( | ||
_chipKey.currentState?.selectSuggestion(AppProfile( | ||
'Gina', | ||
'[email protected]', | ||
'https://upload.wikimedia.org/wikipedia/commons/7/7c/Profile_avatar_placeholder_large.png')); | ||
}, | ||
child: Text('Add Chip'), | ||
), | ||
], | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.