Skip to content

Commit c12502a

Browse files
authored
UPDATE flutter-hms-site 6.4.0+304
1 parent d7b47ba commit c12502a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4317
-3914
lines changed

flutter-hms-site/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 6.4.0+304
2+
3+
- Optimized the internal memory.
4+
- Modified the internal structure of the plugin. Please use import 'package:huawei_site/huawei_site.dart'; not to get any errors.
5+
16
## 6.0.1+304
27

38
- Deleted the capability of prompting users to install HMS Core (APK).

flutter-hms-site/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<p align="center">
2-
<h1 align="center">Huawei Site Flutter Plugin</h1>
2+
<h1 align="center">Huawei Site Kit Flutter Plugin</h1>
33
</p>
44

55

66
<p align="center">
77
<a href="https://pub.dev/packages/huawei_site"><img src="https://img.shields.io/pub/v/huawei_site?style=for-the-badge" alt="pub.dev version"></a>
88
</p>
99

10-
Huawei Site Flutter Plugin provides adaptation code for HUAWEI Site Kit to use the Flutter platform. With HUAWEI Site Kit, your app can provide users with convenient and secure access to diverse, place-related services.
10+
Huawei Site Kit Flutter Plugin provides adaptation code for Huawei Site Kit to use the Flutter platform. With Huawei Site Kit, your app can provide users with convenient and secure access to diverse, place-related services.
1111

1212
[Learn More](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/introduction-0000001050181259?ha_source=hms1)
1313

1414
## Installation
1515

