Fix ui bugs
This commit is contained in:
@@ -21,86 +21,87 @@ class IntroPage extends HookConsumerWidget with PresLogger {
|
||||
|
||||
final isStarting = useState(false);
|
||||
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
slivers: [
|
||||
const SliverGap(24),
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
width: 248,
|
||||
height: 248,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(36),
|
||||
child: Assets.images.logo.svg(),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
width: 224,
|
||||
height: 224,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Assets.images.logo.svg(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverCrossAxisConstrained(
|
||||
maxCrossAxisExtent: 368,
|
||||
child: MultiSliver(
|
||||
children: [
|
||||
const LocalePrefTile(),
|
||||
const SliverGap(8),
|
||||
const RegionPrefTile(),
|
||||
const SliverGap(8),
|
||||
const EnableAnalyticsPrefTile(),
|
||||
const SliverGap(8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text.rich(
|
||||
t.intro.termsAndPolicyCaution(
|
||||
tap: (text) => TextSpan(
|
||||
text: text,
|
||||
style: const TextStyle(color: Colors.blue),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.termsAndConditionsUrl),
|
||||
);
|
||||
},
|
||||
SliverCrossAxisConstrained(
|
||||
maxCrossAxisExtent: 368,
|
||||
child: MultiSliver(
|
||||
children: [
|
||||
const LocalePrefTile(),
|
||||
const SliverGap(4),
|
||||
const RegionPrefTile(),
|
||||
const SliverGap(4),
|
||||
const EnableAnalyticsPrefTile(),
|
||||
const SliverGap(4),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text.rich(
|
||||
t.intro.termsAndPolicyCaution(
|
||||
tap: (text) => TextSpan(
|
||||
text: text,
|
||||
style: const TextStyle(color: Colors.blue),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.termsAndConditionsUrl),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 24,
|
||||
),
|
||||
child: FilledButton(
|
||||
onPressed: () async {
|
||||
if (isStarting.value) return;
|
||||
isStarting.value = true;
|
||||
if (!ref.read(enableAnalyticsProvider)) {
|
||||
loggy.info("disabling analytics per user request");
|
||||
try {
|
||||
await Sentry.close();
|
||||
} catch (error, stackTrace) {
|
||||
loggy.error(
|
||||
"could not disable analytics",
|
||||
error,
|
||||
stackTrace,
|
||||
);
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 24,
|
||||
),
|
||||
child: FilledButton(
|
||||
onPressed: () async {
|
||||
if (isStarting.value) return;
|
||||
isStarting.value = true;
|
||||
if (!ref.read(enableAnalyticsProvider)) {
|
||||
loggy.info("disabling analytics per user request");
|
||||
try {
|
||||
await Sentry.close();
|
||||
} catch (error, stackTrace) {
|
||||
loggy.error(
|
||||
"could not disable analytics",
|
||||
error,
|
||||
stackTrace,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
await ref
|
||||
.read(introCompletedProvider.notifier)
|
||||
.update(true);
|
||||
},
|
||||
child: isStarting.value
|
||||
? LinearProgressIndicator(
|
||||
backgroundColor: Colors.transparent,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
)
|
||||
: Text(t.intro.start),
|
||||
await ref
|
||||
.read(introCompletedProvider.notifier)
|
||||
.update(true);
|
||||
},
|
||||
child: isStarting.value
|
||||
? LinearProgressIndicator(
|
||||
backgroundColor: Colors.transparent,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
)
|
||||
: Text(t.intro.start),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user