Skip to content

Commit 79d354f

Browse files
committed
Set default floatingButtonOffset based on platform
1 parent 35bdf17 commit 79d354f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

example/lib/providers/bug_reporting_state.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24

35
import 'package:instabug_flutter/instabug_flutter.dart';
@@ -70,7 +72,7 @@ class BugReportingState with ChangeNotifier {
7072
notifyListeners();
7173
}
7274

73-
var _floatingButtonOffset = 100;
75+
var _floatingButtonOffset = Platform.isIOS ? 100 : 250;
7476
int get floatingButtonOffset => _floatingButtonOffset;
7577
set floatingButtonOffset(int offset) {
7678
_floatingButtonOffset = offset;

example/lib/screens/bug_reporting_screen.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24
import 'package:provider/provider.dart';
35

@@ -283,7 +285,8 @@ class BugReportingScreen extends StatelessWidget {
283285
enableInteractiveSelection: true,
284286
onChanged: (value) {
285287
if (value.isEmpty) {
286-
state.floatingButtonOffset = 100;
288+
state.floatingButtonOffset =
289+
Platform.isIOS ? 100 : 250;
287290
} else {
288291
state.floatingButtonOffset = int.parse(value);
289292
}

0 commit comments

Comments
 (0)