We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import 'package:flutter/material.dart'; void main() => runApp(RandomImg()); class RandomImg extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Random Images', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, ), home: HomeScreen(), ); } } class HomeScreen extends StatefulWidget { @override _HomeScreenState createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> { int counter = 0; var _imageurl = 'https://source.unsplash.com/random/'; Widget imageprovider() { return Image.network( _imageurl, fit: BoxFit.cover, height: double.infinity, width: double.infinity, ); } void _newImage() { setState(() { _imageurl = 'https://source.unsplash.com/random/$counter'; counter++; }); } @override Widget build(BuildContext context) { return Scaffold( body: Container( child: Center( child: GestureDetector( child: imageprovider(), onTap: _newImage, ), ), ), ); } }
The text was updated successfully, but these errors were encountered:
ariessa
No branches or pull requests
Problem
Description
Alternatives
Additional context
Possible Implementation
The text was updated successfully, but these errors were encountered: