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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
// This widget is the root of your application. |
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'; | |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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:go_router/go_router.dart'; | |
import 'package:provider/provider.dart'; | |
class LoginInfo extends ChangeNotifier { | |
String get userName => _userName; | |
String _userName = ''; | |
bool get loggedIn => _userName.isNotEmpty; |
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:go_router/go_router.dart'; | |
final GlobalKey<NavigatorState> _rootNavKey = GlobalKey<NavigatorState>(); | |
final GlobalKey<NavigatorState> _shellNavKey = GlobalKey<NavigatorState>(); | |
void main() { | |
runApp(ShellRouteExampleApp()); | |
} |
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:go_router/go_router.dart'; | |
class Account { | |
const Account({required this.id, required this.transactions}); | |
final String id; | |
final List<Transaction> transactions; | |
} |
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(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
static const String _title = 'Flutter Code Sample'; | |
@override |
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(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
static const String _title = 'Flutter Code Sample'; | |
@override |
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
boolean isValid(Date date1, Date date2) { | |
Timestamp timestamp1 = new Timestamp(date1.getTime()); | |
Timestamp timestamp2 = new Timestamp(date2.getTime()); | |
long milliseconds = timestamp2.getTime() - timestamp1.getTime(); | |
int seconds = (int) milliseconds / 1000; | |
int hours = seconds / 3600; | |
int minutes = (seconds % 3600) / 60; | |
seconds = (seconds % 3600) % 60; |
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 PermissionDemoFragment : BaseFragment<PermissionFragmentBinding>(),PermissionCallback { | |
private lateinit var permissionObserver: PermissionObserver | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
permissionObserver = | |
PermissionObserver( | |
requireActivity(), |
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
public static void main(String[] args) { | |
System.out.println(parseEmoticons("How is it going? :) You are almost done :-)!")); | |
} | |
public static List<InlinedEmoticon> parseEmoticons(String text) { | |
if (text == null || text.length() == 0) { | |
return new ArrayList<>(); | |
} | |
Map<String, Integer> map = new TreeMap<>(); | |
map.put(":)", 1); |
NewerOlder