Skip to content

Instantly share code, notes, and snippets.

@dander11
dander11 / main.dart
Last active February 22, 2024 20:11
grid with fade
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
class NavigationItem {
final String url;
final String label;
final List<NavigationItem> children;
NavigationItem({
required this.url,
required this.children,
required this.label,
});
class NavigationItem {
final String url;
final String label;
final List<NavigationItem> children;
NavigationItem(
{required this.url, required this.children, required this.label});
@override
String toString() {
@dander11
dander11 / main.dart
Created May 11, 2023 20:42
illustrious-marble-0069
class NavigationItem {
final String url;
final String label;
final List<NavigationItem> children;
NavigationItem(
{required this.url, required this.children, required this.label});
@override
String toString() {
@dander11
dander11 / main.dart
Last active September 9, 2022 19:31
import 'dart:convert';
void printToString(Object ex ){
print(ex.toString());
}
class MyCustomExceptionObject {
class InheritedBlocs extends InheritedWidget {
InheritedBlocs(
{Key key,
this.searchBloc,
this.child})
: super(key: key, child: child);
final Widget child;
final SearchBloc searchBloc;
class CustomSearchDelegate extends SearchDelegate {
@override
ThemeData appBarTheme(BuildContext context) {
assert(context != null);
final ThemeData theme = Theme.of(context);
assert(theme != null);
return theme;
}
class CustomSearchDelegate extends SearchDelegate {
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = '';
},
),
@dander11
dander11 / CustomSearchDelegate init
Created December 30, 2018 19:55
CustomSearchDelegate init
class CustomSearchDelegate extends SearchDelegate {
@override
List<Widget> buildActions(BuildContext context) {
// TODO: implement buildActions
return null;
}
@override
Widget buildLeading(BuildContext context) {
// TODO: implement buildLeading
@dander11
dander11 / SliverAppBar
Last active December 30, 2018 19:55
Implementing search in Flutter
SliverAppBar(
floating: true,
snap: true,
title: Text("Search App"),
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
onPressed: () {
showSearch(
context: context,