Changed source order, started adding strechy titlebars

This commit is contained in:
Imran Remtulla
2022-09-17 14:39:38 -04:00
parent 0b1863a227
commit 35369273bd
2 changed files with 61 additions and 44 deletions

View File

@@ -49,32 +49,52 @@ class _AppsPageState extends State<AppsPage> {
}, },
icon: const Icon(Icons.update), icon: const Icon(Icons.update),
label: const Text('Update All')), label: const Text('Update All')),
body: Center( body: RefreshIndicator(
child: appsProvider.loadingApps
? const CircularProgressIndicator()
: appsProvider.apps.isEmpty
? Text(
'No Apps',
style: Theme.of(context).textTheme.headlineMedium,
)
: RefreshIndicator(
onRefresh: () { onRefresh: () {
HapticFeedback.lightImpact(); HapticFeedback.lightImpact();
return appsProvider.checkUpdates(); return appsProvider.checkUpdates();
}, },
child: ListView( child: CustomScrollView(slivers: <Widget>[
children: sortedApps SliverAppBar(
.map( pinned: true,
(e) => ListTile( snap: false,
title: Text('${e.app.author}/${e.app.name}'), floating: false,
subtitle: Text( expandedHeight: 100,
e.app.installedVersion ?? 'Not Installed'), backgroundColor: MaterialStateColor.resolveWith(
trailing: e.downloadProgress != null (states) => states.contains(MaterialState.scrolledUnder)
? Theme.of(context).colorScheme.surface
: Theme.of(context).canvasColor,
),
flexibleSpace: const FlexibleSpaceBar(
titlePadding: const EdgeInsets.only(bottom: 16.0, left: 20.0),
title: Text(
'Apps',
style: TextStyle(color: Colors.black),
),
),
),
if (appsProvider.loadingApps || appsProvider.apps.isEmpty)
SliverToBoxAdapter(
child: appsProvider.loadingApps
? const CircularProgressIndicator()
: Text(
'No Apps',
style: Theme.of(context).textTheme.headlineMedium,
)),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return ListTile(
title: Text(
'${sortedApps[index].app.author}/${sortedApps[index].app.name}'),
subtitle: Text(sortedApps[index].app.installedVersion ??
'Not Installed'),
trailing: sortedApps[index].downloadProgress != null
? Text( ? Text(
'Downloading - ${e.downloadProgress?.toInt()}%') 'Downloading - ${sortedApps[index].downloadProgress?.toInt()}%')
: (e.app.installedVersion != null && : (sortedApps[index].app.installedVersion != null &&
e.app.installedVersion != sortedApps[index].app.installedVersion !=
e.app.latestVersion sortedApps[index].app.latestVersion
? const Text('Update Available') ? const Text('Update Available')
: null), : null),
onTap: () { onTap: () {
@@ -82,14 +102,11 @@ class _AppsPageState extends State<AppsPage> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
AppPage(appId: e.app.id)), AppPage(appId: sortedApps[index].app.id)),
); );
}, },
), );
) }, childCount: sortedApps.length))
.toList(), ])));
),
),
));
} }
} }

View File

@@ -399,9 +399,9 @@ class SourceProvider {
GitHub(), GitHub(),
GitLab(), GitLab(),
FDroid(), FDroid(),
IzzyOnDroid(),
Mullvad(), Mullvad(),
Signal(), Signal()
IzzyOnDroid()
]; ];
List<MassAppSource> massSources = [GitHubStars()]; List<MassAppSource> massSources = [GitHubStars()];