Skip to content

Instantly share code, notes, and snippets.

MaySnow MaySnow

Block or report user

Report or block MaySnow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MaySnow / dio_ singleton.dart
Last active Jul 22, 2019
#flutter dio封装,添加公用header,以及公用配置
View dio_ singleton.dart
import "package:dio/dio.dart";
import 'package:my_demo/utils/config.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
class HttpUtil {
static final HttpUtil _instance = HttpUtil._internal();
Dio _client;
FlutterSecureStorage _storage;
MaySnow / flutter_staggered_grid_view_image_fixed.dart
Created Jul 18, 2019
#flutter #image flutter_staggered_grid_view 初始加载,图片的宽高固定
View flutter_staggered_grid_view_image_fixed.dart
class _HomeTabState extends State<HomeTab> {
List<ImageList> _imgList = List<ImageList>();
ScrollController _scrollController = ScrollController();
bool isPerformingRequest = false;
void initState() {
MaySnow / shopCart.dart
Last active Dec 3, 2019
#flutter shop cart
View shopCart.dart
import 'package:flutter/material.dart';
// 购物车
class Product {
const Product({});
final String name;
typedef void CartChangedCallback(Product product, bool inCart);
class ShoppingListItem extends StatelessWidget {
MaySnow / infinite_dynamic_listview.dart
Last active Jul 17, 2019
#flutter infinite dynamic listview
View infinite_dynamic_listview.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
MaySnow / strLength.js
Last active Dec 29, 2015
View strLength.js
String.prototype.chinaLength = function() {
var result = this.match(/[\u0080-\uFFE5]/g);
if (result) {
return this.length + result.length;
return this.length;
MaySnow / gist:3889081
Created Oct 14, 2012
View gist:3889081
import javax.persistence.CascadeType;//注意jar包
MaySnow / gist:3864591
Created Oct 10, 2012
View gist:3864591
一个层 position: relative;
MaySnow / prover.js
Created Oct 10, 2012
View prover.js
MaySnow /
Created Oct 9, 2012
package com.kaishengit;
import java.util.Random;
import java.util.TimeZone;
import com.kaishengit.pojo.User;
import com.kaishengit.util.DateUtil;
import hirondelle.date4j.DateTime;
MaySnow / gson.js
Created Oct 9, 2012
gson 解析 javascript
View gson.js
var date = [{"name":"不错"},{"name":"全选"},{"name":"还好"},{"name":"你好"}]
for(var i = 0 ; i < date.length; i ++) {
You can’t perform that action at this time.