[mob] UI changes to segmented button in stripe and store pages

This commit is contained in:
ashilkn 2024-04-13 20:01:28 +05:30
parent 6c75b35472
commit 81c47bc768
2 changed files with 74 additions and 52 deletions

View file

@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';
import "package:flutter/cupertino.dart";
import "package:flutter/foundation.dart";
import 'package:flutter/material.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
@ -391,33 +392,43 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
child: Column(
children: [
RepaintBoundary(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SegmentedButton(
style: SegmentedButton.styleFrom(
selectedBackgroundColor:
getEnteColorScheme(context).fillMuted,
selectedForegroundColor:
getEnteColorScheme(context).textBase,
child: SizedBox(
width: 250,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SegmentedButton(
style: SegmentedButton.styleFrom(
selectedBackgroundColor:
getEnteColorScheme(context).fillMuted,
selectedForegroundColor:
getEnteColorScheme(context).textBase,
side: BorderSide(
color: getEnteColorScheme(context).strokeMuted,
width: 1,
),
),
segments: <ButtonSegment<bool>>[
ButtonSegment(
label: Text(S.of(context).monthly),
value: false,
),
ButtonSegment(
label: Text(S.of(context).yearly),
value: true,
),
],
selected: {showYearlyPlan},
onSelectionChanged: (p0) {
showYearlyPlan = p0.first;
_filterStorePlansForUi();
},
),
),
segments: <ButtonSegment<bool>>[
ButtonSegment(
label: Text(S.of(context).monthly),
value: false,
),
ButtonSegment(
label: Text(S.of(context).yearly),
value: true,
),
],
selected: {showYearlyPlan},
onSelectionChanged: (p0) {
showYearlyPlan = p0.first;
_filterStorePlansForUi();
},
),
],
],
),
),
),
_isFreePlanUser() && !UpdateService.instance.isPlayStoreFlavor()

View file

@ -1,5 +1,6 @@
import 'dart:async';
import "package:flutter/cupertino.dart";
import "package:flutter/foundation.dart";
import 'package:flutter/material.dart';
import "package:logging/logging.dart";
@ -543,33 +544,43 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
child: Column(
children: [
RepaintBoundary(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SegmentedButton(
style: SegmentedButton.styleFrom(
selectedBackgroundColor:
getEnteColorScheme(context).fillMuted,
selectedForegroundColor:
getEnteColorScheme(context).textBase,
child: SizedBox(
width: 250,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SegmentedButton(
style: SegmentedButton.styleFrom(
selectedBackgroundColor:
getEnteColorScheme(context).fillMuted,
selectedForegroundColor:
getEnteColorScheme(context).textBase,
side: BorderSide(
color: getEnteColorScheme(context).strokeMuted,
width: 1,
),
),
segments: <ButtonSegment<bool>>[
ButtonSegment(
label: Text(S.of(context).monthly),
value: false,
),
ButtonSegment(
label: Text(S.of(context).yearly),
value: true,
),
],
selected: {_showYearlyPlan},
onSelectionChanged: (p0) {
_showYearlyPlan = p0.first;
_filterStripeForUI();
},
),
),
segments: <ButtonSegment<bool>>[
ButtonSegment(
label: Text(S.of(context).monthly),
value: false,
),
ButtonSegment(
label: Text(S.of(context).yearly),
value: true,
),
],
selected: {_showYearlyPlan},
onSelectionChanged: (p0) {
_showYearlyPlan = p0.first;
_filterStripeForUI();
},
),
],
],
),
),
),
_isFreePlanUser() && !UpdateService.instance.isPlayStoreFlavor()