Skip to content

Commit

Permalink
Upgrade Flutter app packages
Browse files Browse the repository at this point in the history
  • Loading branch information
bplaat committed Aug 29, 2023
1 parent e5e5bf1 commit 059b05d
Show file tree
Hide file tree
Showing 13 changed files with 262 additions and 194 deletions.
2 changes: 1 addition & 1 deletion apps/flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
18 changes: 7 additions & 11 deletions apps/flutter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,24 @@ class StrepenApp extends StatelessWidget {
return MaterialApp(
title: 'Strepen',
debugShowCheckedModeBanner: false,

localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,

theme: ThemeData(
brightness: Brightness.light,
primarySwatch: Colors.pink,
accentColor: Colors.pink
),
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.pink)
.copyWith(secondary: Colors.pink)),
darkTheme: ThemeData(
brightness: Brightness.dark,
primarySwatch: Colors.pink,
accentColor: Colors.pink
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.pink)
.copyWith(secondary: Colors.pink, brightness: Brightness.dark),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.pink, foregroundColor: Colors.white),
),

initialRoute: '/loading',
routes: {
'/loading': (context) => const LoadingScreen(),
'/home': (context) => const HomeScreen(),
'/#': (context) => const LoginScreen(),
'/settings': (context) => const SettingsScreen(),
}
},
);
}
}
Expand Down
43 changes: 21 additions & 22 deletions apps/flutter/lib/screens/home_screen_posts_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class _HomeScreenPostsTabState extends State {
: (_posts.isNotEmpty
? ListView.builder(
controller: _scrollController,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
itemCount: _posts.length,
itemBuilder: (context, index) =>
PostItem(post: _posts[index]))
Expand Down Expand Up @@ -170,23 +171,21 @@ class _PostItemState extends State {
.format(post.createdAt)),
style: const TextStyle(color: Colors.grey))),
Html(
data: post.body,
style: {
'body': Style(
margin: Margins.zero,
padding: EdgeInsets.zero)
},
onLinkTap: (String? url,
RenderContext context,
Map<String, String> attributes,
dom.Element? element) async {
if (url != null) {
Uri uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
}
}
}),
data: post.body,
style: {
'body': Style(
margin: Margins.zero,
padding: HtmlPaddings.zero,
)
},
onLinkTap: (String? url,
Map<String, String> attributes,
dom.Element? element) async {
if (url == null) return;
Uri uri = Uri.parse(url);
if (await canLaunchUrl(uri)) await launchUrl(uri);
},
),
Row(children: [
// Like button
Expanded(
Expand All @@ -210,8 +209,8 @@ class _PostItemState extends State {
post.likes > 0
? post.likes.toString()
: lang.home_posts_like,
style:
const TextStyle(color: Colors.white)))
style: const TextStyle(
color: Colors.white)))
: OutlinedButton.icon(
onPressed: () async {
await post.like();
Expand Down Expand Up @@ -250,8 +249,8 @@ class _PostItemState extends State {
post.dislikes > 0
? post.dislikes.toString()
: lang.home_posts_dislike,
style:
const TextStyle(color: Colors.white)))
style: const TextStyle(
color: Colors.white)))
: OutlinedButton.icon(
onPressed: () async {
await post.dislike();
Expand Down
4 changes: 4 additions & 0 deletions apps/flutter/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

#include "generated_plugin_registrant.h"

#include <file_selector_linux/file_selector_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
1 change: 1 addition & 0 deletions apps/flutter/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
url_launcher_linux
)

Expand Down
2 changes: 2 additions & 0 deletions apps/flutter/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import FlutterMacOS
import Foundation

import file_selector_macos
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Expand Down
20 changes: 13 additions & 7 deletions apps/flutter/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PODS:
- file_selector_macos (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
Expand All @@ -16,9 +18,10 @@ PODS:
- FlutterMacOS

DEPENDENCIES:
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

Expand All @@ -27,24 +30,27 @@ SPEC REPOS:
- FMDB

EXTERNAL SOURCES:
file_selector_macos:
:path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

Expand Down
2 changes: 1 addition & 1 deletion apps/flutter/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
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 = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading

0 comments on commit 059b05d

Please # to comment.