Skip to content

Instantly share code, notes, and snippets.

View prof3ssorSt3v3's full-sized avatar
🎯
Focusing

Steve Griffith prof3ssorSt3v3

🎯
Focusing
View GitHub Profile
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created March 26, 2025 18:12
Flutter theme code from class 12.1
import 'package:flutter/material.dart';
import 'package:theming/components/mybutton.dart';
import 'package:theming/theme/theme.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Last active March 23, 2025 19:21
Flutter FocusNodes and TextFields
import 'package:flutter/material.dart';
class FocusTextFieldScreen extends StatefulWidget {
@override
_FocusTextFieldScreenState createState() => _FocusTextFieldScreenState();
}
class _FocusTextFieldScreenState extends State<FocusTextFieldScreen> {
FocusNode textField1FocusNode = FocusNode();
FocusNode textField2FocusNode = FocusNode();
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created March 22, 2025 00:19
Flutter example of setting colors with WidgetStatePropertyAll<Color> and WidgetStateColor.resolveWith
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created March 21, 2025 19:58
Flutter example setting styles for all three button types in the top level ThemeData
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Last active March 22, 2025 03:55
Flutter Example that builds a MaterialDesign 3 colorScheme from an image
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Last active March 21, 2025 19:09
Flutter example of a collapsing AppBar
import 'package:flutter/material.dart';
class CollapsingImageAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: 250.0, // Adjust this height as needed
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created March 20, 2025 15:23
Example of Nested Navigation in Flutter with named routes
import 'package:flutter/material.dart';
/// Flutter code sample for [Navigator].
void main() => runApp(const NavigatorExampleApp());
class NavigatorExampleApp extends StatelessWidget {
const NavigatorExampleApp({super.key});
@override
@prof3ssorSt3v3
prof3ssorSt3v3 / homepage.dart
Last active March 20, 2025 19:10
Starter Flutter Page
// lib/pages/homepage.dart
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
HomePage({super.key});
final TextStyle big = TextStyle(fontSize: 30);
@override
Widget build(BuildContext context) {
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Last active March 13, 2025 00:10
Six Flutter Layout Practice Exercise
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// function Component(){
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script>
class Blah extends HTMLElement {
constructor() {
super();