Skip to content

Instantly share code, notes, and snippets.

@benqy
Created July 2, 2021 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benqy/7f244b1fef723d91c22b43f339c15385 to your computer and use it in GitHub Desktop.
Save benqy/7f244b1fef723d91c22b43f339c15385 to your computer and use it in GitHub Desktop.
wechat_assets_picker sample
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: TestWidget(),
),
);
}
}
class TestWidget extends StatefulWidget {
TestWidget({Key? key}) : super(key: key);
@override
_TestWidgetState createState() => _TestWidgetState();
}
class _TestWidgetState extends State<TestWidget> {
@override
Widget build(BuildContext context) {
return GestureDetector(
child: Center(
child: Container(height: 1000, width: 100, color: Colors.pink, child: Text('点我')),
),
onTap: () {
AssetPicker.pickAssets(
context,
specialPickerType: SpecialPickerType.wechatMoment,
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment