Skip to content

Commit

Permalink
verify carousel!
Browse files Browse the repository at this point in the history
  • Loading branch information
leeashlee committed Oct 5, 2023
1 parent a6a091c commit 3e0fa48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
11 changes: 8 additions & 3 deletions lib/pages/account_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import 'package:flutter/material.dart';
import 'package:noel_notes/appwrite/auth_api.dart';
import 'package:noel_notes/component/icons/unicon_icons.dart';
import 'package:noel_notes/pages/verify_carousel.dart';
import 'package:provider/provider.dart';

class AccountPage extends StatefulWidget {
Expand Down Expand Up @@ -107,9 +108,13 @@ class _AccountPageState extends State<AccountPage> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const IconButton(
onPressed: null,
icon: Icon(
IconButton(
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const VerifyCarousel(),
),
),
icon: const Icon(
Unicon.shield_check,
color: Colors.green,
),
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/register.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously

import 'package:appwrite/appwrite.dart';
import 'package:flutter/material.dart';
import 'package:noel_notes/appwrite/auth_api.dart';
Expand Down
13 changes: 5 additions & 8 deletions lib/pages/verify_carousel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:carousel_slider/carousel_controller.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class VerifyCarousel extends StatefulWidget {
Expand All @@ -26,7 +24,8 @@ class _VerifyCarouselState extends State<VerifyCarousel> {
items: list,
carouselController: _controller,
options: CarouselOptions(
autoPlay: true,
enableInfiniteScroll: false,
autoPlay: false,
enlargeCenterPage: true,
aspectRatio: 2.0,
onPageChanged: (index, reason) {
Expand All @@ -46,13 +45,11 @@ class _VerifyCarouselState extends State<VerifyCarousel> {
width: 12.0,
height: 12.0,
margin: const EdgeInsets.symmetric(
vertical: 8.0, horizontal: 4.0),
vertical: 8.0, horizontal: 4.0,),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: (Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.black)
.withOpacity(_current == entry.key ? 0.9 : 0.4),
color: Theme.of(context).colorScheme.primary
.withOpacity(_current == entry.key ? 1 : 0.4),
),
),
);
Expand Down

0 comments on commit 3e0fa48

Please sign in to comment.