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_test/flutter_test.dart'; | |
import 'package:mocktail_image_network/mocktail_image_network.dart'; | |
testWidgets( | |
'renders an image with the provided image url', | |
(tester) async { | |
const expectedImageUrl = 'media.giphy.com/example.jpg'; | |
await mockNetworkImages(() async { | |
await tester.pumpWidget(app); // your app is a widget that contains your network image | |
/** You should also wrap your NetworkImage or Image.network with a DecoratedBox or other widget as the parent, |
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:firebase_messaging/firebase_messaging.dart'; | |
class PushNotificationService { | |
final FirebaseMessaging _fcm; | |
PushNotificationService(this._fcm); | |
Future initialise() async { | |
if (Platform.isIOS) { | |
_fcm.requestNotificationPermissions(IosNotificationSettings()); |
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 MyApp extends StatelessWidget { | |
static final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); | |
Widget build(BuildContext context) { | |
final pushNotificationService = PushNotificationService(_firebaseMessaging); | |
pushNotificationService.initialise(); | |
// the rest of your build method | |
} | |
} |
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:google_places_flutter/address_search.dart'; | |
import 'package:google_places_flutter/place_service.dart'; | |
import 'package:uuid/uuid.dart'; | |
void main() { | |
runApp(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 'dart:convert'; | |
import 'dart:io'; | |
import 'package:http/http.dart'; | |
class Place { | |
String streetNumber; | |
String street; | |
String city; | |
String zipCode; |
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:google_places_flutter/address_search.dart'; | |
import 'package:google_places_flutter/place_service.dart'; | |
import 'package:uuid/uuid.dart'; | |
void main() { | |
runApp(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 'dart:convert'; | |
import 'dart:io'; | |
import 'package:http/http.dart'; | |
// For storing our result | |
class Suggestion { | |
final String placeId; | |
final String description; |
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 AddressSearch extends SearchDelegate<Suggestion> { | |
@override | |
List<Widget> buildActions(BuildContext context) { | |
return [ | |
IconButton( | |
tooltip: 'Clear', | |
icon: Icon(Icons.clear), | |
onPressed: () { |
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:google_places_flutter/address_search.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@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(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
NewerOlder