Skip to content

Instantly share code, notes, and snippets.

View gspencergoog's full-sized avatar

Greg Spencer gspencergoog

View GitHub Profile
@gspencergoog
gspencergoog / main.dart
Created January 24, 2023 20:38
FocusableActionDetector Example
// Copyright 2014 The Flutter Authors. 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(const MainApp());
}
@gspencergoog
gspencergoog / main.dart
Created January 24, 2023 20:32
LayoutBuilder Example
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Flutter code sample for [LayoutBuilder].
import 'package:flutter/material.dart';
void main() => runApp(const LayoutBuilderExample());
@gspencergoog
gspencergoog / main.dart
Created January 24, 2023 20:31
AnimatedBuilder Example
// Copyright 2014 The Flutter Authors. 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(const AnimatedBuilderExample());
/// This widget listens for changes in the focus state of the subtree defined by
/// its [child] widget, changing the border and color of the container it is in
@gspencergoog
gspencergoog / main.dart
Created December 6, 2022 18:12
StarBorder counter example
// StarBorder counter example.
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
brightness: Brightness.dark,
@gspencergoog
gspencergoog / main.dart
Created November 17, 2022 18:15
2D Scrolling Test
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@gspencergoog
gspencergoog / main.dart
Last active October 6, 2022 22:16
counter example
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
void main() {
runApp(
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Flutter code sample for [MenuBar]
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
const String kMessage = '"Talk less. Smile more." - A. Burr';
@gspencergoog
gspencergoog / main.dart
Created August 11, 2022 22:24
Clipping Problem
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: Scaffold(
body: Sample(
children: <Widget>[
MyWidget(),
MyWidget(),
@gspencergoog
gspencergoog / main.dart
Last active August 10, 2022 16:11
Layout Problem
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: Sample(
children: <Widget>[
ElevatedButton(
onPressed: () {},
child: const Text('Button 1'),
@gspencergoog
gspencergoog / main.dart
Last active July 22, 2022 22:57
Star Border Example
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math' as math;
import 'dart:ui' as ui show lerpDouble;
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';