поиск в базе данных sqlite с использованием typeaheadformfield во флаттере - PullRequest
0 голосов
/ 09 июля 2020

я пытаюсь сделать typeaheadformfield для выбора члена listview в другом интерфейсе.

это мой код:

TypeAheadFormField(
              textFieldConfiguration:TextFieldConfiguration(
              controller:c2,
              decoration: InputDecoration(
                labelText: ' Mdicament',
                hintText: 'Select a Mdicament',
                border: OutlineInputBorder(
                  borderRadius: BorderRadius.circular((20.0)),
                ),
              )),
              suggestionsCallback: (pattern){
                return  helper.getMedicamentMapList();
              },
              itemBuilder:(context,suggestion){
                return ListTile(
                  title:Text(suggestion),
                );
              },
              transitionBuilder:(context,suggestionsBox,controller){
                return suggestionsBox;
              },
              onSuggestionSelected:(suggestion){
                c2.text=suggestion;
               // Medicament.getMap(suggestion);
              },
              validator:(val)=>val.isEmpty ? 'please select a medic...' : null,
              onSaved:(val) => setState(
                    ()=> _nom=val,

          )
            ),

мое будущее в databasehelper:

Future<List<Map<String, dynamic>>> getMedicamentMapList() async {
  Database db = await this.database;

  //var result1 =  await db.rawQuery("SELECT * FROM $tableName ORDER BY $_id ASC");
  var result = await db.query(medicaTable, orderBy: "$colId ASC");
  return result;
}

я получаю эту ошибку:

I / SurfaceView (30515): updateWindow - OnPreDrawListener, mHaveFrame = true, this = io.flutter.embedding. android .FlutterSurfaceView {5e96fa0 VE .... ........ 0,0-720,1184} D / FeatureProxyBase (30515): конструктор класса FeatureProxyBase D / FeatureProxyBase (30515): getService (), serviceName = multiwindow_service_v1 V / InputMethodManager (30515): НАЧАТЬ ВХОД: io.flutter.embedding. android .FlutterView {1a277759 VFE ..... .F ...... 0,0-720,1184} ic = io.flutter. plugin.editing. InputConnectionAdaptor@3d6ee801 tba = EditorInfo {packageName = example.pharmacyapp, inputType = 0x80081, imeOptions = 0x2000006, privateImeOptions = null} controlFlags = # 0 I / InputMethodManager (30515): [startInputInner] EditorInfo. {packageName} , inputType = 0x80081, imeOptions = 0x2000006, privateImeOptions = null}, windowGainingFocus = nu ll, mServedView = io.flutter.embedding. android .FlutterView {1a277759 VFE ..... .F ...... 0,0-720,1184}, mServedInputConnectionWrapper = android .view.inputmethod. InputMethodManager$ControlledInputConnectionWrapper@24af46a6 I / SurfaceView (30515): updateWindow - setFrame, this = io.flutter.embedding. android .FlutterSurfaceView {5e96fa0 VE .... ...... I. 0,0-720,1184} I / SurfaceView (30515): updateWindow - OnPreDrawListener, mHaveFrame = true, this = io.flutter.embedding. android .FlutterSurfaceView {5e96fa0 VE .... ...... Я. 0,0-720,1184} I / SurfaceView (30515): updateWindow - setFrame, this = io.flutter.embedding. android .FlutterSurfaceView {5e96fa0 VE .... ...... I. 0,0-720,1184} I / SurfaceView (30515): updateWindow - OnPreDrawListener, mHaveFrame = true, this = io.flutter.embedding. android .FlutterSurfaceView {5e96fa0 VE .... ...... Я. 0,0-720,1184}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...