Compare commits
No commits in common. "c9d62743f622880629528671e5fa6765a036181e" and "dcd05b53b482f4b3a95916413164a901749caf81" have entirely different histories.
c9d62743f6
...
dcd05b53b4
4 changed files with 6 additions and 53 deletions
|
|
@ -1,10 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shimmer/shimmer.dart';
|
|
||||||
import 'package:temperaturdecke/database.dart';
|
import 'package:temperaturdecke/database.dart';
|
||||||
import 'package:temperaturdecke/screens/add_wool_modal.dart';
|
import 'package:temperaturdecke/screens/add_wool_modal.dart';
|
||||||
import 'package:temperaturdecke/widgets/cards/wool_card.dart';
|
import 'package:temperaturdecke/widgets/cards/wool_card.dart';
|
||||||
import 'package:temperaturdecke/widgets/custom_card.dart';
|
|
||||||
|
|
||||||
class WoolScreen extends StatelessWidget {
|
class WoolScreen extends StatelessWidget {
|
||||||
WoolScreen({super.key});
|
WoolScreen({super.key});
|
||||||
|
|
@ -12,48 +10,19 @@ class WoolScreen extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget child;
|
|
||||||
|
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: Provider.of<AppDatabase>(context)
|
future: Provider.of<AppDatabase>(context)
|
||||||
.select(Provider.of<AppDatabase>(context).wolle)
|
.select(Provider.of<AppDatabase>(context).wolle)
|
||||||
.get(),
|
.get(),
|
||||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
child = Center(
|
return const Center(
|
||||||
child: Shimmer.fromColors(
|
child: CircularProgressIndicator(),
|
||||||
baseColor: Theme.of(context).colorScheme.secondaryContainer,
|
|
||||||
highlightColor: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSecondaryContainer
|
|
||||||
.withOpacity(.3),
|
|
||||||
child: ListView.builder(
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
CustomCard(
|
|
||||||
SizedBox(
|
|
||||||
height: 70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 15,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
itemCount: 6,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Hier können Sie den Inhalt basierend auf den geladenen Daten anzeigen
|
// Hier können Sie den Inhalt basierend auf den geladenen Daten anzeigen
|
||||||
child = Scaffold(
|
return Scaffold(
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
floatingActionButton: FloatingActionButton(
|
||||||
label: Text("Hinzufügen"),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
|
|
@ -64,7 +33,7 @@ class WoolScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
icon: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -95,12 +64,6 @@ class WoolScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return AnimatedSwitcher(
|
|
||||||
duration: Duration(milliseconds: 500),
|
|
||||||
switchInCurve: Curves.easeOut,
|
|
||||||
switchOutCurve: Curves.ease,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class ModalWrapper extends StatelessWidget {
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 750,
|
width: 500,
|
||||||
height: MediaQuery.of(context).size.height - 100,
|
height: MediaQuery.of(context).size.height - 100,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 25, vertical: 10),
|
padding: EdgeInsets.symmetric(horizontal: 25, vertical: 10),
|
||||||
|
|
|
||||||
|
|
@ -584,14 +584,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
shimmer:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: shimmer
|
|
||||||
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ dependencies:
|
||||||
|
|
||||||
blobs:
|
blobs:
|
||||||
|
|
||||||
shimmer:
|
|
||||||
|
|
||||||
flutter_colorpicker:
|
flutter_colorpicker:
|
||||||
|
|
||||||
hexcolor:
|
hexcolor:
|
||||||
|
|
|
||||||
Reference in a new issue