-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pagination * dropdown pagination, docs * widget book * fixing todo * fixing disabled logic
- Loading branch information
1 parent
5840382
commit d782481
Showing
7 changed files
with
444 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:zeta_example/widgets.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
class PaginationExample extends StatefulWidget { | ||
static const name = 'Pagination'; | ||
|
||
const PaginationExample({super.key}); | ||
|
||
@override | ||
State<PaginationExample> createState() => _PaginationExampleState(); | ||
} | ||
|
||
class _PaginationExampleState extends State<PaginationExample> { | ||
int currentPage = 1; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExampleScaffold( | ||
name: PaginationExample.name, | ||
child: Center( | ||
child: Padding( | ||
padding: const EdgeInsets.all(64), | ||
child: Column( | ||
children: [ | ||
Expanded( | ||
child: Center( | ||
child: Text( | ||
'Current Page: ${currentPage}', | ||
style: Theme.of(context).textTheme.bodyLarge, | ||
), | ||
), | ||
), | ||
ZetaPagination( | ||
pages: 10, | ||
currentPage: currentPage, | ||
onChange: (val) => setState(() { | ||
currentPage = val; | ||
}), | ||
), | ||
const SizedBox(height: 8), | ||
ZetaPagination( | ||
pages: 10, | ||
currentPage: currentPage, | ||
onChange: (val) => setState(() { | ||
currentPage = val; | ||
}), | ||
type: ZetaPaginationType.dropdown, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
example/widgetbook/pages/components/pagination_widgetbook.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
|
||
Widget paginationUseCase(BuildContext context) => WidgetbookTestWidget( | ||
widget: ZetaPagination( | ||
pages: 10, | ||
type: context.knobs.list<ZetaPaginationType>( | ||
label: 'Type', | ||
options: ZetaPaginationType.values, | ||
labelBuilder: (value) => value.name.split('.').last.toUpperCase(), | ||
), | ||
rounded: context.knobs.boolean(label: 'Rounded'), | ||
disabled: context.knobs.boolean(label: 'Disabled'), | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.