Skip to content
Snippets Groups Projects
Commit 03fab4fd authored by Anager's avatar Anager
Browse files

image slides work

parent 1f61c20d
No related branches found
No related tags found
No related merge requests found
assets/degg.png

158 KiB

assets/deggwappen.png

38.6 KiB

import 'package:flutter/material.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/event/imageslides.dart';
class BarWidget extends StatefulWidget {
const BarWidget({Key? key,
required this.barName}) : super(key: key);
final String barName;
@override
State<BarWidget> createState() => _BarWidgetState();
}
class _BarWidgetState extends State<BarWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
"Bar: ${widget.barName}", style: TextStyle(fontSize: 20, color: Colors.white),
),
),
body: Padding(
padding: EdgeInsets.all(20),
child: Column(
children: [
ImageSlides(),
],
)
),
);
}
}
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
class ImageSlides extends StatefulWidget {
const ImageSlides({Key? key}) : super(key: key);
@override
State<ImageSlides> createState() => _ImageSlidesState();
}
class _ImageSlidesState extends State<ImageSlides> {
final List<String> hrefList = [
"https://www.brunner-hof.de/wAssets/img/bayerischer-wald/staedtereisen/deggendorf/4-zu-3/DEG-Luitpoldplatz-neu.jpg",
"https://imgs.search.brave.com/UaQJQq8IFdqgaRMf9d3QfX_VLrVR2N3rpaXlbIPQKBE/rs:fit:1200:1175:1/g:ce/aHR0cHM6Ly9kZWdn/ZW5kb3JmLnRyYXZl/bC9tZWRpYS9kZWdn/ZW5kb3JmLXRyYXZl/bC1zdGFkdGZ1ZWhy/dW5nLW1pdC1tdXNl/dW0uanBn",
"https://imgs.search.brave.com/PtWgLI_rVxR-TrRrX5UnK7YsxRblWOCmTg1t1AulsqU/rs:fit:1200:908:1/g:ce/aHR0cHM6Ly9kZWdn/ZW5kb3JmLnRyYXZl/bC9tZWRpYS9kZWdn/ZW5kb3JmLXRyYXZl/bC1zdGFkdGZ1ZWhy/dW5nLXBhbm9yYW1h/LXJ1bmRmYWhydC5q/cGVn",
"https://imgs.search.brave.com/XrtSLROJB85b4abN9IGzVRSbt2fk1UaTWu92yKBEA0M/rs:fit:1200:1127:1/g:ce/aHR0cHM6Ly93d3cu/ZGVnZ2VuZG9yZi5k/ZS9tZWRpYS9kZWdn/ZW5kb3JmLXJpZXNl/bnJhZC1nZXdpbm5z/cGllbC1nZXdpbm5l/cmZvdG9zLTEuanBn",
];
final List<String> assetsImages = [
"assets/defaultProfilePicture.png",
"assets/degg.png",
"assets/deggwappen.png"
];
@override
Widget build(BuildContext context) {
return
CarouselSlider(
options: CarouselOptions(height: 230.0),
items: assetsImages.map((item) =>
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
//child: Image.network(item, fit: BoxFit.cover, width: 1000,)
child: Image.asset(item),
)
).toList()
);
}
}
// options: CarouselOptions(
// height: 180.0,
// enlargeCenterPage: true,
// autoPlay: true,
// aspectRatio: 16 / 9,
// autoPlayCurve: Curves.fastOutSlowIn,
// enableInfiniteScroll: true,
// autoPlayAnimationDuration: Duration(milliseconds: 8000),
// viewportFraction: 0.8,
\ No newline at end of file
...@@ -5,6 +5,7 @@ import 'bottom_navigation_bar_buttons/forum/forum.dart'; ...@@ -5,6 +5,7 @@ import 'bottom_navigation_bar_buttons/forum/forum.dart';
import 'bottom_navigation_bar_buttons/profile/profile.dart'; import 'bottom_navigation_bar_buttons/profile/profile.dart';
import 'bottom_navigation_bar_buttons/profile/profile.dart'; import 'bottom_navigation_bar_buttons/profile/profile.dart';
import 'bottom_navigation_bar_buttons/home_page/weather/current_weather.dart'; import 'bottom_navigation_bar_buttons/home_page/weather/current_weather.dart';
import 'bottom_navigation_bar_buttons/event/barwidget.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
...@@ -48,7 +49,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -48,7 +49,7 @@ class _MyHomePageState extends State<MyHomePage> {
//Index: 0 //Index: 0
HomePage(), HomePage(),
//Index: 1, //Index: 1,
SecondRoute(), BarWidget(barName: "Erster International"),
//Index: 2, //Index: 2,
Forum(), Forum(),
//Index: 3 //Index: 3
......
...@@ -15,6 +15,13 @@ packages: ...@@ -15,6 +15,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
carousel_slider:
dependency: "direct main"
description:
name: carousel_slider
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
......
...@@ -38,6 +38,7 @@ dependencies: ...@@ -38,6 +38,7 @@ dependencies:
http: ^0.13.4 http: ^0.13.4
flutter_settings_screens: ^0.2.2+1 flutter_settings_screens: ^0.2.2+1
shared_preferences: ^2.0.13 shared_preferences: ^2.0.13
carousel_slider: ^4.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment