Skip to content

Commit

Permalink
Fixed in Flutter 3.24.5, Available on idx.dev and Github CodeSpaces
Browse files Browse the repository at this point in the history
  • Loading branch information
911432 authored Dec 17, 2024
1 parent fe2101c commit edda645
Show file tree
Hide file tree
Showing 32 changed files with 195 additions and 133 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM dart

RUN apt-get update
RUN apt-get install -y curl git unzip xz-utils zip libglu1-mesa

RUN apt-get clean

RUN git clone https://github.com/flutter/flutter.git -b 3.24.5 --depth 1 /flutter
ENV PATH="/flutter/bin:$PATH"
RUN flutter doctor
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"forwardPorts": [3000],
"name": "Flutter",
"customizations": {
"vscode": {
"extensions": [
"Dart-Code.dart-code",
"Dart-Code.flutter"
]
}
}
}
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
.history
.svn/
migrate_working_dir/
logs/
*.lock
.metadata
analysis_options.yaml

# IntelliJ related
*.iml
Expand All @@ -31,14 +35,18 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
.metadata

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
# VM
android/
ios/
linux/
macos/
windows/
web/
40 changes: 40 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{pkgs}: {
channel = "stable-24.11";
packages = [
pkgs.jdk17
pkgs.unzip
];
idx.extensions = [

];
idx.previews = {
previews = {
web = {
command = [
"flutter"
"run"
"--machine"
"-d"
"web-server"
"--web-hostname"
"0.0.0.0"
"--web-port"
"$PORT"
];
manager = "flutter";
};
android = {
command = [
"flutter"
"run"
"--machine"
"-d"
"android"
"-d"
"localhost:5555"
];
manager = "flutter";
};
};
};
}
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
```bush
flutter run -d web-server --web-hostname 0.0.0.0 --web-port 3000
```
### Go to http://<hi1>0.0.0.0:3000<hi2> and Please wait a few minutes.
### When you return to the terminal, you will see the following message in the terminal:
```bush
🔥 To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".
```
2 changes: 1 addition & 1 deletion lib/common/dart/kotlin_style/kotlin_extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library useful_extension;
library;

