Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
Draft
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
12 changes: 6 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ android {
}

signingConfigs {
debug {
storeFile file('keystore.jks')
storePassword 'tech.pylons'
keyAlias 'key_tech_pylon'
keyPassword 'tech.pylons'
}
// debug {
// storeFile file('keystore.jks')
// storePassword 'tech.pylons'
// keyAlias 'key_tech_pylon'
// keyPassword 'tech.pylons'
// }
}

buildTypes {
Expand Down
4 changes: 4 additions & 0 deletions lib/easel_provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';

import 'package:easel_flutter/main.dart';
Expand Down Expand Up @@ -691,6 +693,8 @@ class EaselProvider extends ChangeNotifier {
enabled: true,
extraInfo: kExtraInfo);

log("MY JSON: ${json.encode(recipe.toProto3Json())}");

var response = await PylonsWallet.instance.txCreateRecipe(recipe, requestResponse: false);

if (!response.success) {
Expand Down
16 changes: 0 additions & 16 deletions lib/screens/describe_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ class _DescribeScreenState extends State<DescribeScreen> {
_artNameFieldError.value = kEnterNFTNameText;
return;
}
if (value.length <= kMinNFTName) {
_artNameFieldError.value = "$kNameShouldHaveText $kMinNFTName $kCharactersOrMoreText";
return;
}
_artNameFieldError.value = '';
return null;
},
Expand Down Expand Up @@ -213,18 +209,6 @@ class _DescribeScreenState extends State<DescribeScreen> {
controller: provider.descriptionController,
textCapitalization: TextCapitalization.sentences,
inputFormatters: [LengthLimitingTextInputFormatter(kMaxDescription)],
validator: (value) {
if (value!.isEmpty) {
_descriptionFieldError.value = kEnterNFTDescriptionText;
return;
}
if (value.length <= kMinDescription) {
_descriptionFieldError.value = "$kEnterMoreThanText $kMinDescription $kCharactersText";
return;
}
_descriptionFieldError.value = '';
return null;
},
),
ValueListenableBuilder<String>(
valueListenable: _descriptionFieldError,
Expand Down
1 change: 0 additions & 1 deletion lib/screens/preview_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class _PreviewScreenState extends State<PreviewScreen> {
provider.setAudioThumbnail(null);
provider.setVideoThumbnail(null);
provider.stopVideoIfPlaying();

return Future.value(true);
},
child: Stack(
Expand Down
4 changes: 1 addition & 3 deletions lib/screens/price_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ class _PriceScreenState extends State<PriceScreen> {
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
LengthLimitingTextInputFormatter(2),
AmountFormatter(
maxDigits: 2,
)
AmountFormatter(maxDigits: 2),
],
controller: provider.royaltyController,
validator: (value) {
Expand Down
9 changes: 5 additions & 4 deletions lib/screens/publish_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class _OwnerBottomDrawerState extends State<OwnerBottomDrawer> {
return SizedBox(
width: 330.0.w,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(
Expand All @@ -222,7 +222,7 @@ class _OwnerBottomDrawerState extends State<OwnerBottomDrawer> {
child: Icon(
Icons.play_arrow_outlined,
color: EaselAppTheme.kWhite,
size: 30.h,
size: 35.h,
),
);

Expand All @@ -234,7 +234,7 @@ class _OwnerBottomDrawerState extends State<OwnerBottomDrawer> {
child: Icon(
Icons.pause,
color: EaselAppTheme.kWhite,
size: 30.h,
size: 35.h,
),
);
}
Expand All @@ -246,7 +246,7 @@ class _OwnerBottomDrawerState extends State<OwnerBottomDrawer> {
valueListenable: viewModel.audioProgressNotifier,
builder: (_, value, __) {
return Padding(
padding: EdgeInsets.only(bottom: 3.h, right: 20.w),
padding: EdgeInsets.only(right: 20.w),
child: ProgressBar(
progressBarColor: EaselAppTheme.kWhite,
thumbColor: EaselAppTheme.kWhite,
Expand All @@ -261,6 +261,7 @@ class _OwnerBottomDrawerState extends State<OwnerBottomDrawer> {
onSeek: (position) {
viewModel.seekAudio(position, false);
},
timeLabelLocation: TimeLabelLocation.none,
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _SplashScreenState extends State<SplashScreen> {
void onGetStarted() {
var onBoardingComplete = GetIt.I.get<Repository>().getOnBoardingComplete();
if (!onBoardingComplete) {
Navigator.of(context).pushNamed(RouteUtil.kRouteTutorial);
Navigator.of(context).pushReplacementNamed(RouteUtil.kRouteTutorial);
return;
}

Expand Down
112 changes: 59 additions & 53 deletions lib/screens/tutorial_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:bottom_drawer/bottom_drawer.dart';
import 'package:easel_flutter/easel_provider.dart';
import 'package:easel_flutter/main.dart';
import 'package:easel_flutter/repository/repository.dart';
import 'package:easel_flutter/utils/easel_app_theme.dart';
import 'package:easel_flutter/utils/extension_util.dart';
import 'package:easel_flutter/utils/route_util.dart';
Expand All @@ -12,7 +10,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get_it/get_it.dart';
import 'package:provider/provider.dart';
import 'package:pylons_sdk/pylons_sdk.dart';

import '../utils/constants.dart';
Expand All @@ -32,14 +29,14 @@ class _TutorialScreenState extends State<TutorialScreen> {

List<Widget> indicator() => List<Widget>.generate(
slides.length,
(index) => Container(
margin: EdgeInsets.symmetric(horizontal: 4.w),
height: currentPage.round() == index ? 16.w : 12.h,
width: currentPage.round() == index ? 18.w : 12.h,
decoration: BoxDecoration(
color: currentPage.round() == index ? getColorPerPage(index) : EaselAppTheme.kLightGrey,
),
));
(index) => Container(
margin: EdgeInsets.symmetric(horizontal: 4.w),
height: currentPage.round() == index ? 16.w : 12.h,
width: currentPage.round() == index ? 18.w : 12.h,
decoration: BoxDecoration(
color: currentPage.round() == index ? getColorPerPage(index) : EaselAppTheme.kLightGrey,
),
));

double currentPage = 0.0;
final _pageViewController = PageController();
Expand All @@ -63,65 +60,64 @@ class _TutorialScreenState extends State<TutorialScreen> {
myBottomDrawerController = BottomDrawerController();
slides = kTutorialItems
.map((item) => Column(
children: <Widget>[
SizedBox(height: 0.1.sh),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.22.sw),
child: Image.asset(
item[kImageTutorial],
height: 10.h,
width: 40,
fit: BoxFit.fill,
)),
SizedBox(height: 0.1.sh),
Text(item[kHeaderTutorial], style: TextStyle(fontSize: isTablet ? 16.sp : 18.sp, fontWeight: FontWeight.w800, color: EaselAppTheme.kDartGrey), textAlign: TextAlign.center),
SizedBox(height: 15.h),
SizedBox(width: 0.63.sw, child: Text(item[kDescriptionTutorial], style: TextStyle(color: Colors.black, fontSize: 13.sp, fontWeight: FontWeight.w400), textAlign: TextAlign.center)),
],
))
children: <Widget>[
SizedBox(height: 0.1.sh),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.22.sw),
child: Image.asset(
item[kImageTutorial],
height: 10.h,
width: 40,
fit: BoxFit.fill,
)),
SizedBox(height: 0.1.sh),
Text(item[kHeaderTutorial], style: TextStyle(fontSize: isTablet ? 16.sp : 18.sp, fontWeight: FontWeight.w800, color: EaselAppTheme.kDartGrey), textAlign: TextAlign.center),
SizedBox(height: 15.h),
SizedBox(width: 0.63.sw, child: Text(item[kDescriptionTutorial], style: TextStyle(color: Colors.black, fontSize: 13.sp, fontWeight: FontWeight.w400), textAlign: TextAlign.center)),
],
))
.toList();
_pageViewController.addListener(() {
if(doMoveForwardToMessageScreen()) {
if (doMoveForwardToMessageScreen()) {
moveForwardToEaselMessage();
return;
}
setState(() {
currentPage = _pageViewController.page!;
});

});
}

bool doMoveForwardToMessageScreen() => currentPage==2&&_pageViewController.position.userScrollDirection==ScrollDirection.reverse&&!tutorialProvider.isForwarding;
bool doMoveForwardToMessageScreen() => currentPage == 2 && _pageViewController.position.userScrollDirection == ScrollDirection.reverse && !tutorialProvider.isForwarding;

@override
Widget build(BuildContext context) {
slides = kTutorialItems
.map((item) => Column(
children: <Widget>[
SizedBox(height: 0.2.sh),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.22.sw),
child: Image.asset(
item[kImageTutorial],
height: isTablet ? 140.w : 200.w,
width: isTablet ? 140.w : 200.w,
fit: BoxFit.fill,
)),
SizedBox(height: 0.15.sh),
Text(item[kHeaderTutorial], style: TextStyle(fontSize: isTablet ? 16.sp : 18.sp, fontWeight: FontWeight.w800, color: EaselAppTheme.kDartGrey), textAlign: TextAlign.center),
SizedBox(height: 15.h),
SizedBox(width: 0.63.sw, child: Text(item[kDescriptionTutorial], style: TextStyle(color: Colors.black, fontSize: 13.sp, fontWeight: FontWeight.w400), textAlign: TextAlign.center)),
],
))
children: <Widget>[
SizedBox(height: 0.2.sh),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.22.sw),
child: Image.asset(
item[kImageTutorial],
height: isTablet ? 140.w : 200.w,
width: isTablet ? 140.w : 200.w,
fit: BoxFit.fill,
)),
SizedBox(height: 0.15.sh),
Text(item[kHeaderTutorial], style: TextStyle(fontSize: isTablet ? 16.sp : 18.sp, fontWeight: FontWeight.w800, color: EaselAppTheme.kDartGrey), textAlign: TextAlign.center),
SizedBox(height: 15.h),
SizedBox(width: 0.63.sw, child: Text(item[kDescriptionTutorial], style: TextStyle(color: Colors.black, fontSize: 13.sp, fontWeight: FontWeight.w400), textAlign: TextAlign.center)),
],
))
.toList();
return Scaffold(
backgroundColor: EaselAppTheme.kWhite03,
body: Stack(
children: <Widget>[
PageView.builder(
controller: _pageViewController,
physics: const BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemCount: slides.length,
itemBuilder: (BuildContext context, int index) {
return slides[index];
Expand All @@ -130,7 +126,7 @@ class _TutorialScreenState extends State<TutorialScreen> {
Align(
alignment: Alignment.bottomCenter,
child: Container(
margin: EdgeInsets.only(bottom: isTablet ? 85.h : 120.h),
margin: EdgeInsets.only(bottom: isTablet ? 85.h : 80.h),
padding: EdgeInsets.symmetric(vertical: 10.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand All @@ -144,8 +140,6 @@ class _TutorialScreenState extends State<TutorialScreen> {
);
}

bool isLastPage() => currentPage.round() == slides.length - 1;

Widget buildBottomDrawer(BuildContext context) {
return BottomDrawer(
header: Container(),
Expand All @@ -170,7 +164,11 @@ class _TutorialScreenState extends State<TutorialScreen> {
width: 0.7.sw,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [Text(kWhyAppNeededDesc1, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)), SizedBox(height: 8.h), Text(kWhyAppNeededDescSummary1, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))],
children: [
Text(kWhyAppNeededDesc1, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)),
SizedBox(height: 8.h),
Text(kWhyAppNeededDescSummary1, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))
],
),
)
],
Expand All @@ -191,7 +189,11 @@ class _TutorialScreenState extends State<TutorialScreen> {
width: 0.7.sw,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [Text(kWhyAppNeededDesc2, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)), SizedBox(height: 8.h), Text(kWhyAppNeededDescSummary2, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))],
children: [
Text(kWhyAppNeededDesc2, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)),
SizedBox(height: 8.h),
Text(kWhyAppNeededDescSummary2, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))
],
),
)
],
Expand All @@ -212,7 +214,11 @@ class _TutorialScreenState extends State<TutorialScreen> {
width: 0.7.sw,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [Text(kWhyAppNeededDesc3, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)), SizedBox(height: 8.h), Text(kWhyAppNeededDescSummary3, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))],
children: [
Text(kWhyAppNeededDesc3, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w800, color: Colors.black)),
SizedBox(height: 8.h),
Text(kWhyAppNeededDescSummary3, style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w400, color: EaselAppTheme.kLightGrey))
],
),
)
],
Expand Down
30 changes: 25 additions & 5 deletions lib/utils/amount_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AmountFormatter extends TextInputFormatter {
bool isDecimal;

@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
maxDigits = 20;
if (newValue.selection.baseOffset == 0) {
return newValue;
Expand All @@ -21,8 +20,29 @@ class AmountFormatter extends TextInputFormatter {
final formatter = NumberFormat(isDecimal ? "#,##0.00" : "#,###", "en_US");
String newText = formatter.format(isDecimal ? value / 100 : value);

return newValue.copyWith(
text: newText,
selection: TextSelection.collapsed(offset: newText.length));
return newValue.copyWith(text: newText, selection: TextSelection.collapsed(offset: newText.length));
}
}

class RoyaltiesFormatter extends TextInputFormatter {
RoyaltiesFormatter({required this.maxDigits});

int maxDigits;

@override
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
maxDigits = 3;

if (newValue.selection.baseOffset > maxDigits) {
return oldValue;
}
if (newValue.selection.baseOffset == 0) {
return newValue;
}
double value = double.parse(newValue.text);
final formatter = NumberFormat("#.0##", "en_US");
String newText = formatter.format(value);

return newValue.copyWith(text: newText, selection: TextSelection.collapsed(offset: newText.length));
}
}
2 changes: 1 addition & 1 deletion lib/utils/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const kMinEditionValue = 1;
const kMaxDescription = 256;
const kMaxEdition = 10000;
const kMinRoyalty = 0;
const kMaxRoyalty = 99.99;
const kMaxRoyalty = 100;
const kFileSizeLimitInGB = 32;
const kFileSizeLimitForAudiVideoInGB = 0.2;
const kMaxPriceLength = 14;
Expand Down
Loading