Nathan.fooo 61fd608200
Feat/view map database (#1885)
* refactor: rename structs

* chore: read database id from view

* chore: fix open database error because of create a database view for database id

* chore: fix tests

* chore: rename datbase id to view id in flutter

* refactor: move grid and board to database view folder

* refactor: rename functions

* refactor: move calender to datbase view folder

* refactor: rename app_flowy to appflowy_flutter

* chore: reanming

* chore: fix freeze gen

* chore: remove todos

* refactor: view process events

* chore: add link database test

* chore: just open view if there is opened database
2023-02-26 16:27:17 +08:00

43 lines
1.1 KiB
Dart

import 'package:appflowy/startup/startup.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
class FlowyMessageToast extends StatelessWidget {
final String message;
const FlowyMessageToast({required this.message, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4)),
color: Colors.black,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: FlowyText.medium(
message,
color: Colors.white,
fontSize: FontSizes.s16,
),
),
);
}
}
void initToastWithContext(BuildContext context) {
getIt<FToast>().init(context);
}
void showMessageToast(String message) {
final child = FlowyMessageToast(message: message);
getIt<FToast>().showToast(
child: child,
gravity: ToastGravity.BOTTOM,
toastDuration: const Duration(seconds: 3),
);
}