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

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()];