This file contains hidden or 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
| // MIT License | |
| // | |
| // Copyright (c) 2023 Simon Lightfoot | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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:flutter/widgets.dart'; | |
| import 'package:vector_math/vector_math_64.dart' show radians; | |
| void main() => runApp(ExampleApp()); | |
| class ExampleItem { | |
| static const Pineapples = ExampleItem._('Pineapples'); | |
| static const Watermelons = ExampleItem._('Watermelons'); | |
| static const StarFruit = ExampleItem._('Star Fruit'); |
This file contains hidden or 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 Foundation | |
| import UIKit | |
| struct ViewStyle<T> { | |
| let style: (T) -> Void | |
| } | |
| let filled = ViewStyle<UIButton> { | |
| $0.setTitleColor(.white, for: .normal) | |
| $0.backgroundColor = .red |
This file contains hidden or 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:flutter/services.dart'; | |
| import 'dart:math'; | |
| const CURVE_HEIGHT = 160.0; | |
| const AVATAR_RADIUS = CURVE_HEIGHT * 0.28; | |
| const AVATAR_DIAMETER = AVATAR_RADIUS * 2; | |
| void main() => runApp(new MyApp()); |
This file contains hidden or 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/widgets.dart"; | |
| import "dart:math"; | |
| class SnappingListView extends StatefulWidget { | |
| final Axis scrollDirection; | |
| final ScrollController controller; | |
| final IndexedWidgetBuilder itemBuilder; | |
| final List<Widget> children; | |
| final int itemCount; |
This file contains hidden or 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 'dart:math' as math; | |
| import 'dart:async'; | |
| void main() => runApp(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or 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
| // Copyright 2015 The Chromium 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:async'; | |
| import 'dart:ui'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/widgets.dart'; |
This file contains hidden or 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 'dart:async'; | |
| void main() => runApp(new BackButtonOverrideDemoWidget()); | |
| class BackButtonOverrideDemoWidget extends StatefulWidget{ | |
| @override | |
| _BackButtonOverrideDemoWidgetState createState() => new _BackButtonOverrideDemoWidgetState(); | |
| } |
This file contains hidden or 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 'dart:ui' as ui; | |
| import 'package:flutter/services.dart' show rootBundle; | |
| import 'dart:async'; | |
| import 'dart:typed_data'; | |
| void main() => runApp(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. |
This file contains hidden or 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 Reachability | |
| import CoreTelephony | |
| enum NetworkType { | |
| case unknown | |
| case noConnection | |
| case wifi | |
| case wwan2g | |
| case wwan3g | |
| case wwan4g |