Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Migration to Flutter 3.16.9 #13

Merged
merged 1 commit into from
Aug 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.13.6",
"flutterSdkVersion": "3.16.9",
"flavors": {}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# miro

Miro is user interface for KIRA Network to manage accounts, balance and transfer tokens between different wallets.

## Installation

Use git clone to download [miro](https://github.com/KiraCore/miro) project.

```bash
git clone [email protected]:KiraCore/miro.git
```

## Usage
The project runs on flutter version **3.13.6**. You can use [fvm](https://fvm.app/docs/getting_started/installation)

The project runs on flutter version **3.16.9**. You can
use [fvm](https://fvm.app/documentation/getting-started/installation)
for easy switching between versions

```bash
# Install and use required flutter version
fvm install 3.13.6
fvm use 3.13.6
fvm install 3.16.9
fvm use 3.16.9

# Install required packages in pubspec.yaml
fvm flutter pub get
Expand All @@ -25,9 +31,11 @@ fvm flutter run -d web-server
```

To generate config files use

```bash
fvm flutter pub run build_runner
```

```bash
# Built-in Commands
# - build: Runs a single build and exits.
Expand All @@ -43,7 +51,9 @@ fvm flutter pub run build_runner watch --delete-conflicting-outputs
```

## Tests

To run Unit Tests / Integration tests

```bash
# Run all Unit Tests
fvm flutter test test/unit --platform chrome --null-assertions
Expand All @@ -59,13 +69,15 @@ fvm flutter test test/unit/infra/services/api_kira/query_execution_fee_service_t
```

## Building, Deploying and Installing

To build project please run script in [deploy.sh](https://github.com/KiraCore/miro/deploy.sh). \
Deploy script is only intended to be run on Ubuntu 20.04.4 LTS.\
After successful build, open index.html in "/miro/build/web".\
Enjoy!
Enjoy!

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what would like to improve. Please

Pull requests are welcome. For major changes, please open an issue first to discuss what would like to improve. Please
make sure to update tests as well.

## [Licence](./LICENSE.md)
2 changes: 1 addition & 1 deletion lib/config/locator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import 'package:miro/shared/controllers/global_nav/global_nav_controller.dart';

final GetIt globalLocator = GetIt.I;

Future<void> initLocator() async {
void initLocator() {
globalLocator
..registerLazySingleton<AppConfig>(AppConfig.buildDefaultConfig)
..registerLazySingleton<ICacheManager>(AutoCacheManager.new);
Expand Down
2 changes: 1 addition & 1 deletion lib/config/theme/theme_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:miro/config/theme/design_colors.dart';

class ThemeConfig {
static ThemeData buildTheme({required bool isSmallScreen}) {
final ThemeData themeData = ThemeData.dark();
final ThemeData themeData = ThemeData.dark(useMaterial3: false);

return themeData.copyWith(
colorScheme: const ColorScheme.dark(background: DesignColors.background),
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Future<void> main() async {
// disable default context menu
window.document.onContextMenu.listen((MouseEvent mouseEvent) => mouseEvent.preventDefault());

await initLocator();
initLocator();
await globalLocator<ICacheManager>().init();

Map<String, dynamic> configJson = await AssetsManager().getAsMap('assets/network_list_config.json');
Expand Down
2 changes: 1 addition & 1 deletion lib/test/utils/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class TestUtils {
}

static Future<void> initIntegrationTest() async {
await initLocator();
initLocator();
await globalLocator<ICacheManager>().init();
globalLocator<AppConfig>().init(MockNetworkListConfigJson.defaultNetworkListConfig);
}
Expand Down
7 changes: 3 additions & 4 deletions lib/views/layout/drawer/kira_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class _KiraDrawer extends State<KiraDrawer> {
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => _handleDrawerShadowTap(context),
child: WillPopScope(
onWillPop: _onWillPop,
child: PopScope(
onPopInvoked: (_) => _handlePopInvoked(),
child: SizedBox(
width: widget.width,
height: MediaQuery.of(context).size.height,
Expand Down Expand Up @@ -72,14 +72,13 @@ class _KiraDrawer extends State<KiraDrawer> {
}
}

Future<bool> _onWillPop() async {
Future<void> _handlePopInvoked() async {
bool canPop = drawerCubit.canPop;
if (canPop) {
_handleDrawerPop();
} else {
_handleDrawerClose();
}
return Future<bool>.value(canPop);
}

void _handleDrawerPop() {
Expand Down
9 changes: 4 additions & 5 deletions lib/views/layout/scaffold/backdrop/backdrop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ class _Backdrop extends State<Backdrop> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () => _handleTryPop(context),
return PopScope(
canPop: _isExpanded,
onPopInvoked: (_) => _handlePopInvoked(context),
child: Column(
children: <Widget>[
AnimatedBuilder(
Expand Down Expand Up @@ -89,12 +90,10 @@ class _Backdrop extends State<Backdrop> with SingleTickerProviderStateMixin {
}
}

Future<bool> _handleTryPop(BuildContext context) async {
Future<void> _handlePopInvoked(BuildContext context) async {
if (_isExpanded) {
collapse();
return false;
}
return true;
}

bool get _isCollapsed => _collapsedAnimationStatusList.contains(animationController.status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _DateRangeDropdownPopMenu extends State<DateRangeDropdownPopMenu> {

return Container(
padding: const EdgeInsets.symmetric(vertical: 16),
width: 250,
width: 310,
height: 440,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _PopWrapperMobile extends State<PopWrapperMobile> {
),
backgroundColor: themeData.scaffoldBackgroundColor,
child: Container(
constraints: const BoxConstraints(maxWidth: 200),
constraints: const BoxConstraints(maxWidth: 310),
decoration: BoxDecoration(
color: widget.backgroundColor,
borderRadius: BorderRadius.circular(8),
Expand Down
2 changes: 1 addition & 1 deletion lib/views/widgets/kira/kira_tab_bar/kira_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class KiraTabBar extends StatelessWidget {
TextTheme textTheme = Theme.of(context).textTheme;

return Theme(
data: ThemeData().copyWith(
data: ThemeData(useMaterial3: false).copyWith(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
Expand Down
Loading