Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress Color, Remaining Color can be add manually by the user #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
19 changes: 0 additions & 19 deletions example/.idea/libraries/Dart_SDK.xml

This file was deleted.

15 changes: 0 additions & 15 deletions example/.idea/libraries/KotlinJavaRuntime.xml

This file was deleted.

9 changes: 0 additions & 9 deletions example/.idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions example/.idea/runConfigurations/main_dart.xml

This file was deleted.

36 changes: 0 additions & 36 deletions example/.idea/workspace.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file modified example/android/.gradle/6.7/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified example/android/.gradle/6.7/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified example/android/.gradle/6.7/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified example/android/.gradle/6.7/javaCompile/taskHistory.bin
Binary file not shown.
Binary file not shown.
Binary file modified example/android/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions example/android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk.dir=/home/abhay/Android/Sdk
flutter.sdk=/home/abhay/snap/flutter/common/flutter
sdk.dir=C:\\Users\\dasgu\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
2 changes: 2 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ExampleApp extends StatelessWidget {
/// onSelection will be triggered when users presses a option or presses undo button(only available on editable polls).
/// This function will be called after all the calculation like reducing total polls and marking previous option not selected.
/// It returns the PollFrameModel .Use this function to do some extra operations like storing this poll into other variable.
progressColor: Colors.green,
remainingColor: Colors.grey,
onSelection:
(PollFrameModel model, PollOptions? selectedOptionModel) {
print('Now total polls are : ' + model.totalPolls.toString());
Expand Down
168 changes: 0 additions & 168 deletions example/pubspec.lock

This file was deleted.

12 changes: 10 additions & 2 deletions lib/widgets/poll_results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ class PollResultsWidget extends StatelessWidget {
final double percentage;
final PollOptions optionModel;
final TextStyle? optionsStyle;
final Color? progressColor;
final Color? remainingColor;

const PollResultsWidget({
Key? key,
required this.percentage,
required this.optionModel,
this.optionsStyle,
this.progressColor,
this.remainingColor,
}) : super(key: key);

@override
Expand All @@ -23,24 +28,27 @@ class PollResultsWidget extends StatelessWidget {
title: Stack(
alignment: Alignment.centerLeft,
children: [

/// CustomLinearProgressBar is a widget that works like a progress bar but will be static.
CustomLinearProgressBar(
value: percentage,
progressColor: this.progressColor,
remainingColor: this.remainingColor,
),

/// This will create the label of the option in results screen.
Row(
children: [
Flexible(
child: Container(
child: Padding(
padding: EdgeInsets.only(left: 10),
child: Text(
optionModel.label,
overflow: TextOverflow.ellipsis,
style: optionsStyle ??
TextStyle(
fontSize: 13,
color: Theme.of(context).primaryColor,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
Expand Down
Loading