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
class Home extends StatefulWidget { | |
const Home({super.key}); | |
@override | |
State<Home> createState() => _HomeState(); | |
} | |
class _HomeState extends State<Home> { | |
final pageController = PageController(viewportFraction: 0.8, initialPage: 1); | |
int currentIndex = 1; |
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'; | |
class AnimatedAppBar extends StatefulWidget { | |
final Widget? leading; | |
final String title; | |
final String bodyText; | |
final Widget body; | |
final Widget? floatingActionButton; | |
final RefreshCallback? onRefresh; |
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
const Map<String, String> customHeader = { | |
'content-type': 'application/json; charset=UTF-8' | |
}; | |
const Map<String, String> customHeader = { | |
'content-type': 'application/json; charset=UTF-8', | |
'Accept': 'application/json' | |
}; |
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
@Composable | |
fun FlowRow( | |
horizontalGap: Dp = 0.dp, | |
verticalGap: Dp = 0.dp, | |
alignment: Alignment.Horizontal = Alignment.Start, | |
content: @Composable () -> Unit, | |
) = Layout(content = content) { measurables, constraints -> | |
val horizontalGapPx = horizontalGap.toPx().roundToInt() | |
val verticalGapPx = verticalGap.toPx().roundToInt() |
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
class SearchAnchorDemo extends StatefulWidget { | |
const SearchAnchorDemo({super.key}); | |
@override | |
State<SearchAnchorDemo> createState() => _SearchAnchorDemoState(); | |
} | |
class _SearchAnchorDemoState extends State<SearchAnchorDemo> { | |
List<String> fruits = [ |
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/services.dart'; | |
class CustomRangeTextInputFormatter extends TextInputFormatter { | |
final double min; | |
final double max; | |
CustomRangeTextInputFormatter({required this.min, required this.max}); | |
@override | |
TextEditingValue formatEditUpdate( | |
TextEditingValue oldValue, |
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
class ScrollToTopWidgetWrapper extends StatefulWidget { | |
final Widget child; | |
const ScrollToTopWidgetWrapper({super.key, required this.child}); | |
@override | |
State<ScrollToTopWidgetWrapper> createState() => | |
_ScrollToTopWidgetWrapperState(); | |
} | |
class _ScrollToTopWidgetWrapperState extends State<ScrollToTopWidgetWrapper> { |
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 'dart:convert'; | |
import 'package:http/http.dart'; //Add http package to pubspec.yaml | |
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; //Add infinite_scroll_pagination package to pubspec.yaml | |
class HomePage extends StatefulWidget { | |
const HomePage({Key? key}) : super(key: key); | |
@override | |
State<HomePage> createState() => _HomePageState(); | |
} |
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
class Home extends StatefulWidget { | |
const Home({super.key}); | |
@override | |
State<Home> createState() => _HomeState(); | |
} | |
class _HomeState extends State<Home> { | |
@override |
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:page_transition/page_transition.dart'; | |
class HomeView extends StatefulWidget { | |
const HomeView({super.key}); | |
@override | |
State<HomeView> createState() => _HomeViewState(); | |
} |
NewerOlder