export './function_invokes.dart';
export './kotlin_collections.dart';
Expand Down
29 changes: 14 additions & 15 deletions lib/common/data/preference/app_preferences.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:fast_app_base/common/theme/custom_theme.dart';
import 'package:flutter/foundation.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'item/preference_item.dart';
Expand Down Expand Up @@ -48,28 +47,28 @@ class AppPreferences {
return _prefs.setString(key, (value as DateTime).toIso8601String());
default:
if (value is Enum) {
return _prefs.setString(key, describeEnum(value));
return _prefs.setString(key, value.name);
} else {
throw Exception('$T 타입에 대한 저장 transform 함수를 추가 해주세요.');
}
}
} else {
switch (T) {
case int:
case const (int):
return _prefs.setInt(key, value as int);
case String:
case const (String):
return _prefs.setString(key, value as String);
case double:
case const (double):
return _prefs.setDouble(key, value as double);
case bool:
case const (bool):
return _prefs.setBool(key, value as bool);
case const (List<String>):
return _prefs.setStringList(key, value as List<String>);
case DateTime:
case const (DateTime):
return _prefs.setString(key, (value as DateTime).toIso8601String());
default:
if (value is Enum) {
return _prefs.setString(key, describeEnum(value));
return _prefs.setString(key, value.name);
} else {
throw Exception('$T 타입에 대한 저장 transform 함수를 추가 해주세요.');
}
Expand All @@ -85,13 +84,13 @@ class AppPreferences {
static T getValue<T>(PreferenceItem<T> item) {
final String key = getPrefKey(item);
switch (T) {
case int:
case const (int):
return _prefs.getInt(key) as T? ?? item.defaultValue;
case String:
case const (String):
return _prefs.getString(key) as T? ?? item.defaultValue;
case double:
case const (double):
return _prefs.getDouble(key) as T? ?? item.defaultValue;
case bool:
case const (bool):
return _prefs.getBool(key) as T? ?? item.defaultValue;
case const (List<String>):
return _prefs.getStringList(key) as T? ?? item.defaultValue;
Expand All @@ -117,13 +116,13 @@ class AppPreferences {
}
} else {
switch (t) {
case CustomTheme:
case const (CustomTheme):
return CustomTheme.values.asNameMap()[value] as T?;
case DateTime:
case const (DateTime):
return DateTime.parse(value) as T?;
default:
throw Exception('$t 타입에 대한 transform 함수를 추가 해주세요.');
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:fast_app_base/common/data/preference/item/preference_item.dart';

class NullablePreferenceItem<T> extends PreferenceItem<T?> {
NullablePreferenceItem(String key, [T? defaultValue]) : super(key, defaultValue);
NullablePreferenceItem(super.key, [super.defaultValue]);
}
15 changes: 7 additions & 8 deletions lib/common/data/preference/item/rx_preference_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ class RxPreferenceItem<T, R extends Rx<T>> extends PreferenceItem<T> {
final R _rxValue;
bool _isLoaded = false;

RxPreferenceItem(String key, T defaultValue)
: _rxValue = createRxValue<T, R>(defaultValue),
super(key, defaultValue);
RxPreferenceItem(super.key, super.defaultValue)
: _rxValue = createRxValue<T, R>(defaultValue);

void _load() {
_isLoaded = true;
Expand Down Expand Up @@ -47,16 +46,16 @@ class RxPreferenceItem<T, R extends Rx<T>> extends PreferenceItem<T> {

static R createRxValue<T, R extends Rx<T>>(T defaultValue) {
switch (T) {
case int:
case const (int):
return RxInt(defaultValue as int) as R;
case double:
case const (double):
return RxDouble(defaultValue as double) as R;
case bool:
case const (bool):
return RxBool(defaultValue as bool) as R;
case String:
case const (String):
return RxString(defaultValue as String) as R;
default:
return Rx<T>(defaultValue) as R;
}
}
}
}
15 changes: 7 additions & 8 deletions lib/common/data/preference/item/rxn_preference_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ class RxnPreferenceItem<T, R extends Rxn<T>> extends NullablePreferenceItem<T> {
final R _rxnValue;
bool _isLoaded = false;

RxnPreferenceItem(String key, [T? defaultValue])
: _rxnValue = createRxnValue<T, R>(defaultValue),
super(key, defaultValue);
RxnPreferenceItem(super.key, [super.defaultValue])
: _rxnValue = createRxnValue<T, R>(defaultValue);

void _load() {
_isLoaded = true;
Expand Down Expand Up @@ -46,16 +45,16 @@ class RxnPreferenceItem<T, R extends Rxn<T>> extends NullablePreferenceItem<T> {

static R createRxnValue<T, R extends Rxn<T>>([T? defaultValue]) {
switch (T) {
case int:
case const (int):
return RxnInt(defaultValue as int?) as R;
case double:
case const (double):
return RxnDouble(defaultValue as double?) as R;
case bool:
case const (bool):
return RxnBool(defaultValue as bool?) as R;
case String:
case const (String):
return RxnString(defaultValue as String?) as R;
default:
return Rxn<T>(defaultValue) as R;
}
}
}
}
4 changes: 2 additions & 2 deletions lib/common/theme/custom_theme_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'theme_util.dart';
class CustomThemeApp extends StatefulWidget {
final Widget child;

const CustomThemeApp({Key? key, required this.child}) : super(key: key);
const CustomThemeApp({super.key, required this.child});

@override
State<CustomThemeApp> createState() => _CustomThemeAppState();
Expand Down Expand Up @@ -42,4 +42,4 @@ class _CustomThemeAppState extends State<CustomThemeApp> {
return CustomTheme.light;
}
}
}
}
9 changes: 4 additions & 5 deletions lib/common/theme/custom_theme_holder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ class CustomThemeHolder extends InheritedWidget {
final Function(CustomTheme) changeTheme;

CustomThemeHolder({
required Widget child,
required super.child,
required this.theme,
required this.changeTheme,
Key? key,
super.key,
}) : appColors = theme.appColors,
appShadows = theme.appShadows,
super(key: key, child: child);
appShadows = theme.appShadows;

@override
bool updateShouldNotify(CustomThemeHolder oldWidget) {
Expand All @@ -31,4 +30,4 @@ class CustomThemeHolder extends InheritedWidget {
(context.dependOnInheritedWidgetOfExactType<CustomThemeHolder>())!;
return inherited;
}
}
}
4 changes: 2 additions & 2 deletions lib/common/util/local_json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LocalJson {

T _tryConverting<T>(dynamic json) {
switch (T) {
case Package:
case const (Package):
return Package.fromJson(json) as T;
default:
throw Exception("Please check _tryConverting method");
Expand All @@ -42,4 +42,4 @@ T _tryConverting<T>(dynamic json) {
// default:
// return ExampleVO.fromJson(json) as T;
// }
}
}
7 changes: 3 additions & 4 deletions lib/common/widget/scaffold/transparent_scaffold.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
///Dialog barrierDismissible 위한 Scaffold (From Flutter Framework)
///
///Material type: MaterialType.transparency 적용
library;

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
Expand All @@ -27,7 +28,7 @@ const FloatingActionButtonLocation _kDefaultFloatingActionButtonLocation =
const FloatingActionButtonAnimator _kDefaultFloatingActionButtonAnimator =
FloatingActionButtonAnimator.scaling;

const Curve _standardBottomSheetCurve = standardEasing;
const Curve _standardBottomSheetCurve = Easing.legacy;
// When the top of the BottomSheet crosses this threshold, it will start to
// shrink the FAB and show a scrim.
const double _kBottomSheetDominatesPercentage = 0.3;
Expand Down Expand Up @@ -2970,8 +2971,6 @@ class ScaffoldFeatureController<T extends Widget, U> {
final StateSetter? setState;
}

// TODO(guidezpl): Look into making this public. A copy of this class is in
// bottom_sheet.dart, for now, https://github.com/flutter/flutter/issues/51627
/// A curve that progresses linearly until a specified [startingPoint], at which
/// point [curve] will begin. Unlike [Interval], [curve] will not start at zero,
/// but will use [startingPoint] as the Y position.
Expand Down Expand Up @@ -3203,4 +3202,4 @@ class _ScaffoldScope extends InheritedWidget {
bool updateShouldNotify(_ScaffoldScope oldWidget) {
return hasDrawer != oldWidget.hasDrawer;
}
}
}
7 changes: 3 additions & 4 deletions lib/common/widget/w_arrow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ class Arrow extends StatelessWidget {
final double size;
final AxisDirection direction;

const Arrow({Key? key, this.size = 15, AxisDirection? direction})
: direction = direction ?? AxisDirection.right,
super(key: key);
const Arrow({super.key, this.size = 15, AxisDirection? direction})
: direction = direction ?? AxisDirection.right;

@override
Widget build(BuildContext context) {
Expand All @@ -28,4 +27,4 @@ class Arrow extends StatelessWidget {
return Icons.arrow_back_ios;
}
}
}
}
Loading

0 comments on commit edda645

Please sign in to comment.