(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import 'package:flutter/material.dart'; | |
| class ScrollToBottomController extends ScrollController { | |
| ScrollToBottomController({ | |
| @required Listenable listenable, | |
| double initialScrollOffset = 0.0, | |
| bool keepScrollOffset = true, | |
| String debugLabel, | |
| }) : _listenable = listenable, | |
| super( |
| import 'package:flutter/material.dart'; | |
| class PageMain extends StatefulWidget { | |
| @override | |
| _PageMainState createState() => _PageMainState(); | |
| } | |
| class _PageMainState extends State<PageMain> { | |
| CustomScrollController firstScroll = CustomScrollController(); | |
| CustomScrollController secondScrollController = CustomScrollController(); |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(App()); | |
| } | |
| class App extends StatefulWidget { | |
| @override | |
| State<App> createState() => _AppState(); | |
| } |
| 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; |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(new MyApp()); | |
| class MyApp extends StatefulWidget { | |
| @override | |
| _MyAppState createState() => new _MyAppState(); | |
| } | |
| class _MyAppState extends State<MyApp> with TickerProviderStateMixin { |
| import 'package:flutter/rendering.dart'; | |
| import 'package:flutter/widgets.dart'; | |
| import 'package:meta/meta.dart'; | |
| /// Signature for a function that creates a widget with the supplied [FocusNode]. | |
| typedef Widget EnsureVisibleBuilder(BuildContext context, FocusNode focusNode); | |
| /// A widget that ensures it is always visible inside its ancestor scrollable | |
| /// when focused. | |
| class EnsureVisible extends StatefulWidget { |
| // Copyright 2018 Simon Lightfoot. All rights reserved. | |
| // Use of this source code is governed by a MIT license that can be | |
| // found in the LICENSE file. | |
| import 'package:flutter/rendering.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:meta/meta.dart'; | |
| /// Animated Bottom Bar. |
| // Copyright 2017, the Flutter 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 'dart:async'; | |
| import 'package:meta/meta.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| /// A widget that ensures it is always visible when focused. |
| package be.brol | |
| import android.os.Binder | |
| import android.os.Bundle | |
| import android.support.v4.app.BundleCompat | |
| import android.support.v4.app.Fragment | |
| /** | |
| * Eases the Fragment.newInstance ceremony by marking the fragment's args with this delegate | |
| * Just write the property in newInstance and read it like any other property after the fragment has been created |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.