Skip to content

Commit

Permalink
Add Gap package and replace Padding with Gap in settings view
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzdhd committed Nov 12, 2023
1 parent ac242c6 commit aa891d2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 38 deletions.
72 changes: 34 additions & 38 deletions lib/src/settings/views/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:fpdart/fpdart.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:gap/gap.dart';
import '../../helpers.dart';

class SettingsView extends HookConsumerWidget {
Expand Down Expand Up @@ -212,13 +213,11 @@ class SettingsView extends HookConsumerWidget {
}),
),
),
const Padding(
padding: EdgeInsets.only(top: 15.0, bottom: 15.0),
child: Divider(),
),
Padding(
padding: const EdgeInsets.only(top: 5.0, bottom: 5.0),
child: ElevatedButton(
const Gap(10),
const Divider(),
const Gap(10),
if (defaultTargetPlatform == TargetPlatform.android)
ElevatedButton(
onPressed: () {
showDialog(
context: context,
Expand All @@ -233,52 +232,49 @@ class SettingsView extends HookConsumerWidget {
style: TextStyle(fontSize: 16),
),
),
),
if (defaultTargetPlatform == TargetPlatform.android)
Padding(
padding: const EdgeInsets.only(top: 5.0, bottom: 5.0),
child: ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (BuildContext ctx) {
return InfoDialogWidget(
isLatestVersion:
UpdateService.isLatestVersion(),
);
});
},
style: TextButton.styleFrom(
minimumSize: const Size(0, 50)),
child: const Text(
'Check for updates',
style: TextStyle(fontSize: 16),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 5.0, bottom: 5.0),
child: ElevatedButton(
const Gap(10),
if (defaultTargetPlatform == TargetPlatform.android)
ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (BuildContext ctx) {
return const AboutDialogWidget();
},
);
context: context,
builder: (BuildContext ctx) {
return InfoDialogWidget(
isLatestVersion:
UpdateService.isLatestVersion(),
);
});
},
style:
TextButton.styleFrom(minimumSize: const Size(0, 50)),
child: const Text(
'About and Credits',
'Check for updates',
style: TextStyle(fontSize: 16),
),
),
const Gap(10),
ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (BuildContext ctx) {
return const AboutDialogWidget();
},
);
},
style: TextButton.styleFrom(minimumSize: const Size(0, 50)),
child: const Text(
'About and Credits',
style: TextStyle(fontSize: 16),
),
)
],
),
),
const Gap(10),
const Divider(),
const Gap(10),
if (defaultTargetPlatform != TargetPlatform.windows)
SizedBox(
child: Text(
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
gap:
dependency: "direct main"
description:
name: gap
sha256: f19387d4e32f849394758b91377f9153a1b41d79513ef7668c088c77dbc6955d
url: "https://pub.dev"
source: hosted
version: "3.0.1"
get_it:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies:
ref: 391a498
flutter_native_splash: ^2.3.5
after_layout: ^1.2.0
gap: ^3.0.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit aa891d2

Please sign in to comment.