Create a Gallery Viewer app in Flutter

Spread the love

This Is The Description Of Our App

  1. Create a Gallery Viewer app that contains at
    At least 10 images (5 from aet and 5 from
  2. 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
  3. 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:,      ),      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),                    ),                  ],                ),              ),            ),    );  }}

Related Posts


how to print fibonacci serics in turbo c++

Spread the love

fibonacci serics


Online furniture order app in a flutter. dynamic UI in a flutter.

Spread the love

Spread the lovemain.dart file

flutter ui

Create Simple Smiley UI Using Flutter…

Spread the love

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *