activity ui and search prep
This commit is contained in:
parent
6e0b1263ba
commit
2eb5d8f171
@ -8,9 +8,10 @@ import 'package:sendtrain/widgets/generic/elements/form_text_input.dart';
|
||||
|
||||
class FormSearchInput extends StatefulWidget {
|
||||
const FormSearchInput(
|
||||
{super.key, required this.sessionController, this.optionalPayload});
|
||||
{super.key, required this.sessionController, required this.service, this.optionalPayload});
|
||||
|
||||
final TextEditingController sessionController;
|
||||
final dynamic service;
|
||||
final dynamic optionalPayload;
|
||||
|
||||
@override
|
||||
@ -20,12 +21,17 @@ class FormSearchInput extends StatefulWidget {
|
||||
class _FormSearchInputState extends State<FormSearchInput> {
|
||||
String? _currentQuery;
|
||||
|
||||
final service = GooglePlacesService();
|
||||
late final service = widget.service;
|
||||
|
||||
// The most recent suggestions received from the API.
|
||||
late Iterable<Widget> _lastOptions = <Widget>[];
|
||||
late final Debouncer debouncer;
|
||||
|
||||
// @override
|
||||
// initState() {
|
||||
// service = widget.service;
|
||||
// }
|
||||
|
||||
// Calls the "remote" API to search with the given query. Returns null when
|
||||
// the call has been made obsolete.
|
||||
Future<Iterable<Suggestion>?> _search(String query) async {
|
||||
|
@ -11,6 +11,7 @@ import 'package:sendtrain/daos/media_items_dao.dart';
|
||||
import 'package:sendtrain/daos/object_media_items_dao.dart';
|
||||
import 'package:sendtrain/daos/sessions_dao.dart';
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
import 'package:sendtrain/services/apis/google_places_service.dart';
|
||||
import 'package:sendtrain/widgets/builders/dialogs.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/form_search_input.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/form_text_input.dart';
|
||||
@ -181,6 +182,7 @@ class _SessionEditorState extends State<SessionEditor> {
|
||||
}),
|
||||
FormSearchInput(
|
||||
sessionController: sessionCreateController['address']!,
|
||||
service: GooglePlacesService(),
|
||||
optionalPayload: sessionPayload),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||
|
@ -40,6 +40,7 @@ class _SessionViewActivitiesState extends State<SessionViewActivities> {
|
||||
children: [
|
||||
Card.outlined(
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.only(top: 5, left: 15, right: 5, bottom: 5),
|
||||
onTap: () {},
|
||||
autofocus: true,
|
||||
leading: Icon(Icons.add_box_rounded),
|
||||
|
Loading…
x
Reference in New Issue
Block a user