Skip to content

Commit

Permalink
update loader view
Browse files Browse the repository at this point in the history
  • Loading branch information
Shegun Montcho committed Mar 18, 2024
1 parent 97de1cd commit d35482f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/segun/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.13.0/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/segun/.pub-cache/hosted/pub.dev/webview_flutter_android-3.16.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2024-03-17 00:44:03.071882","version":"3.19.3"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/segun/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.13.0/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/segun/.pub-cache/hosted/pub.dev/webview_flutter_android-3.16.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/segun/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2024-03-18 10:15:34.030209","version":"3.19.3"}
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class App extends StatelessWidget {
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
backgroundColor: nColorPrimary,
backgroundColor: primaryColor,
title: const Text('Kkiapay Sample'),
centerTitle: true,
),
Expand Down
7 changes: 3 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ packages:
kkiapay_flutter_sdk:
dependency: "direct main"
description:
name: kkiapay_flutter_sdk
sha256: "9825f40c084364e6720455e8b96974fde21487e5122dc4b9a6b8e311ce78ab9f"
url: "https://pub.dev"
source: hosted
path: ".."
relative: true
source: path
version: "1.2.12"
leak_tracker:
dependency: transitive
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
kkiapay_flutter_sdk: ^1.2.10
#path: ../
kkiapay_flutter_sdk: #^1.2.12
path: ../

dev_dependencies:
flutter_test:
Expand Down
40 changes: 19 additions & 21 deletions lib/src/view.part.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,26 @@ class LoadingView extends ViewModelWidget<WidgetBuilderViewModel> {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 52,
child: Center(
child: imageFromBase64String(),
)),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 18.0,
),
children: <TextSpan>[
new TextSpan(
text: 'Chargement',
style: new TextStyle(
fontWeight: FontWeight.bold, color: Colors.black)),
new TextSpan(
text: viewModel.progression,
style: new TextStyle(
fontWeight: FontWeight.bold, color: Colors.black54)),
Stack(
alignment: Alignment.center,
children: [
Container(
height: 100,
width: 100,
child: CircularProgressIndicator(
value: viewModel.progression,
backgroundColor: Colors.grey.withOpacity(0.3),
color: Colors.grey.withOpacity(0.6),
)
),

Container(
height: 42,
child: Center(
child: imageFromBase64String(),
)),
],
)
),
)
],
),
));
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widget_builder_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class _KKiaPayState extends State<KKiaPay> {
NavigationDelegate(
onProgress: (int progress) {
debugPrint('WebView is loading (progress : $progress%)');
viewModel.setProgression(" $progress%");
viewModel.setProgression(progress/100);
},
onPageStarted: (String url) {
debugPrint('Page started loading: $url');
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widget_builder_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:stacked/stacked.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WidgetBuilderViewModel extends BaseViewModel {
String _progression = "...";
String get progression => _progression;
double _progression = 0.0;
double get progression => _progression;
void setProgression(value) {
_progression = value;
notifyListeners();
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const PlayStoreRedirectURI = "https://play.google.com";
const WaveStoreRedirectURI = "market://details?id=com.wave.personal";

/// static additional data
const nColorPrimary = Color(0xffF11C33);
const primaryColor = Color(0xffF11C33);
const secondaryColor = Color(0xff222F5A);
const callback = 'http://redirect.kkiapay.me';
const sdk = "flutter";
const url = "";
Expand Down

0 comments on commit d35482f

Please sign in to comment.