Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

zmtzawqlp

:octocat:
View GitHub Profile
@zmtzawqlp
zmtzawqlp / pull_down_refresh .dart
Created May 11, 2020
pull down refresh before
View pull_down_refresh .dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: PullDownRefresh(),
);
View demo.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View paintingStyle_stroke_web.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
home: MyHomePage(),
);
View float_scroll.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
View MyPopupMenuButton.dart
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
///弹出下拉框
class MyPopupMenuItem<T> extends MyPopupMenuEntry<T> {
/// Creates an item for a popup menu.
///
/// By default, the item is [enabled].
///
View custom_scroll_app_bar.dart
import 'package:flutter/material.dart';
import 'dart:math';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
View see_your_demo.dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() => new MyAppState();
}
View PullToRefreshHeader.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh_notification/pull_to_refresh_notification.dart';
class PullToRefreshHeader extends StatefulWidget {
@override
_PullToRefreshHeaderState createState() => _PullToRefreshHeaderState();
}
@zmtzawqlp
zmtzawqlp / CustomScrollBehavior.dart
Created Dec 21, 2018
CustomScrollBehavior水波纹
View CustomScrollBehavior.dart
import 'package:flutter/material.dart';
class CustomScrollBehavior extends ScrollBehavior {
@override
Widget buildViewportChrome(
BuildContext context, Widget child, AxisDirection axisDirection) {
// TODO: implement buildViewportChrome
switch (getPlatform(context)) {
case TargetPlatform.iOS:
return child;
@zmtzawqlp
zmtzawqlp / MySliverAppBar.dart
Last active Jan 13, 2021
自定义SliverAppbar
View MySliverAppBar.dart
import 'package:flutter/material.dart';
typedef OnMySliverAppBarScroll = void Function(double shrinkOffset);
///Sliver App bar
class MySliverAppBar extends StatefulWidget {
final Color backgroundColor;
final double expandedHeight;