mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-03 23:03:29 +01:00 
			
		
		
		
	Changed source order, started adding strechy titlebars
This commit is contained in:
		@@ -49,47 +49,64 @@ class _AppsPageState extends State<AppsPage> {
 | 
			
		||||
                      },
 | 
			
		||||
                icon: const Icon(Icons.update),
 | 
			
		||||
                label: const Text('Update All')),
 | 
			
		||||
        body: Center(
 | 
			
		||||
          child: appsProvider.loadingApps
 | 
			
		||||
              ? const CircularProgressIndicator()
 | 
			
		||||
              : appsProvider.apps.isEmpty
 | 
			
		||||
                  ? Text(
 | 
			
		||||
                      'No Apps',
 | 
			
		||||
                      style: Theme.of(context).textTheme.headlineMedium,
 | 
			
		||||
                    )
 | 
			
		||||
                  : RefreshIndicator(
 | 
			
		||||
                      onRefresh: () {
 | 
			
		||||
                        HapticFeedback.lightImpact();
 | 
			
		||||
                        return appsProvider.checkUpdates();
 | 
			
		||||
                      },
 | 
			
		||||
                      child: ListView(
 | 
			
		||||
                        children: sortedApps
 | 
			
		||||
                            .map(
 | 
			
		||||
                              (e) => ListTile(
 | 
			
		||||
                                title: Text('${e.app.author}/${e.app.name}'),
 | 
			
		||||
                                subtitle: Text(
 | 
			
		||||
                                    e.app.installedVersion ?? 'Not Installed'),
 | 
			
		||||
                                trailing: e.downloadProgress != null
 | 
			
		||||
                                    ? Text(
 | 
			
		||||
                                        'Downloading - ${e.downloadProgress?.toInt()}%')
 | 
			
		||||
                                    : (e.app.installedVersion != null &&
 | 
			
		||||
                                            e.app.installedVersion !=
 | 
			
		||||
                                                e.app.latestVersion
 | 
			
		||||
                                        ? const Text('Update Available')
 | 
			
		||||
                                        : null),
 | 
			
		||||
                                onTap: () {
 | 
			
		||||
                                  Navigator.push(
 | 
			
		||||
                                    context,
 | 
			
		||||
                                    MaterialPageRoute(
 | 
			
		||||
                                        builder: (context) =>
 | 
			
		||||
                                            AppPage(appId: e.app.id)),
 | 
			
		||||
                                  );
 | 
			
		||||
                                },
 | 
			
		||||
                              ),
 | 
			
		||||
                            )
 | 
			
		||||
                            .toList(),
 | 
			
		||||
                      ),
 | 
			
		||||
                    ),
 | 
			
		||||
        ));
 | 
			
		||||
        body: RefreshIndicator(
 | 
			
		||||
            onRefresh: () {
 | 
			
		||||
              HapticFeedback.lightImpact();
 | 
			
		||||
              return appsProvider.checkUpdates();
 | 
			
		||||
            },
 | 
			
		||||
            child: CustomScrollView(slivers: <Widget>[
 | 
			
		||||
              SliverAppBar(
 | 
			
		||||
                pinned: true,
 | 
			
		||||
                snap: false,
 | 
			
		||||
                floating: false,
 | 
			
		||||
                expandedHeight: 100,
 | 
			
		||||
                backgroundColor: MaterialStateColor.resolveWith(
 | 
			
		||||
                  (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(
 | 
			
		||||
                          '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))
 | 
			
		||||
            ])));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -399,9 +399,9 @@ class SourceProvider {
 | 
			
		||||
    GitHub(),
 | 
			
		||||
    GitLab(),
 | 
			
		||||
    FDroid(),
 | 
			
		||||
    IzzyOnDroid(),
 | 
			
		||||
    Mullvad(),
 | 
			
		||||
    Signal(),
 | 
			
		||||
    IzzyOnDroid()
 | 
			
		||||
    Signal()
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  List<MassAppSource> massSources = [GitHubStars()];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user