Skip to content

Instantly share code, notes, and snippets.

@anta40
Created March 7, 2020 05:59
Show Gist options
  • Save anta40/02a334baa63b0118ee93522095572b54 to your computer and use it in GitHub Desktop.
Save anta40/02a334baa63b0118ee93522095572b54 to your computer and use it in GitHub Desktop.
import 'dart:io';
import 'package:flutter/material.dart';
class MyHttpOverrides extends HttpOverrides{
@override
HttpClient createHttpClient(SecurityContext context){
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
}
}
void main() {
HttpOverrides.global = new MyHttpOverrides();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
var title = 'Load Image Demo';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Image.network(
'https://www.atrbpn.go.id/portals/0/assets/banners/Bahan%20Web%20Mafia%20Tanah-01.jpg'
//https://downbeat.com/images/news/_full/Web_Frank_Gambale_credit_Bob_Rose%2C_Official_Festival_Photographer.jpg'
// 'https://cdn2-www.cattime.com/assets/uploads/2011/12/file_2680_Maine-Coon-Cat-breed.jpg'
),
),
);
}
}
@insanbiasa
Copy link

terima masih Pak,,,
untuk mengimplemantasikan ke dalam sinin bgmn ya Pak?

class _AkunState extends State {
CarouselSlider carouselSlider;
int _current = 0;
List imgList = [
'https://images.unsplash.com/photo-1502943693086-33b5b1cfdf2f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80',
'https://www.atrbpn.go.id/portals/0/assets/banners/Bahan%20Web%20Mafia%20Tanah-01.jpg',
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment