Skip to content

Instantly share code, notes, and snippets.

View zmtzawqlp's full-sized avatar
:octocat:

法的空间 zmtzawqlp

:octocat:
View GitHub Profile
@zmtzawqlp
zmtzawqlp / MySliverAppBar.dart
Last active January 13, 2021 09:40
自定义SliverAppbar
import 'package:flutter/material.dart';
typedef OnMySliverAppBarScroll = void Function(double shrinkOffset);
///Sliver App bar
class MySliverAppBar extends StatefulWidget {
final Color backgroundColor;
final double expandedHeight;
@zmtzawqlp
zmtzawqlp / CustomScrollBehavior.dart
Created December 21, 2018 05:04
CustomScrollBehavior水波纹
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 / PullToRefreshHeader.dart
Created December 27, 2018 09:57
PullToRefreshHeader
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 / see_your_demo.dart
Last active January 19, 2019 15:01
see your widget
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();
}
@zmtzawqlp
zmtzawqlp / custom_scroll_app_bar.dart
Last active February 16, 2019 09:22
custom_scroll_app_bar
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(
@zmtzawqlp
zmtzawqlp / MyPopupMenuButton.dart
Created June 25, 2019 05:11
MyPopupMenuButton
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].
///
@zmtzawqlp
zmtzawqlp / float_scroll.dart
Created August 6, 2019 09:41
float_scroll
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',
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
home: MyHomePage(),
);
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@zmtzawqlp
zmtzawqlp / pull_down_refresh .dart
Created May 11, 2020 10:14
pull down refresh before
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: PullDownRefresh(),
);