Skip to content

Commit

Permalink
Merge pull request #26 from umbrew/add-text-style
Browse files Browse the repository at this point in the history
Add text style
  • Loading branch information
theklausster authored Aug 16, 2021
2 parents 3f464e4 + 0866981 commit 763913c
Show file tree
Hide file tree
Showing 16 changed files with 495 additions and 521 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.1.4]

* Upgrade example to AndroidX and Android embedded v2

## [1.1.3]

* Fix to support any lines
Expand Down
6 changes: 3 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
Expand All @@ -56,6 +56,6 @@ flutter {

dependencies {
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'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
18 changes: 14 additions & 4 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -21,13 +20,24 @@
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). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- Specify that the launch screen should continue being displayed -->
<!-- until Flutter renders its first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- Theme to apply as soon as Flutter begins rendering frames -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/LaunchTheme"
/>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package com.example.example;

import android.os.Bundle;

import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:4.0.2'
}
}

Expand Down
3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
org.gradle.jvmargs=-Xmx1536M

android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Mon Oct 19 14:04:52 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
40 changes: 12 additions & 28 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@ class _MyHomePageState extends State<MyHomePage> with FakeChartSeries {
LineChart chart;

if (chartIndex == 0) {
chart = LineChart.fromDateTimeMaps(
[line1, line2], [Colors.green, Colors.blue], ['C', 'C'],
tapTextFontWeight: FontWeight.w400);
chart = LineChart.fromDateTimeMaps([line1, line2], [Colors.green, Colors.blue], ['C', 'C'], tapTextFontWeight: FontWeight.w400);
} else if (chartIndex == 1) {
chart = LineChart.fromDateTimeMaps(
[createLineAlmostSaveValues()], [Colors.green], ['C'],
tapTextFontWeight: FontWeight.w400);
chart = LineChart.fromDateTimeMaps([createLineAlmostSaveValues()], [Colors.green], ['C'], tapTextFontWeight: FontWeight.w400);
} else {
chart = AreaLineChart.fromDateTimeMaps(
[line1], [Colors.red.shade900], ['C'],
chart = AreaLineChart.fromDateTimeMaps([line1], [Colors.red.shade900], ['C'],
gradients: [Pair(Colors.yellow.shade400, Colors.red.shade700)]);
}

Expand All @@ -71,14 +66,10 @@ class _MyHomePageState extends State<MyHomePage> with FakeChartSeries {
children: <Widget>[
FlatButton(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black45),
borderRadius: BorderRadius.all(Radius.circular(3))),
side: BorderSide(color: Colors.black45), borderRadius: BorderRadius.all(Radius.circular(3))),
child: Text(
'LineChart',
style: TextStyle(
color: chartIndex == 0
? Colors.black
: Colors.black12),
style: TextStyle(color: chartIndex == 0 ? Colors.black : Colors.black12),
),
onPressed: () {
setState(() {
Expand All @@ -88,13 +79,8 @@ class _MyHomePageState extends State<MyHomePage> with FakeChartSeries {
),
FlatButton(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black45),
borderRadius: BorderRadius.all(Radius.circular(3))),
child: Text('LineChart2',
style: TextStyle(
color: chartIndex == 1
? Colors.black
: Colors.black12)),
side: BorderSide(color: Colors.black45), borderRadius: BorderRadius.all(Radius.circular(3))),
child: Text('LineChart2', style: TextStyle(color: chartIndex == 1 ? Colors.black : Colors.black12)),
onPressed: () {
setState(() {
chartIndex = 1;
Expand All @@ -103,13 +89,8 @@ class _MyHomePageState extends State<MyHomePage> with FakeChartSeries {
),
FlatButton(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black45),
borderRadius: BorderRadius.all(Radius.circular(3))),
child: Text('AreaChart',
style: TextStyle(
color: chartIndex == 2
? Colors.black
: Colors.black12)),
side: BorderSide(color: Colors.black45), borderRadius: BorderRadius.all(Radius.circular(3))),
child: Text('AreaChart', style: TextStyle(color: chartIndex == 2 ? Colors.black : Colors.black12)),
onPressed: () {
setState(() {
chartIndex = 2;
Expand All @@ -125,6 +106,9 @@ class _MyHomePageState extends State<MyHomePage> with FakeChartSeries {
child: AnimatedLineChart(
chart,
key: UniqueKey(),
gridColor: Colors.black54,
textStyle: TextStyle(fontSize: 10, color: Colors.black54),
toolTipColor: Colors.white,
), //Unique key to force animations
)),
SizedBox(width: 200, height: 50, child: Text('')),
Expand Down
99 changes: 32 additions & 67 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,69 +1,62 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.15.0-nullsafety.3"
fake_async:
dependency: transitive
description:
name: crypto
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.2.0-nullsafety.1"
fl_animated_linechart:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.1.3"
version: "1.1.4"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -74,13 +67,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
intl:
dependency: transitive
description:
Expand All @@ -94,35 +80,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety.3"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.8.0-nullsafety.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -134,62 +106,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.19-nullsafety.2"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0-nullsafety.3"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.6.0 <3.0.0"
dart: ">=2.10.0-110 <2.11.0"
Loading

0 comments on commit 763913c

Please sign in to comment.