Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 32

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -40,7 +49,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -61,7 +70,4 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
26 changes: 18 additions & 8 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,37 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="Gradient Widgets"
android:icon="@mipmap/ic_launcher">

<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package com.example.example

import android.os.Bundle

import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity(): FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
}

}
8 changes: 4 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.7.10'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
12 changes: 6 additions & 6 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/bluemix/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/bluemix/flutter-projects/gradient_widgets/example"
export "FLUTTER_TARGET=/Users/bluemix/flutter-projects/gradient_widgets/example/lib/main.dart"
export "FLUTTER_ROOT=/Users/marsad/tools/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/marsad/Marsad/Flutter_Libraries/Gradient-Widgets/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/marsad/Marsad/Flutter_Libraries/Gradient-Widgets/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/bluemix/flutter-projects/gradient_widgets/example/.dart_tool/package_config.json"
export "PACKAGE_CONFIG=/Users/marsad/Marsad/Flutter_Libraries/Gradient-Widgets/example/.dart_tool/package_config.json"
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -136,7 +136,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -286,7 +286,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -333,7 +333,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
67 changes: 45 additions & 22 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Gradient Widgets'),
home: const MyHomePage(title: 'Gradient Widgets'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, this.title}) : super(key: key);
const MyHomePage({Key? key, this.title}) : super(key: key);

final String? title;

Expand All @@ -63,7 +63,8 @@ class _MyHomePageState extends State<MyHomePage> {
padding: const EdgeInsets.all(8),
child: Text(
title,
style: const TextStyle(color: Colors.black87, fontWeight: FontWeight.w200),
style: const TextStyle(
color: Colors.black87, fontWeight: FontWeight.w200),
),
),
Expanded(
Expand All @@ -84,15 +85,25 @@ class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
brightness: Brightness.light,
backgroundColor: Colors.transparent,
centerTitle: true,
elevation: 0,
// appBar: AppBar(
// // brightness: Brightness.light,
// systemOverlayStyle: SystemUiOverlayStyle.dark,
// backgroundColor: Colors.transparent,
// centerTitle: true,
// elevation: 0,
// title: Text(
// widget.title!,
// style: const TextStyle(
// color: Colors.grey, fontWeight: FontWeight.w300),
// ),
// ),
appBar: GradientAppbar(
title: Text(
widget.title!,
style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w300),
),
// systemOverlayStyle: SystemUiOverlayStyle.light,
elevation: 0,
centerTitle: true,
),
backgroundColor: Colors.white,
body: ListView(
Expand Down Expand Up @@ -132,10 +143,12 @@ class _MyHomePageState extends State<MyHomePage> {
child: GradientButton(
key: Key(namedGradient.name),
child: const Text('Gradient'),
callback: () => print('${namedGradient.name} clicked'),
callback: () =>
print('${namedGradient.name} clicked'),
increaseWidthBy: 20,
gradient: namedGradient.gradient,
shadowColor: namedGradient.gradient.colors.last.withOpacity(0.25),
shadowColor: namedGradient.gradient.colors.last
.withOpacity(0.25),
),
))
.toList(),
Expand All @@ -151,10 +164,12 @@ class _MyHomePageState extends State<MyHomePage> {
padding: const EdgeInsets.all(8),
child: CircularGradientButton(
key: Key('Circular ${namedGradient.name}'),
child: Icon(Icons.gradient),
callback: () => print('${namedGradient.name} clicked'),
child: const Icon(Icons.gradient),
callback: () =>
print('${namedGradient.name} clicked'),
gradient: namedGradient.gradient,
shadowColor: namedGradient.gradient.colors.last.withOpacity(0.5),
shadowColor: namedGradient.gradient.colors.last
.withOpacity(0.5),
elevation: 5,
),
))
Expand All @@ -175,7 +190,8 @@ class _MyHomePageState extends State<MyHomePage> {
.take(1)
.where((gradient) => gradient.gradient.colors.length == 2)
.map((namedGradient) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
padding: const EdgeInsets.symmetric(
horizontal: 0, vertical: 0),
child: _divider(' Determinate',
child: GradientProgressIndicator(
gradient: namedGradient.gradient,
Expand All @@ -199,7 +215,8 @@ class _MyHomePageState extends State<MyHomePage> {
),
const Text(
'Indeterminate',
style: const TextStyle(color: Colors.black87, fontWeight: FontWeight.w200),
style: TextStyle(
color: Colors.black87, fontWeight: FontWeight.w200),
),
],
),
Expand All @@ -210,9 +227,10 @@ class _MyHomePageState extends State<MyHomePage> {
radius: 116,
value: 70,
),
Text(
const Text(
'Determinate',
style: const TextStyle(color: Colors.black87, fontWeight: FontWeight.w200),
style: TextStyle(
color: Colors.black87, fontWeight: FontWeight.w200),
),
],
),
Expand All @@ -223,7 +241,7 @@ class _MyHomePageState extends State<MyHomePage> {
SizedBox(
height: 65 * (gradients.length / 3),
child: GridView.count(
physics: ScrollPhysics(),
physics: const ScrollPhysics(),
childAspectRatio: 0.7,
crossAxisCount: 5,
crossAxisSpacing: 2,
Expand All @@ -241,8 +259,13 @@ class _MyHomePageState extends State<MyHomePage> {
child: GradientCard(
gradient: gradients[index].gradient,
elevation: 8,
shadowColor: gradients[index].gradient.colors.last.withOpacity(0.25),
margin: const EdgeInsets.symmetric(vertical: 2, horizontal: 2),
shadowColor: gradients[index]
.gradient
.colors
.last
.withOpacity(0.25),
margin: const EdgeInsets.symmetric(
vertical: 2, horizontal: 2),
),
),
Expanded(
Expand All @@ -261,7 +284,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
),

Divider(
const Divider(
color: Colors.blueGrey,
),
],
Expand Down
Loading