This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
class GlassMorphism extends StatelessWidget { | |
final Widget child; | |
final double start; | |
final double end; | |
const GlassMorphism({ | |
Key? key, | |
required this.child, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// http://dartpad.dev/981a8d2145a9878dae2b52aebd9fae88 | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(App()); | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => const MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env swift | |
import Foundation | |
struct TerminationStatus: Error { | |
let code: Int32 | |
} | |
func run(_ command: Command) throws { | |
print(command.rendered.joined(separator: " ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main (){ | |
// In null-safe Dart, none of these can ever be null. | |
var i = 42; // Inferred to be int. | |
String name = getFileName(); // getFileName() should return string, never null. | |
final b = Foo(); // Inferred to be Foo. | |
// Nullable var declaration just needs an [?] after the type. | |
int? aNullableInt = null; | |
var x; // Inferred nullable | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: all_lint_rules.yaml | |
analyzer: | |
exclude: | |
- "**/*.g.dart" | |
- "**/*.freezed.dart" | |
# This is generated from the i18n vscode extension | |
- "**/i18n.dart" | |
strong-mode: | |
implicit-casts: false | |
implicit-dynamic: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"github.com/gin-gonic/gin" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'How to overlap SliverList on a SliverAppBar', | |
debugShowCheckedModeBanner: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
var databasesPath = await getDatabasesPath(); | |
var path = join(databasesPath, 'example.db'); | |
var database = await openDatabase(path, version: 1, onCreate: (db, version) async { | |
await db.execute('''CREATE TABLE MyTable ( | |
id INTEGER PRIMARY KEY, | |
name TEXT)'''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
//https://stackoverflow.com/a/53107519/10409567 | |
void main() async { | |
// load the shared preferences from disk before the app is started | |
WidgetsFlutterBinding.ensureInitialized(); | |
final prefs = await SharedPreferences.getInstance(); | |
// create new theme controller, which will get the currently selected from shared preferences |
NewerOlder