16-
Please see [pub.dev](https://pub.dev/packages/huawei_site/install) and [AppGallery Connect Configuration](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/config-agc-0000001050179166).
16+
Please see [pub.dev](https://pub.dev/packages/huawei_site/install) and [AppGallery Connect Configuration](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/config-agc-0000001050179166?ha_source=hms1).
1717

1818
## Documentation
1919

@@ -33,4 +33,4 @@ If you run into a bug in our samples, please submit an issue to the [GitHub repo
3333

3434
## License
3535

36-
Huawei Site Flutter Plugin is licensed under [Apache 2.0 license](LICENCE)
36+
Huawei Site Kit Flutter Plugin is licensed under [Apache 2.0 license](LICENSE)

flutter-hms-site/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ android {
4141
}
4242

4343
dependencies {
44-
implementation 'com.huawei.hms:site:6.4.0.300'
44+
implementation 'com.huawei.hms:site:6.4.0.304'
4545
implementation 'androidx.appcompat:appcompat:1.2.0'
4646
implementation 'androidx.recyclerview:recyclerview:1.1.0'
4747
implementation "androidx.recyclerview:recyclerview-selection:1.0.0"

flutter-hms-site/android/src/main/java/com/huawei/hms/flutter/site/utils/HMSLogger.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class HMSLogger {
4040

4141
private static final String PLATFORM = "Flutter";
4242

43-
private static final String VERSION = "6.0.1.304";
43+
private static final String VERSION = "6.4.0.304";
4444

4545
private static final String SERVICE = "Cross-Platform";
4646

flutter-hms-site/example/lib/keys.dart

-34
This file was deleted.

flutter-hms-site/example/lib/main.dart

+22-9
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,33 @@ import 'screens/nearby_search_screen.dart';
2222
import 'screens/querysuggestion_search_screen.dart';
2323
import 'screens/text_search_screen.dart';
2424

25-
void main() => runApp(MyApp());
25+
void main() {
26+
runApp(const MyApp());
27+
}
2628

2729
class MyApp extends StatelessWidget {
30+
const MyApp({Key? key}) : super(key: key);
31+
2832
@override
2933
Widget build(BuildContext context) {
3034
return MaterialApp(
31-
home: HomeScreen(),
32-
routes: {
33-
HomeScreen.id: (context) => HomeScreen(),
34-
TextSearchScreen.id: (context) => TextSearchScreen(),
35-
NearbySearchScreen.id: (context) => NearbySearchScreen(),
36-
DetailSearchScreen.id: (context) => DetailSearchScreen(),
37-
QuerySuggestionSearchScreen.id: (context) =>
38-
QuerySuggestionSearchScreen(),
35+
home: const HomeScreen(),
36+
routes: <String, Widget Function(BuildContext)>{
37+
HomeScreen.id: (BuildContext context) {
38+
return const HomeScreen();
39+
},
40+
TextSearchScreen.id: (BuildContext context) {
41+
return const TextSearchScreen();
42+
},
43+
NearbySearchScreen.id: (BuildContext context) {
44+
return const NearbySearchScreen();
45+
},
46+
DetailSearchScreen.id: (BuildContext context) {
47+
return const DetailSearchScreen();
48+
},
49+
QuerySuggestionSearchScreen.id: (BuildContext context) {
50+
return const QuerySuggestionSearchScreen();
51+
},
3952
},
4053
);
4154
}

flutter-hms-site/example/lib/screens/detail_search_screen.dart

+24-23
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,50 @@
1717
import 'dart:developer';
1818

1919
import 'package:flutter/material.dart';
20-
import 'package:huawei_site/model/detail_search_request.dart';
21-
import 'package:huawei_site/model/detail_search_response.dart';
22-
import 'package:huawei_site/search_service.dart';
23-
import 'package:huawei_site_example/screens/home_screen.dart';
20+
import 'package:huawei_site/huawei_site.dart';
2421

25-
import '../keys.dart';
2622
import '../widgets/custom_button.dart';
2723
import '../widgets/custom_text_form_field.dart';
24+
import 'home_screen.dart';
2825

2926
class DetailSearchScreen extends StatefulWidget {
3027
static const String id = 'detail_search_screen';
3128

29+
const DetailSearchScreen({Key? key}) : super(key: key);
30+
3231
@override
33-
_DetailSearchScreenState createState() => _DetailSearchScreenState();
32+
State<DetailSearchScreen> createState() => _DetailSearchScreenState();
3433
}
3534

3635
class _DetailSearchScreenState extends State<DetailSearchScreen> {
37-
final TextEditingController _siteIdTextController =
38-
TextEditingController(text: "977B75943A9F01D561FF2073AE1D9353");
39-
final TextEditingController _languageTextController =
40-
TextEditingController(text: "en");
36+
final TextEditingController _siteIdTextController = TextEditingController(
37+
text: '977B75943A9F01D561FF2073AE1D9353',
38+
);
39+
final TextEditingController _languageTextController = TextEditingController(
40+
text: 'en',
41+
);
4142

4243
late DetailSearchRequest _request;
4344
late String _results;
4445
late SearchService _searchService;
4546

46-
final _formKey = GlobalKey<FormState>();
47+
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
4748

4849
@override
4950
void initState() {
5051
super.initState();
5152
initService();
52-
_results = "";
53+
_results = '';
5354
}
5455

5556
void initService() async {
56-
_searchService = await SearchService.create(HomeScreen.API_KEY);
57+
_searchService = await SearchService.create(HomeScreen.apiKey);
5758
}
5859

5960
void runSearch() async {
60-
_request = DetailSearchRequest(siteId: _siteIdTextController.text);
61+
_request = DetailSearchRequest(
62+
siteId: _siteIdTextController.text,
63+
);
6164
_request.language = _languageTextController.text;
6265
try {
6366
DetailSearchResponse response =
@@ -82,7 +85,7 @@ class _DetailSearchScreenState extends State<DetailSearchScreen> {
8285
body: SingleChildScrollView(
8386
child: Column(
8487
children: <Widget>[
85-
Container(
88+
SizedBox(
8689
child: Padding(
8790
padding: const EdgeInsets.only(left: 15, right: 15, top: 15),
8891
child: Form(
@@ -91,16 +94,15 @@ class _DetailSearchScreenState extends State<DetailSearchScreen> {
9194
mainAxisAlignment: MainAxisAlignment.spaceAround,
9295
children: <Widget>[
9396
CustomTextFormField(
94-
labelText: "Site ID",
97+
labelText: 'Site ID',
9598
controller: _siteIdTextController,
9699
),
97100
CustomTextFormField(
98-
labelText: "Language",
101+
labelText: 'Language',
99102
controller: _languageTextController,
100103
),
101104
CustomButton(
102-
key: Key(Keys.SEARCH_DETAIL),
103-
text: "Search",
105+
text: 'Search',
104106
onPressed: () {
105107
if (_formKey.currentState!.validate()) {
106108
runSearch();
@@ -112,11 +114,10 @@ class _DetailSearchScreenState extends State<DetailSearchScreen> {
112114
),
113115
),
114116
),
115-
Container(
116-
child: new Text(
117+
SizedBox(
118+
child: Text(
117119
_results,
118-
key: Key(Keys.RESULT_DETAIL),
119-
style: new TextStyle(
120+
style: const TextStyle(
120121
fontSize: 12.0,
121122
color: Colors.black,
122123
),

0 commit comments

Comments
 (0)