aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-02 21:32:04 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-02 21:35:00 +0530
commit5704e115f13e7f1daf72cb094449cfade6719260 (patch)
tree65fd76f13f26ef1756fbc4c7c68bb9a163d1a74b /lib
parent6c4c4a7ed534052b732c3f5c062539cafdcb0c94 (diff)
downloaddaft-launcher-5704e115f13e7f1daf72cb094449cfade6719260.tar.gz
daft-launcher-5704e115f13e7f1daf72cb094449cfade6719260.zip
Pages are not destroyed on swipe
Diffstat (limited to '')
-rw-r--r--lib/main.dart2
-rw-r--r--lib/pages/Home.dart34
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/main.dart b/lib/main.dart
index dba8ce6..2ad0fb9 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -23,7 +23,7 @@ class MyApp extends StatelessWidget {
title: 'owyn launcher',
home: Scaffold(
body: PageView(
- controller: PageController(),
+ controller: PageController(keepPage: true),
children: [
HomeView(time$, defaultTime: DateTime.now()),
AppsView(),
diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart
index 09582b7..4d28e29 100644
--- a/lib/pages/Home.dart
+++ b/lib/pages/Home.dart
@@ -45,7 +45,7 @@ class StatusInfoCard extends StatelessWidget {
}
return Container(
- height: 300,
+ height: 80,
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Align(alignment: Alignment.topLeft, child: child),
);
@@ -65,22 +65,22 @@ class HomeView extends StatelessWidget {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
- child: ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: viewportConstraints.maxHeight,
- ),
- child: IntrinsicHeight(
- child: Container(
- padding: const EdgeInsets.symmetric(vertical: 36.0, horizontal: 16.0),
- height: viewportConstraints.maxHeight,
- child: Column(
- children: [
- StatusInfoCard(time$, defaultTime: defaultTime),
- Expanded(child: Text('Content')),
- ],
- ),
- )
- ),
+ child: ConstrainedBox(
+ constraints: BoxConstraints(
+ minHeight: viewportConstraints.maxHeight,
+ ),
+ child: IntrinsicHeight(
+ child: Container(
+ padding: const EdgeInsets.symmetric(vertical: 36.0, horizontal: 16.0),
+ height: viewportConstraints.maxHeight,
+ child: Column(
+ children: [
+ StatusInfoCard(time$, defaultTime: defaultTime),
+ Expanded(child: Text('Content')),
+ ],
+ ),
+ )
+ ),
),
);
}