agconnect_core 1.1.0+200 copy "agconnect_core: ^1.1.0+200" to clipboard
agconnect_core: ^1.1.0+200 copied to clipboard

outdated

Flutter plugin for AppGallery Connect Core SDK.

example/lib/main.dart

/*
 * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:agconnect_core/agconnect_core.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  _setApiKey() async {
    await AGCApp.instance.setApiKey('my_api_key');
  }

  _setClientId() async {
    await AGCApp.instance.setClientId('my_client_id');
  }

  _setClientSecret() async {
    await AGCApp.instance.setClientSecret('my_client_secret');
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ListView(children: <Widget>[
            CupertinoButton(child: Text('setApiKey'), onPressed: _setApiKey),
            CupertinoButton(child: Text('setClientId'), onPressed: _setClientId),
            CupertinoButton(child: Text('setClientSecret'), onPressed: _setClientSecret),
          ]),
        ),
      ),
    );
  }
}
2
likes
0
pub points
87%
popularity

Publisher

unverified uploader

Flutter plugin for AppGallery Connect Core SDK.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on agconnect_core