Skip to content

Commit

Permalink
Added progress indicator for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
cyblogerz committed Aug 6, 2022
1 parent b32d7e3 commit f3a9a3e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'package:zippy/utils/book_view.dart';
import 'package:zippy/pages/explore_page.dart';
import 'package:zippy/pages/pdf_landing.dart';
import 'package:zippy/pages/settings_page.dart';
import 'package:zippy/providers/bookData.dart';
import 'package:zippy/widgets/book_tile.dart';
Expand Down Expand Up @@ -85,7 +85,7 @@ class _HomeState extends State<Home> {
child: Column(
children: <Widget>[
UserAccountsDrawerHeader(
decoration: BoxDecoration(color: Colors.pink),
decoration: BoxDecoration(color: Color(0xff6540FF)),
currentAccountPicture: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
Expand Down
File renamed without changes.
17 changes: 14 additions & 3 deletions lib/pages/result_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ class _ResultListState extends State<ResultList> {
return true;
},
child: ListView.builder(
itemCount: searchResults.length,
itemBuilder: (ctx, index) => ChangeNotifierProvider.value(
itemCount: searchResults.length + 1,
itemBuilder: (ctx, index) {
if (index < searchResults.length) {
return ChangeNotifierProvider.value(
value: searchResults[index],
child: BookListTile(searchResults[index]),
)),
);
} else {
return const Padding(
padding: EdgeInsets.symmetric(vertical: 32),
child: Center(
child: CircularProgressIndicator(),
),
);
}
}),
));
}
}
27 changes: 19 additions & 8 deletions lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,25 @@ class SettingsPage extends StatelessWidget {
child: Container(
padding: EdgeInsets.all(20),
width: MediaQuery.of(context).size.width * 0.5,
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Color.fromARGB(110, 158, 158, 158),
spreadRadius: 5,
blurRadius: 10,
offset: Offset(0, 5))
], borderRadius: BorderRadius.circular(32), color: Colors.white),
child: Text('This is a demo app developed for SECURE dev Task'),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.purple, Colors.deepPurple, Colors.blueAccent],
begin: Alignment.bottomRight,
end: Alignment.topLeft,
),
boxShadow: [
BoxShadow(
color: Color.fromARGB(75, 124, 77, 255),
spreadRadius: 5,
blurRadius: 10,
offset: Offset(0, 5))
],
borderRadius: BorderRadius.circular(32),
color: Colors.white),
child: Text(
'This is a demo app developed for SECURE dev Task',
style: TextStyle(color: Colors.white),
),
),
),
);
Expand Down

0 comments on commit f3a9a3e

Please sign in to comment.