This Is The Description Of Our App
- Create a Gallery Viewer app that contains at
At least 10 images (5 from aet and 5 from
network - From the Start-up of an app, arrange all
image in a vertical manner as shown in UI
By pressing a button from AppBar, toggle
vertical arrange image in horizontal
manner - Prove e proper width-wise fitting of all image
while showing in horizontal mo e
Note: Buil a Dynamic UI from the given image List.
This Is A Source Code Of Gallery Viewer App Our App
import 'package:flutter/material.dart';void main() { runApp( const MaterialApp( debugShowCheckedModeBanner: false, home: App(), ), );}class App extends StatefulWidget { const App({Key? key}) : super(key: key); @override State<App> createState() => _AppState();}class _AppState extends State<App> { bool A = true; bool B = true; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( centerTitle: true, title: const Text( "GALLERY VIEWER", ), actions: [ InkWell( onTap: () { setState(() { if (B == true) { B = false; } else { B = true; } }); }, child: const Icon(Icons.apps_rounded), ), const SizedBox( width: 10, ), ], backgroundColor: Colors.black, ), body: (B) ? Padding( padding: const EdgeInsets.all(8.0), child: SingleChildScrollView( physics: const BouncingScrollPhysics(), child: Column( children: [ Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis1.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis2.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis3.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis4.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis5.jpg"), ), Container( margin: const EdgeInsets.all(5), child: Image.asset("assets/image/pis6.jpg"), ), ], ), ), ) : Padding( padding: const EdgeInsets.all(8.0), child: SingleChildScrollView( scrollDirection: Axis.horizontal, physics: const BouncingScrollPhysics(), child: Row( children: [ Container( margin: const EdgeInsets.all(5), child: Image.asset( "assets/image/pis.jpg",fit: BoxFit.fill, height: MediaQuery.of(context).size.height, ), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset("assets/image/pis1.jpg",fit: BoxFit.fill,), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset( "assets/image/pis2.jpg",fit: BoxFit.fill, ), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset("assets/image/pis3.jpg",fit: BoxFit.fill), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset("assets/image/pis4.jpg",fit: BoxFit.fill), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset("assets/image/pis5.jpg",fit: BoxFit.fill), ), Container( margin: const EdgeInsets.all(5), height: MediaQuery.of(context).size.height, child: Image.asset("assets/image/pis6.jpg",fit: BoxFit.fill), ), ], ), ), ), ); }}