Created
July 2, 2021 06:45
-
-
Save benqy/7f244b1fef723d91c22b43f339c15385 to your computer and use it in GitHub Desktop.
wechat_assets_picker sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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