diff --git a/assets/degg.png b/assets/degg.png new file mode 100644 index 0000000000000000000000000000000000000000..8dc82e10184b23ab3d718a92469dc519bb575b6e Binary files /dev/null and b/assets/degg.png differ diff --git a/assets/deggwappen.png b/assets/deggwappen.png new file mode 100644 index 0000000000000000000000000000000000000000..ed259bd4cf5fe3745c094d6fd585a1ea2edb083a Binary files /dev/null and b/assets/deggwappen.png differ diff --git a/lib/bottom_navigation_bar_buttons/event/barwidget.dart b/lib/bottom_navigation_bar_buttons/event/barwidget.dart new file mode 100644 index 0000000000000000000000000000000000000000..e239fd2a3fc32b47fcb280405b4861e316a1b20a --- /dev/null +++ b/lib/bottom_navigation_bar_buttons/event/barwidget.dart @@ -0,0 +1,37 @@ +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(), + ], + ) + ), + ); + } +} + + + diff --git a/lib/bottom_navigation_bar_buttons/event/imageslides.dart b/lib/bottom_navigation_bar_buttons/event/imageslides.dart new file mode 100644 index 0000000000000000000000000000000000000000..74d74ed71c96a3e0b88c938bdd65b934b8c9ff9c --- /dev/null +++ b/lib/bottom_navigation_bar_buttons/event/imageslides.dart @@ -0,0 +1,54 @@ + +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 diff --git a/lib/main.dart b/lib/main.dart index f71cbdd2715dd89d544e4e0887ada7cdaa1febea..4e04947f2bda8a3bd4d03f8c7e8cf25fe0a9dffe 100644 --- a/lib/main.dart +++ b/lib/main.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/home_page/weather/current_weather.dart'; +import 'bottom_navigation_bar_buttons/event/barwidget.dart'; void main() { runApp(const MyApp()); @@ -48,7 +49,7 @@ class _MyHomePageState extends State<MyHomePage> { //Index: 0 HomePage(), //Index: 1, - SecondRoute(), + BarWidget(barName: "Erster International"), //Index: 2, Forum(), //Index: 3 diff --git a/pubspec.lock b/pubspec.lock index 43b7434e23a0f80460ea9f2ce04e94e0552f9f7e..62516f223e2ed4fc47642aacad14cd9dc3465184 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -15,6 +15,13 @@ packages: url: "https://pub.dartlang.org" source: hosted 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: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4d4effe43123c63d481bcef03293c244f812699c..cd53b3c76a5ce478f9e76e4a440a021afe2ce9d6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,6 +38,7 @@ dependencies: http: ^0.13.4 flutter_settings_screens: ^0.2.2+1 shared_preferences: ^2.0.13 + carousel_slider: ^4.0.0 dev_dependencies: flutter_test: