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 'dart:math'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class CircularProgressIndicator extends StatelessWidget { | |
final double percentage; | |
final double size; |
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 DottedBorder extends StatelessWidget { | |
final double strokeWidth; | |
final Color color; | |
final double dashLength; | |
final double dashGap; | |
final Shape shape; | |
final Widget 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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp 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 'dart:async'; | |
void main() async { | |
var stopWatch = Stopwatch(); | |
stopWatch.start(); | |
await Future.delayed(const Duration(seconds: 2), () {}); | |
stopWatch.stop(); |
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:async'; | |
void main() { | |
// Create a StreamController with integers | |
StreamController<int> streamController = StreamController<int>(); | |
// Create a stream from the controller | |
Stream<int> stream = streamController.stream; | |
// Add a listener to the stream |
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() { | |
// Assuming the current year is 2024 | |
int currentYear = 2024; | |
// Age input | |
int age = 4; | |
// Calculate birth year | |
int birthYear = currentYear - age; |
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( |
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( |
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() { | |
String path = "assets/images/abc.svg"; | |
String file = path.fileExtension(); | |
print("File extension: $file"); | |
} | |
extension StringExtension on String { | |
String fileExtension() { |
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
class ChatsModel { | |
int? id; | |
String? title; | |
String chatName; | |
String chatType; | |
String icon; | |
bool isPinned; | |
ChatsModel({this.id, this.title, required this.chatName, required this.chatType, required this.icon, required this.isPinned}); | |
} |
NewerOlder