Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
mu-dawood committed Jun 13, 2022
1 parent 5ab6bba commit 578641a
Show file tree
Hide file tree
Showing 12 changed files with 571 additions and 556 deletions.
18 changes: 9 additions & 9 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ packages:
name: flutter_map
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0"
version: "1.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -265,7 +265,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.0"
version: "0.1.1"
path:
dependency: transitive
description:
Expand All @@ -280,6 +280,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
polylabel:
dependency: transitive
description:
name: polylabel
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
positioned_tap_detector_2:
dependency: transitive
description:
Expand Down Expand Up @@ -355,13 +362,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
transparent_image:
dependency: transitive
description:
name: transparent_image
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
tuple:
dependency: transitive
description:
Expand Down
9 changes: 6 additions & 3 deletions lib/src/bloc.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -66,7 +67,7 @@ extension BlocExtension on OpenMapBloc {
var response = await http.get(url);

var parsed = jsonDecode(response.body);
return FormattedLocation.from(parsed);
return FormattedLocation.fromJson(parsed);
}

Future<List<FormattedLocation>> search({
Expand Down Expand Up @@ -95,10 +96,12 @@ extension BlocExtension on OpenMapBloc {
List<FormattedLocation> resList = [];
for (var loc in parsed) {
try {
var res = FormattedLocation.from(loc);
var res = FormattedLocation.fromJson(loc);
resList.add(res);
} catch (e) {
print(e);
if (kDebugMode) {
print(e);
}
}
}
return Future<List<FormattedLocation>>.value(resList);
Expand Down
Loading

0 comments on commit 578641a

Please sign in to comment.