Skip to content

Commit b3caba6

Browse files
committed
feature/
- exposed survey controller - Changed way to read current platform -> Now works with all Flutter supported devices
1 parent 761c57f commit b3caba6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1740
-248
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.quickbirdstudios.example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}

example/lib/main.dart

+75-65
Original file line numberDiff line numberDiff line change
@@ -15,75 +15,85 @@ class _MyAppState extends State<MyApp> {
1515
Widget build(BuildContext context) {
1616
return MaterialApp(
1717
home: Scaffold(
18-
body: SurveyKit(
19-
onResult: (SurveyResult result) {
20-
print(result.finishReason);
21-
},
22-
task: getSampleTask(),
23-
themeData: Theme.of(context).copyWith(
24-
colorScheme: ColorScheme.fromSwatch(
25-
primarySwatch: Colors.cyan,
26-
).copyWith(
27-
onPrimary: Colors.white,
28-
),
29-
primaryColor: Colors.cyan,
30-
backgroundColor: Colors.white,
31-
appBarTheme: const AppBarTheme(
32-
color: Colors.white,
33-
iconTheme: IconThemeData(
34-
color: Colors.cyan,
35-
),
36-
textTheme: TextTheme(
37-
button: TextStyle(
38-
color: Colors.cyan,
39-
),
40-
),
41-
),
42-
iconTheme: const IconThemeData(
43-
color: Colors.cyan,
44-
),
45-
outlinedButtonTheme: OutlinedButtonThemeData(
46-
style: ButtonStyle(
47-
minimumSize: MaterialStateProperty.all(
48-
Size(150.0, 60.0),
49-
),
50-
side: MaterialStateProperty.resolveWith(
51-
(Set<MaterialState> state) {
52-
if (state.contains(MaterialState.disabled)) {
53-
return BorderSide(
54-
color: Colors.grey,
55-
);
56-
}
57-
return BorderSide(
18+
body: Container(
19+
color: Colors.white,
20+
child: Align(
21+
alignment: Alignment.center,
22+
child: Container(
23+
height: double.infinity,
24+
width: 600,
25+
child: SurveyKit(
26+
onResult: (SurveyResult result) {
27+
print(result.finishReason);
28+
},
29+
task: getSampleTask(),
30+
themeData: Theme.of(context).copyWith(
31+
colorScheme: ColorScheme.fromSwatch(
32+
primarySwatch: Colors.cyan,
33+
).copyWith(
34+
onPrimary: Colors.white,
35+
),
36+
primaryColor: Colors.cyan,
37+
backgroundColor: Colors.white,
38+
appBarTheme: const AppBarTheme(
39+
color: Colors.white,
40+
iconTheme: IconThemeData(
5841
color: Colors.cyan,
59-
);
60-
},
61-
),
62-
shape: MaterialStateProperty.all(
63-
RoundedRectangleBorder(
64-
borderRadius: BorderRadius.circular(8.0),
42+
),
43+
textTheme: TextTheme(
44+
button: TextStyle(
45+
color: Colors.cyan,
46+
),
47+
),
6548
),
66-
),
67-
textStyle: MaterialStateProperty.resolveWith(
68-
(Set<MaterialState> state) {
69-
if (state.contains(MaterialState.disabled)) {
70-
return Theme.of(context).textTheme.button?.copyWith(
71-
color: Colors.grey,
49+
iconTheme: const IconThemeData(
50+
color: Colors.cyan,
51+
),
52+
outlinedButtonTheme: OutlinedButtonThemeData(
53+
style: ButtonStyle(
54+
minimumSize: MaterialStateProperty.all(
55+
Size(150.0, 60.0),
56+
),
57+
side: MaterialStateProperty.resolveWith(
58+
(Set<MaterialState> state) {
59+
if (state.contains(MaterialState.disabled)) {
60+
return BorderSide(
61+
color: Colors.grey,
62+
);
63+
}
64+
return BorderSide(
65+
color: Colors.cyan,
7266
);
73-
}
74-
return Theme.of(context).textTheme.button?.copyWith(
75-
color: Colors.cyan,
76-
);
77-
},
78-
),
79-
),
80-
),
81-
textButtonTheme: TextButtonThemeData(
82-
style: ButtonStyle(
83-
textStyle: MaterialStateProperty.all(
84-
Theme.of(context).textTheme.button?.copyWith(
85-
color: Colors.cyan,
67+
},
8668
),
69+
shape: MaterialStateProperty.all(
70+
RoundedRectangleBorder(
71+
borderRadius: BorderRadius.circular(8.0),
72+
),
73+
),
74+
textStyle: MaterialStateProperty.resolveWith(
75+
(Set<MaterialState> state) {
76+
if (state.contains(MaterialState.disabled)) {
77+
return Theme.of(context).textTheme.button?.copyWith(
78+
color: Colors.grey,
79+
);
80+
}
81+
return Theme.of(context).textTheme.button?.copyWith(
82+
color: Colors.cyan,
83+
);
84+
},
85+
),
86+
),
87+
),
88+
textButtonTheme: TextButtonThemeData(
89+
style: ButtonStyle(
90+
textStyle: MaterialStateProperty.all(
91+
Theme.of(context).textTheme.button?.copyWith(
92+
color: Colors.cyan,
93+
),
94+
),
95+
),
96+
),
8797
),
8898
),
8999
),

example/macos/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/xcuserdata/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
import FlutterMacOS
6+
import Foundation
7+
8+
9+
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10+
}

example/macos/Podfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.11'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

example/macos/Podfile.lock

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PODS:
2+
- FlutterMacOS (1.0.0)
3+
4+
DEPENDENCIES:
5+
- FlutterMacOS (from `Flutter/ephemeral`)
6+
7+
EXTERNAL SOURCES:
8+
FlutterMacOS:
9+
:path: Flutter/ephemeral
10+
11+
SPEC CHECKSUMS:
12+
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
13+
14+
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
15+
16+
COCOAPODS: 1.10.1

0 commit comments

Comments
 (0)