demo_images 0.0.2
demo_images: ^0.0.2 copied to clipboard
Give the list of asset image or network image it give you slider
example/lib/main.dart
import 'package:demo_images/demo_images.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// TRY THIS: Try running your application with "flutter run". You'll see
// the application has a purple toolbar. Then, without quitting the app,
// try changing the seedColor in the colorScheme below to Colors.green
// and then invoke "hot reload" (save your changes or press the "hot
// reload" button in a Flutter-supported IDE, or press "r" if you used
// the command line to start the app).
//
// Notice that the counter didn't reset back to zero; the application
// state is not lost during the reload. To reset the state, use hot
// restart instead.
//
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
List<String> imgUrls = [
"https://images.unsplash.com/photo-1552072092-7f9b8d63efcb",
"https://images.unsplash.com/flagged/photo-1574005280900-3ff489fa1f70",
"https://images.unsplash.com/photo-1591117207239-788bf8de6c3b",
"https://images.unsplash.com/photo-1606335543042-57c525922933",
"https://images.unsplash.com/photo-1555661530-68c8e98db4e6",
"https://images.unsplash.com/photo-1618517048289-4646902edaf5",
"https://images.unsplash.com/photo-1525680996651-0222228be6f0",
"https://images.unsplash.com/photo-1631132329534-0e7e1b94d494",
"https://images.unsplash.com/photo-1601588462477-e76b16de79f3"
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("demo screen"),
),
body: SizedBox(child: DemoImages(urls:imgUrls, height: 400,asset: false, ),),
);
}
}