Skip to content

Instantly share code, notes, and snippets.

View AlexV525's full-sized avatar
🌍
typedef Day = 🛏 || 🖥

Alex Li AlexV525

🌍
typedef Day = 🛏 || 🖥
  • China, Shanghai
  • 09:22 (UTC +08:00)
  • X @AlexV525
View GitHub Profile
@AlexV525
AlexV525 / main.dart
Created April 2, 2020 12:42
Why no error with static varibale?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@AlexV525
AlexV525 / main.dart
Created April 17, 2020 09:18
Flutter IntrinsicHeight demo.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@AlexV525
AlexV525 / main.dart
Created April 24, 2020 04:00
CustomController through StatefulWidget to get State.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
final CustomController controller = CustomController();
@AlexV525
AlexV525 / main.dart
Created April 28, 2020 03:47
Flutter Hero Text Example.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@AlexV525
AlexV525 / dots_indicator.dart
Created May 8, 2020 07:25
Dots Indicator for page switching.
import 'dart:math' as math;
import 'package:flutter/material.dart';
///
/// An indicator showing the currently selected page of a PageController.
///
class DotsIndicator extends AnimatedWidget {
const DotsIndicator({
@required this.controller,
@AlexV525
AlexV525 / main.dart
Created May 14, 2020 02:35
Will page build between push and pop?
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@AlexV525
AlexV525 / clipboard.dart
Created July 2, 2020 06:06 — forked from bergwerf/clipboard.dart
Copy to web clipboard in Flutter For the Web
/// A hack to copy a string to the clipboard.
bool _copyToClipboardHack(String text) {
final textarea = new TextAreaElement();
document.body.append(textarea);
textarea.style.border = '0';
textarea.style.margin = '0';
textarea.style.padding = '0';
textarea.style.opacity = '0';
textarea.style.position = 'absolute';
textarea.readOnly = true;
@AlexV525
AlexV525 / main.dart
Created July 6, 2020 07:53
Two steps widget loader
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@AlexV525
AlexV525 / CFUG-CLA.md
Last active July 11, 2020 05:42
CFUG Documentation Individual Contributor License Agreement

CFUG Documentation Individual Contributor License Agreement

Flutter 中国用户组文档个人贡献者许可协议

Thank you for your interest in contributing documentation and related software code to a project hosted or managed by Chinese Flutter User Group, or any of its affiliates ("CFUG"). In order to clarify the intellectual property license granted with Contributions from any person or entity, CFUG must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This version of the Contributor License Agreement allows an individual to submit Contributions to the applicable project. If you are making a submission on behalf of a legal entity, then you should sign the separation Corporate Contributor License Agreement. If you have not already done so, please complete and sign, then scan and email a pdf file of this Agreement to [[CFUG Dev]][Mail to CFUG Dev]. Please read this document carefully before signing and keep a copy for your records

@AlexV525
AlexV525 / main.dart
Created August 11, 2020 02:01
Interactive simple demo from flutter-go
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final TransformationController _transformationController = TransformationController();
@override