mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 09:30:45 +00:00
refactor(app_snackbar): Изменить стиль снекбара, улучшив его внешний вид. (#11)
Co-authored-by: PetrovY <y.petrov@friflex.com>
This commit is contained in:
42
.vscode/launch.json
vendored
42
.vscode/launch.json
vendored
@@ -7,47 +7,17 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/lib/targets/dev.dart"
|
"program": "${workspaceFolder}/lib/targets/dev.dart"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "stage",
|
"name": "stage",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/lib/targets/stage.dart"
|
"program": "${workspaceFolder}/lib/targets/stage.dart"
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// "name": "GMS_stage",
|
"name": "prod",
|
||||||
// "type": "dart",
|
"type": "dart",
|
||||||
// "request": "launch",
|
"request": "launch",
|
||||||
// "program": "${workspaceFolder}/lib/targets/stage.dart",
|
"program": "${workspaceFolder}/lib/targets/prod.dart"
|
||||||
// "preLaunchTask": "switch_to_gms"
|
},
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "name": "GMS_prod",
|
|
||||||
// "type": "dart",
|
|
||||||
// "request": "launch",
|
|
||||||
// "program": "${workspaceFolder}/lib/targets/prod.dart",
|
|
||||||
// "preLaunchTask": "switch_to_gms"
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "name": "Aurora_dev",
|
|
||||||
// "type": "dart",
|
|
||||||
// "request": "launch",
|
|
||||||
// "program": "${workspaceFolder}/lib/targets/dev.dart",
|
|
||||||
// "preLaunchTask": "switch_to_aurora"
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "name": "Aurora_stage",
|
|
||||||
// "type": "dart",
|
|
||||||
// "request": "launch",
|
|
||||||
// "program": "${workspaceFolder}/lib/targets/stage.dart",
|
|
||||||
// "preLaunchTask": "switch_to_aurora"
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "name": "Aurora_prod",
|
|
||||||
// "type": "dart",
|
|
||||||
// "request": "launch",
|
|
||||||
// "program": "${workspaceFolder}/lib/targets/prod.dart",
|
|
||||||
// "preLaunchTask": "switch_to_aurora"
|
|
||||||
// },
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -198,10 +198,10 @@ class _AppSnackBarState extends State<AppSnackBar>
|
|||||||
animation: _slideAnimation,
|
animation: _slideAnimation,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return Positioned(
|
return Positioned(
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
top: _slideAnimation.value,
|
top: _slideAnimation.value,
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
|
||||||
child: Center(
|
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: _dismiss,
|
onTap: _dismiss,
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
@@ -213,17 +213,17 @@ class _AppSnackBarState extends State<AppSnackBar>
|
|||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 16,
|
vertical: 12,
|
||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
_Icon(type: widget.type),
|
_Icon(type: widget.type),
|
||||||
const WBox(10),
|
const WBox(10),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.message,
|
widget.message,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@@ -233,7 +233,6 @@ class _AppSnackBarState extends State<AppSnackBar>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -250,6 +249,7 @@ class _AppSnackBarState extends State<AppSnackBar>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// {@template _Icon}
|
/// {@template _Icon}
|
||||||
/// Виджет для отображения иконки в снекбаре
|
/// Виджет для отображения иконки в снекбаре
|
||||||
/// Используется для отображения иконки в зависимости от типа снекбара
|
/// Используется для отображения иконки в зависимости от типа снекбара
|
||||||
|
|||||||
@@ -67,6 +67,13 @@ class DebugScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: const Text('Экран локализации'),
|
child: const Text('Экран локализации'),
|
||||||
),
|
),
|
||||||
|
const HBox(16),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
context.pushNamed(DebugRoutes.componentsScreenName);
|
||||||
|
},
|
||||||
|
child: const Text('Экран компонентов'),
|
||||||
|
),
|
||||||
const HBox(22),
|
const HBox(22),
|
||||||
const Text('Имитирование ошибок:'),
|
const Text('Имитирование ошибок:'),
|
||||||
const HBox(16),
|
const HBox(16),
|
||||||
|
|||||||
Reference in New Issue
Block a user