Skip to content

Instantly share code, notes, and snippets.

View RedBrogdon's full-sized avatar
💭
Flutterin'.

Andrew Brogdon RedBrogdon

💭
Flutterin'.
View GitHub Profile
@RedBrogdon
RedBrogdon / main.dart
Created June 26, 2023 20:59
mellow-illusion-3502
import 'package:flutter/material.dart';
//Import the font package
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@RedBrogdon
RedBrogdon / main.dart
Last active February 5, 2021 17:39 — forked from legalcodes/main.dart
Image class
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
class MyClass {
int? anInt;
}
class MyOtherClass extends MyClass {
int count = 0;
int? get anInt {
count++;
return count % 2 == 1 ? 1 : null;
abstract class C {
abstract int x1;
abstract var y1;
abstract final z;
abstract final int u1;
abstract covariant int v1;
abstract covariant var w;
}
class D extends C {
@RedBrogdon
RedBrogdon / main.dart
Last active March 2, 2021 19:14
Sunflower example (null safe)
// Copyright 2019 the Dart project 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';
final Color primaryColor = Colors.orange;
final TargetPlatform platform = TargetPlatform.android;
@RedBrogdon
RedBrogdon / main.dart
Last active October 23, 2020 04:03
Implicit animations (null safe)
import 'package:flutter/material.dart';
import 'dart:math';
class DiscData {
static final _rng = Random();
late final double size;
late final Color color;
late final Alignment alignment;
@RedBrogdon
RedBrogdon / main.dart
Created October 21, 2020 01:02
Draggable animation (null safe)
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: PhysicsCardDragDemo(),
),
);
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
static const data = ['One', 'Two', 'Three', 'Four', 'Five', 'Six'];
@override
@RedBrogdon
RedBrogdon / main.dart
Last active October 22, 2020 00:45
Some null-safe Flutter code
// 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
@RedBrogdon
RedBrogdon / main.dart
Created June 26, 2020 17:25
Timekeeper
import 'dart:async';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
home: MyApp(),
),
);