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'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@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 'dart:math' as math; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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:flutter/material.dart'; | |
import 'dart:math' as math; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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'; | |
void main() { | |
runApp(DentAnimationWidget()); | |
} | |
class DentAnimationWidget extends StatefulWidget { | |
@override | |
_DentAnimationWidgetState createState() => _DentAnimationWidgetState(); | |
} |
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'; | |
// Bad Example: Violating Open-Closed Principle | |
class BadButton extends StatelessWidget { | |
final String type; | |
final String label; | |
final VoidCallback onPressed; | |
BadButton({ | |
required this.type, |
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'; | |
// Bad Example: A widget that does too much | |
class BadSocialMediaPostWidget extends StatelessWidget { | |
final String username; | |
final String postContent; | |
final String imageUrl; | |
final int likes; | |
final List<String> comments; |
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
When Edison had been an unknown inventor who specialized in the | |
telegraphic equipment business, reporters had not sought him out and begged | |
him for an opportunity to become his friend. Now, however, in early May 1878, | |
sycophantic journalists led him to believe that he was wise in all manner of | |
subjects, far afield of the electrical business. If they wished to listen to his | |
opinions, and they did indeed, he was glad to hold forth on any topic, such as the | |
relationship of diet to national destiny, a lecture delivered over lunch while | |
digging into strawberry shortcake, strawberries and cream, and an apple | |
dumpling. |
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
public void onMapReady(GoogleMap googleMap) { | |
map.clear(); | |
map = googleMap; | |
LatLng hcmus = new LatLng(Double.parseDouble(latitude1), Double.parseDouble(longitude1)); | |
map.moveCamera(CameraUpdateFactory.newLatLngZoom(hcmus, 10)); | |
originMarkers.add(map.addMarker(new MarkerOptions() | |
.title(mStudentObject.getAddress()) | |
.position(hcmus))); | |
LatLng startMarker=new LatLng(Double.parseDouble(latitude1),Double.parseDouble(longitude1)); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/content_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" |
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
public class BezInterpolator { | |
private static BezInterpolator bezInterpolator; | |
//Control points to create the cubic bezier curve. | |
private float[] PRINCIPLE_DEFAULT_EASE = {(float)0.25, (float)0.1, (float)0.25, (float)1.0}; | |
private float[] EASE_OUT = {(float)0, (float)0, (float)0.58, (float)1.0}; | |
private float[] EASE_IN = {(float)0.42, (float)0, (float)1.0, (float)1.0}; | |
public static BezInterpolator getInstance(){ |
NewerOlder