Property/Callback | Description |
---|---|
onTapDown |
OnTapDown is fired everytime the user makes contact with the screen. |
onTapUp |
When the user stops touching the screen, onTapUp is called. |
onTap |
When the screen is briefly touched, onTap is triggered. |
onTapCancel |
When a user touches the screen but does not complete the Tap , this event is fired. |
onDoubleTap |
onDoubleTap is called when the screen is touched twice in quick succession. |
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'; | |
const kBreakpoint = 860.0; | |
extension Width on BuildContext { | |
double get width => MediaQuery.of(this).size.width; | |
} | |
void main() { | |
runApp( |
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() { | |
calculateDateInterval(DateTime(2020, 09, 22, 11, 00), DateTime(2020, 09, 22, 16, 00), 0.75); | |
} | |
void calculateDateInterval( | |
final DateTime startTime, | |
final DateTime endTime, | |
final double intervalInHours, | |
) { | |
final workingHours = endTime.difference(startTime).inHours; |
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:stream_chat_flutter/stream_chat_flutter.dart'; | |
import './responsive_builder.dart'; | |
// This sample uses GetStream for chat. To get started, please see https://getstream.io/chat/flutter/tutorial/ | |
Future<void> main() async { | |
final Client streamClient = Client("YOUR-STREAM-KEY", persistenceEnabled: false); | |
await streamClient.setUser( | |
User( |
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_web/material.dart'; | |
class ResponsiveLayout extends StatelessWidget { | |
const ResponsiveLayout({ | |
Key key, | |
@required this.largeChild, | |
this.mediumChild, | |
this.smallChild, | |
this.largeBreakPoint = 1200.0, | |
this.mediumBreakPoint = 800.0, |
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:flutter/rendering.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( |
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(TexColDemo()); | |
} | |
class TexColDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return 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
import 'package:flutter/material.dart'; | |
class ItemTextStyle { | |
const ItemTextStyle({ | |
@required this.initialStyle, | |
@required this.animatedStyle, | |
}); | |
final TextStyle initialStyle; | |
final TextStyle animatedStyle; |
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/cupertino.dart' show CupertinoPageRoute; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: HomePage(), | |
), | |
); | |
} |
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:cached_network_image/cached_network_image.dart'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/painting.dart'; | |
void main() { | |
runApp(const App()); | |
} |