Skip to content

Instantly share code, notes, and snippets.

View zmtzawqlp's full-sized avatar
:octocat:

法的空间 zmtzawqlp

:octocat:
View GitHub Profile
@zmtzawqlp
zmtzawqlp / text.dart
Created August 13, 2021 05:50
文本扩展
/*
* @Author: zmtzawqlp
* @Date: 2020-01-07 15:26:54
* @Last Modified by: zmtzawqlp
* @Last Modified time: 2020-04-07 15:38:18
*/
import 'package:flutter/widgets.dart';
/// Widget相关扩展
@zmtzawqlp
zmtzawqlp / ensureVisible.dart
Created August 13, 2021 03:08
ensureVisible 演示
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override
@zmtzawqlp
zmtzawqlp / hittest.dart
Created August 13, 2021 03:06
增大点击区域
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@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(),
);
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
home: MyHomePage(),
);
@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',
@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 / 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 / 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();
}