Skip to content

Commit

Permalink
Flutter demo updates (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok authored Jun 27, 2024
1 parent 57575ee commit 1c9fd4d
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flutter-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
with:
submodules: recursive

- name: Install Flutter 2.8.1
- name: Install Flutter 3.22.2
uses: subosito/flutter-action@v2
with:
flutter-version: 2.8.1
flutter-version: 3.22.2

- name: Run Binding Analyzer
run: flutter analyze --no-fatal-infos --no-fatal-warnings
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/flutter-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ on:
- '.github/workflows/flutter.yml'
- 'demo/flutter/**'
- '!demo/flutter/README.md'
- 'demo/flutter-clock/**'
- '!demo/flutter-clock/README.md'
pull_request:
branches: [ master, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/flutter.yml'
- 'demo/flutter/**'
- '!demo/flutter/README.md'
- 'demo/flutter-clock/**'
- '!demo/flutter-clock/README.md'

defaults:
run:
Expand All @@ -25,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['2.8.1', '3.0.4']
flutter-version: ['3.3.0', '3.22.2']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -54,10 +58,10 @@ jobs:

build-ios:
name: Build iOS demo
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
flutter-version: ['2.8.1', '3.0.4']
flutter-version: ['3.3.0', '3.22.2']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -90,7 +94,7 @@ jobs:

strategy:
matrix:
flutter-version: ['2.8.1', '3.0.4']
flutter-version: ['2.10.0', '3.3.0', '3.22.2']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -118,14 +122,14 @@ jobs:
run: flutter build apk

build-clock-ios:
runs-on: macos-11
runs-on: macos-12
defaults:
run:
working-directory: demo/flutter-clock

strategy:
matrix:
flutter-version: ['2.8.1', '3.0.4']
flutter-version: ['2.10.0', '3.3.0', '3.22.2']

steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.pico_clock;

import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
}

This file was deleted.

32 changes: 16 additions & 16 deletions demo/flutter-clock/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class MyApp extends StatelessWidget {
focusColor: picoBlue,
highlightColor: picoRed,
textTheme: TextTheme(
headline1: TextStyle(
displayLarge: TextStyle(
fontSize: 60, fontWeight: FontWeight.bold, color: picoBlue),
headline2: TextStyle(
displayMedium: TextStyle(
fontSize: 60, fontWeight: FontWeight.bold, color: picoGrey),
subtitle1: TextStyle(fontSize: 23, color: picoGrey),
subtitle2: TextStyle(fontSize: 15, color: picoRed),
bodyText1: TextStyle(fontSize: 18, color: lightGrey))),
titleMedium: TextStyle(fontSize: 23, color: picoGrey),
titleSmall: TextStyle(fontSize: 15, color: picoRed),
bodyLarge: TextStyle(fontSize: 18, color: lightGrey))),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
Expand Down Expand Up @@ -141,10 +141,10 @@ class _MyHomePageState extends State<MyHomePage> {
_performStopwatchCommand(slots);
} else if (inference.intent! == 'availableCommands') {
Fluttertoast.showToast(
msg: "Try saying: \n" +
" - 'set timer for 5 minutes'\n" +
" - 'set alarm for tomorrow at 10:30am'\n" +
" - 'start stopwatch'\n" +
msg: "Try saying: \n"
" - 'set timer for 5 minutes'\n"
" - 'set alarm for tomorrow at 10:30am'\n"
" - 'start stopwatch'\n"
" - 'show me the time'",
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.TOP,
Expand All @@ -155,7 +155,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
} else {
Fluttertoast.showToast(
msg: "Didn't understand command!\n" +
msg: "Didn't understand command!\n"
"Say 'PicoClock, what can I say?' to see a list of example commands",
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.TOP,
Expand Down Expand Up @@ -416,14 +416,14 @@ class _MyHomePageState extends State<MyHomePage> {
alignment: Alignment.center,
child: Text(
DateFormat.jm().format(_clockTime),
style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.displayLarge,
)),
Container(
alignment: Alignment.center,
padding: EdgeInsets.only(top: 100),
child: Text(
DateFormat.MMMMEEEEd().format(_clockTime),
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
)),
Container(
alignment: Alignment.bottomCenter,
Expand All @@ -441,7 +441,7 @@ class _MyHomePageState extends State<MyHomePage> {
_alarmTime == null || _alarmTextInvisible
? ""
: DateFormat.MMMEd().add_jm().format(_alarmTime!),
style: Theme.of(context).textTheme.subtitle2,
style: Theme.of(context).textTheme.titleSmall,
)),
]);
}
Expand All @@ -459,7 +459,7 @@ class _MyHomePageState extends State<MyHomePage> {
: _timerStopwatch.isRunning
? timerStr
: "00:00:00",
style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.displayLarge,
)),
]);
}
Expand All @@ -477,7 +477,7 @@ class _MyHomePageState extends State<MyHomePage> {
alignment: Alignment.center,
child: Text(
stopwatchStr,
style: Theme.of(context).textTheme.headline1,
style: Theme.of(context).textTheme.displayLarge,
)),
]);
}
Expand Down Expand Up @@ -533,7 +533,7 @@ class _MyHomePageState extends State<MyHomePage> {
Container(
margin: EdgeInsets.only(bottom: 10),
child: Text("Say 'PicoClock'!",
style: Theme.of(context).textTheme.bodyText1))
style: Theme.of(context).textTheme.bodyLarge))
],
)
]),
Expand Down
4 changes: 2 additions & 2 deletions demo/flutter-clock/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: ">=2.15.0 <4.0.0"
flutter: ">=2.8.1"
sdk: ">=2.16.0 <4.0.0"
flutter: ">=2.10.0"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions demo/flutter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class _MyAppState extends State<MyApp> {

buildContextHeader(BuildContext context) {
final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
primary: picoBlue, textStyle: TextStyle(color: Colors.white));
backgroundColor: picoBlue, textStyle: TextStyle(color: Colors.white));

return Expanded(
flex: 1,
Expand Down Expand Up @@ -299,7 +299,7 @@ class _MyAppState extends State<MyApp> {

buildStartButton(BuildContext context) {
final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
primary: picoBlue,
backgroundColor: picoBlue,
shape: CircleBorder(),
textStyle: TextStyle(color: Colors.white));

Expand Down
4 changes: 2 additions & 2 deletions demo/flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ publish_to: 'none'
version: 1.0.0

environment:
sdk: ">=2.15.0 <4.0.0"
flutter: ">=2.8.1"
sdk: ">=2.18.0 <4.0.0"
flutter: ">=3.3.0"

dependencies:
flutter:
Expand Down

0 comments on commit 1c9fd4d

Please sign in to comment.